提交 25d779e6 作者: 张小凤

GambitServiceImpl(update)

上级 f91cb9f8
......@@ -154,7 +154,7 @@ public class GambitController extends BaseController{
@GetMapping("/userMessage")
public ResultBody<ForumCountDO> userMessage(HttpServletRequest request, @ApiParam(value = "userAccountId") @RequestParam Integer userAccountId){
Integer userId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
return gambitService.userMessage(userAccountId,userId);
return gambitService.userMessage(userAccountId,userId,request);
}
......
......@@ -48,6 +48,8 @@ public class ForumCountDO implements Serializable {
@ApiModelProperty(value = "实名认证的用户信息")
private UserAccountMessageVo userAccountMessageVo;
@ApiModelProperty(value = "是否是飞手")
private Boolean pilotStatus;
}
......@@ -43,5 +43,5 @@ public interface GambitService {
PageResult myFansList(UserTopicDynamicsQO userTopicDynamicsQO);
ResultBody userMessage(Integer userAccountId,Integer userId);
ResultBody userMessage(Integer userAccountId,Integer userId,HttpServletRequest request);
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.infomation.dto.PilotCertificationInteriorDTO;
import com.mmc.csf.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.constant.TokenConstant;
......@@ -440,7 +441,7 @@ public class GambitServiceImpl implements GambitService {
}
@Override
public ResultBody userMessage(Integer userAccountId,Integer userId) {
public ResultBody userMessage(Integer userAccountId,Integer userId,HttpServletRequest request) {
ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId);
if (forumCountDO==null){
gambitDao.insertCount(userAccountId);
......@@ -456,6 +457,13 @@ public class GambitServiceImpl implements GambitService {
if (i1!=0){
forumCountDO.setStatus(true);
}
PilotCertificationInteriorDTO pilotCertificationInteriorDTO = feignInteriorDetailPilot(userAccountId, request);
if (pilotCertificationInteriorDTO!=null){
forumCountDO.setPilotStatus(true);
}
if (pilotCertificationInteriorDTO==null){
forumCountDO.setPilotStatus(false);
}
return ResultBody.success(forumCountDO);
}
......@@ -522,4 +530,15 @@ public class GambitServiceImpl implements GambitService {
return userAccountVO;
}
public PilotCertificationInteriorDTO feignInteriorDetailPilot(Integer userAccountId, HttpServletRequest request) {
String token = request.getHeader("token");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(userAccountId), headers);
ResponseEntity<PilotCertificationInteriorDTO> exchange1 = restTemplate.exchange(userApp + "/userapp/pilot/interiorDetailPilot?userAccountId=" + userAccountId, HttpMethod.GET, entity, PilotCertificationInteriorDTO.class);
PilotCertificationInteriorDTO body = exchange1.getBody();
return body;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论