From bf144316f5bbd9bd442123ab8d8e5be4f9e42602 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 07 Dec 2021 15:59:27 +0800
Subject: [PATCH] 20211207 fish
---
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java | 10 +++++
src/main/resources/mapper/fish/CannonSettingDao.xml | 8 +++
src/main/java/com/xcong/excoin/modules/fish/vo/CannonWinRecordVo.java | 18 +++++++++
src/main/java/com/xcong/excoin/modules/fish/dto/CannonWinRecordDto.java | 21 ++++++++++
src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java | 11 +++++
src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java | 2 +
src/main/java/com/xcong/excoin/modules/fish/dao/CannonSettingDao.java | 4 ++
7 files changed, 73 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java b/src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java
index 322462e..87928bc 100644
--- a/src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java
+++ b/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);
+ }
+
}
diff --git a/src/main/java/com/xcong/excoin/modules/fish/dao/CannonSettingDao.java b/src/main/java/com/xcong/excoin/modules/fish/dao/CannonSettingDao.java
index 14894b6..c5de714 100644
--- a/src/main/java/com/xcong/excoin/modules/fish/dao/CannonSettingDao.java
+++ b/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);
}
diff --git a/src/main/java/com/xcong/excoin/modules/fish/dto/CannonWinRecordDto.java b/src/main/java/com/xcong/excoin/modules/fish/dto/CannonWinRecordDto.java
new file mode 100644
index 0000000..f108baa
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/fish/dto/CannonWinRecordDto.java
@@ -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;
+}
diff --git a/src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java b/src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java
index c8f716c..29efc31 100644
--- a/src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java
+++ b/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);
}
diff --git a/src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java b/src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java
index b798f65..a23824b 100644
--- a/src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java
+++ b/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();
//获取所有的奖品列表
diff --git a/src/main/java/com/xcong/excoin/modules/fish/vo/CannonWinRecordVo.java b/src/main/java/com/xcong/excoin/modules/fish/vo/CannonWinRecordVo.java
new file mode 100644
index 0000000..9a6f4a8
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/fish/vo/CannonWinRecordVo.java
@@ -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;
+}
diff --git a/src/main/resources/mapper/fish/CannonSettingDao.xml b/src/main/resources/mapper/fish/CannonSettingDao.xml
index 0bdfba0..613a79a 100644
--- a/src/main/resources/mapper/fish/CannonSettingDao.xml
+++ b/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>
\ No newline at end of file
--
Gitblit v1.9.1