src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/documentary/vo/MemberIsTradeVo.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java | ●●●●● patch | view | raw | blame | history |
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
New file @@ -0,0 +1,39 @@ package com.xcong.excoin.modules.documentary.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.documentary.service.DocumentaryService; import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo; import com.xcong.excoin.modules.member.parameter.vo.AppVersionListVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; @RestController @Slf4j @RequestMapping(value = "/api/documentary") @Api(value = "MemberQuickBuySaleController", tags = "跟单") public class DocumentaryController { @Autowired DocumentaryService documentaryService; /** * 获取用户类型是否是交易员 */ @ApiOperation(value="getMemberIsTradeInfo", notes="获取用户类型是否是交易员") @ApiResponses({@ApiResponse( code = 200, message = "success", response = MemberIsTradeVo.class)}) @GetMapping(value = "/getMemberIsTradeInfo") public Result getMemberIsTradeInfo() { return documentaryService.getMemberIsTradeInfo(); } } src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderProfitInfoDao.java
New file @@ -0,0 +1,8 @@ package com.xcong.excoin.modules.documentary.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity; public interface FollowTraderProfitInfoDao extends BaseMapper<FollowTraderProfitInfoEntity> { } src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderProfitInfoEntity.java
New file @@ -0,0 +1,57 @@ package com.xcong.excoin.modules.documentary.entity; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; import com.xcong.excoin.common.system.base.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; /** * 交易员收益信息 */ @EqualsAndHashCode(callSuper = true) @Data @TableName("follow_trader_profit_info") public class FollowTraderProfitInfoEntity extends BaseEntity{ /** * */ private static final long serialVersionUID = 6139436588367517567L; /** * 交易员ID */ private Long traderId; /** * 会员ID */ private Long memberId; /** * 累计收益率 */ private BigDecimal totalProfitRatio; /** * 带单总收益 */ private BigDecimal totalProfit; /** * 跟随者总收益 */ private BigDecimal followerTotalProfit; /** * 胜率 */ private BigDecimal winRate; /** * 累计跟随人数 */ private BigDecimal totalFollowerCnt; /** * 交易笔数 */ private BigDecimal totalOrderCnt; } src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
New file @@ -0,0 +1,11 @@ package com.xcong.excoin.modules.documentary.service; import com.baomidou.mybatisplus.extension.service.IService; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity; public interface DocumentaryService extends IService<FollowTraderProfitInfoEntity> { public Result getMemberIsTradeInfo(); } src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
New file @@ -0,0 +1,42 @@ package com.xcong.excoin.modules.documentary.service.impl; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xcong.excoin.common.LoginUserUtils; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao; import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity; import com.xcong.excoin.modules.documentary.service.DocumentaryService; import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo; import com.xcong.excoin.modules.member.dao.MemberDao; import com.xcong.excoin.modules.member.entity.MemberEntity; import lombok.extern.slf4j.Slf4j; @Slf4j @Service public class DocumentaryServiceImpl extends ServiceImpl<FollowTraderProfitInfoDao, FollowTraderProfitInfoEntity> implements DocumentaryService { @Resource private MemberDao memberDao; @Override public Result getMemberIsTradeInfo() { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); MemberEntity member = memberDao.selectById(memberId); Integer isTrader = member.getIsTrader(); MemberIsTradeVo memberIsTradeVo = new MemberIsTradeVo(); if(MemberEntity.IS_TRADER_Y.equals(isTrader)) { memberIsTradeVo.setIsTrade(MemberEntity.IS_TRADER_Y); }else { memberIsTradeVo.setIsTrade(MemberEntity.IS_TRADER_N); } return Result.ok(memberIsTradeVo); } } src/main/java/com/xcong/excoin/modules/documentary/vo/MemberIsTradeVo.java
New file @@ -0,0 +1,14 @@ package com.xcong.excoin.modules.documentary.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "MemberInfoVo", description = "会员类型") public class MemberIsTradeVo { @ApiModelProperty(value = "类型:1:是交易员 2:否") private Integer isTrade; } src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java
@@ -74,6 +74,15 @@ public static final int IS_PROFIT_Y = 1; public static final int IS_PROFIT_N = 0; public static final Integer IS_TRADER_Y = 1; public static final Integer IS_TRADER_N = 2; /** * 1是2否 */ private Integer isTrader; /** * 手机号(包含国际手机号)