Commit 8f8a972a authored by codezwjava's avatar codezwjava

用户直推信息接口修改

parent e821cb5b
...@@ -16,6 +16,12 @@ public class UserAndRecommendVo { ...@@ -16,6 +16,12 @@ public class UserAndRecommendVo {
@ApiModelProperty(value = "用户id", name = "userId") @ApiModelProperty(value = "用户id", name = "userId")
private String userId; private String userId;
/**
* 当月消费金额
*/
@ApiModelProperty(value = "用户头像", name = "headImage")
private String headImage;
/** /**
* 当月消费金额 * 当月消费金额
*/ */
......
...@@ -37,6 +37,13 @@ public class RecommendUserServiceImpl implements RecommendUserService { ...@@ -37,6 +37,13 @@ public class RecommendUserServiceImpl implements RecommendUserService {
return recommendUserMapper.getByUserId(userId); return recommendUserMapper.getByUserId(userId);
} }
/**
* 获取我的直推用户信息表
* @param userId
* @param userLevel
* @return
*/
@Override
public List<UserAndRecommendVo> getMyRecommendInfo(String userId, Integer userLevel){ public List<UserAndRecommendVo> getMyRecommendInfo(String userId, Integer userLevel){
//当前用户的邀请码 //当前用户的邀请码
...@@ -46,6 +53,7 @@ public class RecommendUserServiceImpl implements RecommendUserService { ...@@ -46,6 +53,7 @@ public class RecommendUserServiceImpl implements RecommendUserService {
List<UserAndRecommendVo> userAndRecommendVos = new ArrayList<>(); List<UserAndRecommendVo> userAndRecommendVos = new ArrayList<>();
for (User user : byInviteCode) { for (User user : byInviteCode) {
UserAndRecommendVo userAndRecommendVo = new UserAndRecommendVo(); UserAndRecommendVo userAndRecommendVo = new UserAndRecommendVo();
userAndRecommendVo.setHeadImage(user.getHeadImage());
userAndRecommendVo.setUserId(user.getUserId()); userAndRecommendVo.setUserId(user.getUserId());
userAndRecommendVo.setMonthyCount(recommendUserMapper.getByUserId(userId).getMonthyCount()); userAndRecommendVo.setMonthyCount(recommendUserMapper.getByUserId(userId).getMonthyCount());
userAndRecommendVo.setHistoryCount(recommendUserMapper.getByUserId(userId).getHistoryCount()); userAndRecommendVo.setHistoryCount(recommendUserMapper.getByUserId(userId).getHistoryCount());
......
...@@ -15,10 +15,7 @@ import cn.wisenergy.service.app.UserService; ...@@ -15,10 +15,7 @@ import cn.wisenergy.service.app.UserService;
import cn.wisenergy.web.common.BaseController; import cn.wisenergy.web.common.BaseController;
import cn.wisenergy.web.config.JwtConfig; import cn.wisenergy.web.config.JwtConfig;
import cn.wisenergy.web.shiro.JwtUtil; import cn.wisenergy.web.shiro.JwtUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -110,7 +107,9 @@ public class UserController extends BaseController { ...@@ -110,7 +107,9 @@ public class UserController extends BaseController {
@ApiOperation(value = "获取用户我的直推信息", notes = "获取用户我的直推信息", httpMethod = "GET") @ApiOperation(value = "获取用户我的直推信息", notes = "获取用户我的直推信息", httpMethod = "GET")
@GetMapping("/myRecommend") @GetMapping("/myRecommend")
public R<Map> getMyRecommend(String userId) { public R<Map> getMyRecommend(String userId) {
//用户id
int userLevel = userService.getByUserId(userId).getUserLevel(); int userLevel = userService.getByUserId(userId).getUserLevel();
//用户各等级人数
RecommendUser myRecommed = recommendUserService.getMyRecommed(userId); RecommendUser myRecommed = recommendUserService.getMyRecommed(userId);
Map myRecommedMap = new HashMap(); Map myRecommedMap = new HashMap();
myRecommedMap.put("userlevel", userLevel); myRecommedMap.put("userlevel", userLevel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment