|
@@ -61,14 +61,17 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
return CommonResponse.success();
|
|
|
}
|
|
|
for (GhDetail ghDetail : ghDetails) {
|
|
|
- getGhDetail(ghDetail);
|
|
|
+ GhDetail updateGhDetail = getGhDetail(ghDetail);
|
|
|
+ if (updateGhDetail == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
log.info("getGhDetail = {}", ghDetail);
|
|
|
- ghDetailMapper.updateByPrimaryKeySelective(ghDetail);
|
|
|
+ ghDetailMapper.updateByPrimaryKeySelective(updateGhDetail);
|
|
|
}
|
|
|
return CommonResponse.success();
|
|
|
}
|
|
|
|
|
|
- public void getGhDetail(GhDetail ghDetail) {
|
|
|
+ public GhDetail getGhDetail(GhDetail ghDetail) {
|
|
|
String baseUrl = String.format("http://aigc-api.cybertogether.net/aigc/publish/account/algorithm/wechat/list?gh_id=%s", ghDetail.getId());
|
|
|
WebClient webClient = WebClient.builder()
|
|
|
.baseUrl(baseUrl)
|
|
@@ -78,7 +81,9 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
JSONArray jsonArray = JSONArray.parseArray(block);
|
|
|
if (jsonArray != null && !jsonArray.isEmpty()) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
|
|
+ log.info("jsonObject = {}", jsonObject);
|
|
|
ghDetail.setGhName(jsonObject.getString("name"));
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|