src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/fish/dao/CannonSettingDao.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/fish/dto/CannonWinRecordDto.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/fish/vo/CannonWinRecordVo.java | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/fish/CannonSettingDao.xml | ●●●●● patch | view | raw | blame | history |
src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java
@@ -4,6 +4,7 @@ import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletAgentInfoVo; import com.xcong.excoin.modules.coin.parameter.vo.OrderWalletCoinDealVo; import com.xcong.excoin.modules.fish.dto.*; import com.xcong.excoin.modules.fish.entity.CannonWinRecord; import com.xcong.excoin.modules.fish.service.MemberCannonService; import com.xcong.excoin.modules.fish.vo.*; import io.swagger.annotations.Api; @@ -120,6 +121,16 @@ return memberCannonService.lotteryDraw(lotteryDrawDto); } /** * 查看中奖记录 */ @ApiOperation(value = "查看中奖记录") @ApiResponses({@ApiResponse( code = 200, message = "success", response = CannonWinRecordVo.class)}) @PostMapping(value = "/getOwnAwards") public Result getOwnAwards(@RequestBody @Valid CannonWinRecordDto cannonWinRecordDto) { return memberCannonService.getOwnAwards(cannonWinRecordDto); } } src/main/java/com/xcong/excoin/modules/fish/dao/CannonSettingDao.java
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio; import com.xcong.excoin.modules.fish.entity.CannonSetting; import com.xcong.excoin.modules.fish.entity.CannonWinRecord; import com.xcong.excoin.modules.fish.vo.CannonSettingVo; import com.xcong.excoin.modules.fish.vo.CannonWinRecordVo; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -17,4 +19,6 @@ IPage<CannonSettingVo> findCannonSettingInPage(Page<CannonSettingVo> page, @Param("cannonSetting")CannonSetting cannonSetting); CannonSetting selectCannonSettingByCannonCode(@Param("cannonCode")String cannonCode); IPage<CannonWinRecordVo> findCannonWinRecordInPage(Page<CannonWinRecordVo> page, @Param("cannonWinRecord")CannonWinRecord cannonWinRecord); } src/main/java/com/xcong/excoin/modules/fish/dto/CannonWinRecordDto.java
New file @@ -0,0 +1,21 @@ package com.xcong.excoin.modules.fish.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @Data @ApiModel(value = "CannonWinRecordDto", description = "参数类") public class CannonWinRecordDto { @NotNull @Min(1) @ApiModelProperty(value = "第几页", example = "1") private int pageNum; @NotNull @ApiModelProperty(value = "每页数量", example = "10") private int pageSize; } src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java
@@ -31,4 +31,6 @@ Result getAwards(); Result lotteryDraw(LotteryDrawDto lotteryDrawDto); Result getOwnAwards(CannonWinRecordDto cannonWinRecordDto); } src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java
@@ -332,6 +332,16 @@ return Result.ok(award); } @Override public Result getOwnAwards(CannonWinRecordDto cannonWinRecordDto) { Long memberId = LoginUserUtils.getAppLoginUser().getId(); Page<CannonWinRecordVo> page = new Page<>(cannonWinRecordDto.getPageNum(), cannonWinRecordDto.getPageSize()); CannonWinRecord cannonWinRecord = new CannonWinRecord(); cannonWinRecord.setMemberId(memberId); IPage<CannonWinRecordVo> list = cannonSettingDao.findCannonWinRecordInPage(page, cannonWinRecord); return Result.ok(list); } private CannonAwardVo getAward(Long memberId) { CannonAwardVo cannonAwardVo = new CannonAwardVo(); //获取所有的奖品列表 src/main/java/com/xcong/excoin/modules/fish/vo/CannonWinRecordVo.java
New file @@ -0,0 +1,18 @@ package com.xcong.excoin.modules.fish.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; @Data @ApiModel(value = "CannonWinRecordVo", description = "中奖记录") public class CannonWinRecordVo { @ApiModelProperty(value = "消耗USDT") private BigDecimal consumeNum; @ApiModelProperty(value = "奖品") private String awardName; } src/main/resources/mapper/fish/CannonSettingDao.xml
@@ -7,11 +7,17 @@ </select> <select id="findCannonSettingInPage" resultType="com.xcong.excoin.modules.fish.vo.CannonSettingVo"> select a.* from cannon_setting a order by id asc select a.* from cannon_setting a order by a.id asc </select> <select id="selectCannonSettingByCannonCode" resultType="com.xcong.excoin.modules.fish.entity.CannonSetting"> select a.* from cannon_setting a where a.code = #{cannonCode} </select> <select id="findCannonWinRecordInPage" resultType="com.xcong.excoin.modules.fish.vo.CannonWinRecordVo"> select a.* from cannon_win_record a where a.member_id = #{cannonWinRecord.memberId} order by a.id asc </select> </mapper>