Commit 347e9461 347e9461ecf2e26462ccfc3194ab0f9cb73df039 by xianghan

1.修改部分接口返回值类型

1 parent 2c023a99
......@@ -283,21 +283,21 @@ public class UserOperationController {
@ApiOperation("同步大屏成长报告")
@AnonymousAccess
public ResultInfo saveGrowthReport(@Validated @RequestBody String resources) {
log.info("同步大屏成长报告失败,参数 ==>> [saveGrowthReport#{}]", resources);
log.info("同步大屏成长报告,参数 ==>> [saveGrowthReport#{}]", resources);
GrowthReportRequest growthReportRequest = JSON.parseObject(new String(Base64Utils.decode(resources.getBytes())), GrowthReportRequest.class);
String platformAccount = growthReportRequest.getPlatformAccount();
log.info("同步大屏成长报告消息,大屏账号 ==>> [saveGrowthReport#{}]", platformAccount);
List<GrowthReportRequest.CategoryContent> playDurationWithCategory = growthReportRequest.getPlayDurationWithCategory();
log.info("同步大屏成长报告消息主体,消息体 ==>> [saveGrowthReport#{}]", playDurationWithCategory);
if (!CollectionUtils.isEmpty(playDurationWithCategory)) {
GrowthReport growthReport = new GrowthReport();
growthReport.setPlatformAccount(platformAccount);
JSONObject jsonObject = new JSONObject();
// jsonObject.put("playDurationWithCategory", JSONArray.toJSONString(playDurationWithCategory));
jsonObject.put("playDurationWithCategory", playDurationWithCategory);
growthReport.setData(jsonObject.toJSONString());
boolean result = this.userOperationService.saveGrowthReport(growthReport);
return ResultInfo.success(result);
return this.userOperationService.saveGrowthReport(growthReport);
}
return ResultInfo.failure("保存失败");
......@@ -595,7 +595,7 @@ public class UserOperationController {
} else {
// 账号存在,未关注
if (userWeixinDTO.getStatus() != SUBSCRIBE_STATUS) {
if (!userWeixinDTO.getStatus().equals(SUBSCRIBE_STATUS)) {
result = UNSUBSCRIBE;
}
......@@ -658,7 +658,7 @@ public class UserOperationController {
String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8");
// String imageEncode = Base64Util.encode(headimgurlDecode);
String image = RestTemplateClient.netImage(headimgurlDecode);
memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) == true ? image:headimgurlDecode);
memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) ? image:headimgurlDecode);
}
}
......@@ -693,8 +693,7 @@ public class UserOperationController {
private String downloadWeixinImge(String headimgurl){
try {
if (StringUtils.isNotBlank(headimgurl)) {
String image = RestTemplateClient.netImage(headimgurl);
return image;
return RestTemplateClient.netImage(headimgurl);
}
} catch (Exception e) {
log.info("头像解析失败!!!");
......
......@@ -214,7 +214,7 @@ public interface UserOperationService {
* @param growthReport
* @return
*/
boolean saveGrowthReport(GrowthReport growthReport);
ResultInfo saveGrowthReport(GrowthReport growthReport);
boolean appCancellation(UserApp userApp);
......
......@@ -173,15 +173,7 @@ public class UserOperationServiceImpl implements UserOperationService {
Integer accountType = resources.getAccountType();
UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType);
if (Objects.nonNull(userAppBindDTO.getId())) {
boolean result = this.userAppBindService.cancelUserAppBind(account, accountType);
/* if (result) {
UserAppBindDTO _userAppBindDTO = new UserAppBindDTO();
_userAppBindDTO.setAccount(account);
_userAppBindDTO.setAccountType(accountType);
((UserOperationServiceImpl) AopContext.currentProxy()).asyncCancelUserAppBind(_userAppBindDTO);
}*/
return result;
return this.userAppBindService.cancelUserAppBind(account, accountType);
}
return false;
}
......@@ -279,13 +271,13 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveGrowthReport(GrowthReport growthReport) {
public ResultInfo saveGrowthReport(GrowthReport growthReport) {
String platformAccount = growthReport.getPlatformAccount();
UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount);
if (Objects.isNull(userTvDTO.getId())) {
log.error("保存成长报告失败,大屏信息不存在[saveGrowthReport#]");
return false;
return ResultInfo.failure("保存成长报告失败,大屏信息不存在");
}
String weekFirstDay = com.topdraw.util.DateUtil.getWeekFirstDay();
......@@ -298,14 +290,16 @@ public class UserOperationServiceImpl implements UserOperationService {
growthReport.setMemberId(memberId);
growthReport.setStartDate(weekFirstDay);
growthReport.setEndDate(weekLastDay);
log.info("保存成长报告,参数[saveGrowthReport#{}]", growthReport);
this.growthReportService.create(growthReport);
} else {
log.info("修改成长报告,参数[saveGrowthReport#{}]", growthReport);
this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData());
}
((UserOperationServiceImpl)AopContext.currentProxy()).asyncsaveGrowthReport(growthReport);
return false;
return ResultInfo.success("保存成功");
}
@Override
......