Commit 62ac4dbb authored by hezhen's avatar hezhen

123

parent c2b06909
package com.github.wxiaoqi.security.admin.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 个人中心信息
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-18 19:38:56
*/
@Data
public class UserInfoDTO {
/**
* 可使用优惠卷个数
*/
@ApiModelProperty(value = "可使用优惠卷个数")
private Long couponNumber;
/**
* 总积分
*/
@ApiModelProperty(value = "总积分")
private Integer totalPoint;
/**
* 钱包总额
*/
@ApiModelProperty(value = "钱包总额")
private Integer totalWallet;
}
package com.xxfc.platform.activity.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.entity.IntegralUserTotal;
import com.xxfc.platform.activity.vo.UserCouponVo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
......@@ -49,4 +51,8 @@ public interface ActivityFeign {
@RequestMapping(value = "/join/user", method = RequestMethod.POST)
public ObjectRestResponse join(@RequestParam(value = "userId",defaultValue ="0" ) Integer userId);
@ApiModelProperty("获取用户积分")
@GetMapping(value = "/user")
public IntegralUserTotal user(@RequestParam("userId") Integer userId);
}
......@@ -131,5 +131,23 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
return ObjectRestResponse.succ(pageDataVO);
}
/**
* 获取某个用户的积分信息
* @return
*/
public IntegralUserTotal getIntegralByUser(Integer userId) {
IntegralUserTotalDto integralUserTotalDto = new IntegralUserTotalDto();
integralUserTotalDto.setUserId(userId);
List<IntegralUserTotal> oldValue = mapper.selectAllByParam(integralUserTotalDto);
if(oldValue == null || oldValue.size() <=0) {
IntegralUserTotal integralUserTotal = IntegralUserTotal.initIntegralUserTotal();
integralUserTotal.setUserId(userId);
insertSelective(integralUserTotal);
return integralUserTotal;
}
return oldValue.get(0);
}
}
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