From 0ebce622dd8586f7c224dfea5a64dd78621e0042 Mon Sep 17 00:00:00 2001
From: HMY <3124750372@qq.com>
Date: Thu, 5 Sep 2024 14:55:04 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AB=AF=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 12 +-
src/main/java/com/ruoyi/RuoYiApplication.java | 2 +
.../framework/config/SecurityConfig.java | 4 +
.../java/com/ruoyi/framework/task/RyTask.java | 45 ++++
.../hit/controller/CardGameController.java | 100 --------
.../controller/CardGameProductController.java | 37 ---
.../controller/CardGameRuleController.java | 39 ----
.../hit/controller/CardProductController.java | 201 ----------------
.../hit/controller/CardUserController.java | 47 ----
.../hit/controller/InfoController.java | 60 -----
.../controller/PupuUpsHistoryController.java | 62 +++++
.../hit/controller/PupuUserController.java | 41 ++++
.../hit/controller/SystemDictController.java | 113 ---------
.../hit/controller/vo/ExcelCardProductVo.java | 36 ---
.../hit/controller/vo/ListCardGameVo.java | 25 --
.../hit/controller/vo/ListCardProductVo.java | 16 --
.../hit/controller/vo/ListCardUserVo.java | 31 ---
.../project/hit/controller/vo/ListInfoVo.java | 24 --
.../hit/controller/vo/TotalInfoVo.java | 23 --
.../ruoyi/project/hit/domain/CardGame.java | 40 ----
.../project/hit/domain/CardGameProduct.java | 26 ---
.../project/hit/domain/CardGameRule.java | 28 ---
.../project/hit/domain/CardGameUser.java | 36 ---
.../ruoyi/project/hit/domain/CardProduct.java | 47 ----
.../ruoyi/project/hit/domain/CardUser.java | 51 ----
.../ruoyi/project/hit/domain/CardUserHit.java | 36 ---
.../project/hit/domain/PupuUpsHistory.java | 45 ++++
.../ruoyi/project/hit/domain/PupuUser.java | 41 ++++
.../ruoyi/project/hit/domain/SystemDict.java | 34 ---
.../project/hit/domain/vo/UserLoginVO.java | 10 +
.../project/hit/mapper/CardGameMapper.java | 36 ---
.../hit/mapper/CardGameProductMapper.java | 27 ---
.../hit/mapper/CardGameRuleMapper.java | 24 --
.../hit/mapper/CardGameUserMapper.java | 18 --
.../project/hit/mapper/CardProductMapper.java | 18 --
.../project/hit/mapper/CardUserHitMapper.java | 32 ---
.../project/hit/mapper/CardUserMapper.java | 23 --
.../hit/mapper/PupuUpsHistoryMapper.java | 18 ++
.../project/hit/mapper/PupuUserMapper.java | 18 ++
.../project/hit/mapper/SystemDictMapper.java | 18 --
.../hit/service/CardGameProductService.java | 55 -----
.../hit/service/CardGameRuleService.java | 49 ----
.../project/hit/service/CardGameService.java | 59 -----
.../hit/service/CardGameUserService.java | 14 --
.../hit/service/CardProductService.java | 61 -----
.../hit/service/CardUserHitService.java | 47 ----
.../project/hit/service/CardUserService.java | 37 ---
.../hit/service/PupuUpsHistoryService.java | 13 ++
.../project/hit/service/PupuUserService.java | 17 ++
.../hit/service/SystemDictService.java | 77 ------
.../impl/CardGameProductServiceImpl.java | 95 --------
.../service/impl/CardGameRuleServiceImpl.java | 97 --------
.../hit/service/impl/CardGameServiceImpl.java | 219 ------------------
.../service/impl/CardGameUserServiceImpl.java | 30 ---
.../service/impl/CardProductServiceImpl.java | 102 --------
.../service/impl/CardUserHitServiceImpl.java | 156 -------------
.../hit/service/impl/CardUserServiceImpl.java | 75 ------
.../impl/PupuUpsHistoryServiceImpl.java | 22 ++
.../hit/service/impl/PupuUserServiceImpl.java | 50 ++++
.../service/impl/SystemDictServiceImpl.java | 161 -------------
.../project/hit/util/ScheduledTasks.java | 35 +++
.../com/ruoyi/project/hit/util/Token.java | 70 ++++++
.../com/ruoyi/project/hit/util/Util1.java | 59 +++++
.../hit/util/webSocket/WebSocketConfig.java | 16 ++
.../hit/util/webSocket/WsServerEndpoint.java | 99 ++++++++
.../uniapp/controller/BonusController.java | 73 ------
.../uniapp/controller/HomePageController.java | 58 -----
.../controller/PersonalCenterController.java | 39 ----
.../uniapp/controller/vo/CardProductVo.java | 29 ---
.../uniapp/controller/vo/CardUserGameVo.java | 13 --
.../uniapp/controller/vo/CardUserVo.java | 14 --
.../ruoyi/project/uniapp/mq/Consumer01.java | 23 --
.../ruoyi/project/uniapp/mq/Consumer02.java | 21 --
src/main/resources/application-druid.yml | 2 +-
src/main/resources/application.yml | 4 +
.../resources/mybatis/hit/CardGameMapper.xml | 94 --------
.../mybatis/hit/CardGameProductMapper.xml | 49 ----
.../mybatis/hit/CardGameRuleMapper.xml | 34 ---
.../mybatis/hit/CardGameUserMapper.xml | 18 --
.../mybatis/hit/CardProductMapper.xml | 20 --
.../mybatis/hit/CardUserHitMapper.xml | 112 ---------
.../resources/mybatis/hit/CardUserMapper.xml | 55 -----
.../mybatis/hit/PupuUpsHistoryMapper.xml | 23 ++
.../resources/mybatis/hit/PupuUserMapper.xml | 20 ++
.../mybatis/hit/SystemDictMapper.xml | 22 --
85 files changed, 726 insertions(+), 3256 deletions(-)
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/CardGameController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/CardGameProductController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/CardGameRuleController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/CardProductController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/CardUserController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/InfoController.java
create mode 100644 src/main/java/com/ruoyi/project/hit/controller/PupuUpsHistoryController.java
create mode 100644 src/main/java/com/ruoyi/project/hit/controller/PupuUserController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/SystemDictController.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/vo/ExcelCardProductVo.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/vo/ListCardGameVo.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/vo/ListCardProductVo.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/vo/ListCardUserVo.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/vo/ListInfoVo.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/controller/vo/TotalInfoVo.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardGame.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardGameProduct.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardGameRule.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardGameUser.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardProduct.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardUser.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/CardUserHit.java
create mode 100644 src/main/java/com/ruoyi/project/hit/domain/PupuUpsHistory.java
create mode 100644 src/main/java/com/ruoyi/project/hit/domain/PupuUser.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/domain/SystemDict.java
create mode 100644 src/main/java/com/ruoyi/project/hit/domain/vo/UserLoginVO.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardGameMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardGameProductMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardGameRuleMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardGameUserMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardProductMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardUserHitMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/CardUserMapper.java
create mode 100644 src/main/java/com/ruoyi/project/hit/mapper/PupuUpsHistoryMapper.java
create mode 100644 src/main/java/com/ruoyi/project/hit/mapper/PupuUserMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/mapper/SystemDictMapper.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardGameProductService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardGameRuleService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardGameService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardGameUserService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardProductService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardUserHitService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/CardUserService.java
create mode 100644 src/main/java/com/ruoyi/project/hit/service/PupuUpsHistoryService.java
create mode 100644 src/main/java/com/ruoyi/project/hit/service/PupuUserService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/SystemDictService.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardGameProductServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardGameRuleServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardGameServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardGameUserServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardProductServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardUserHitServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/CardUserServiceImpl.java
create mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/PupuUpsHistoryServiceImpl.java
create mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/PupuUserServiceImpl.java
delete mode 100644 src/main/java/com/ruoyi/project/hit/service/impl/SystemDictServiceImpl.java
create mode 100644 src/main/java/com/ruoyi/project/hit/util/ScheduledTasks.java
create mode 100644 src/main/java/com/ruoyi/project/hit/util/Token.java
create mode 100644 src/main/java/com/ruoyi/project/hit/util/Util1.java
create mode 100644 src/main/java/com/ruoyi/project/hit/util/webSocket/WebSocketConfig.java
create mode 100644 src/main/java/com/ruoyi/project/hit/util/webSocket/WsServerEndpoint.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/controller/BonusController.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/controller/HomePageController.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/controller/PersonalCenterController.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/controller/vo/CardProductVo.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserGameVo.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserVo.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/mq/Consumer01.java
delete mode 100644 src/main/java/com/ruoyi/project/uniapp/mq/Consumer02.java
delete mode 100644 src/main/resources/mybatis/hit/CardGameMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/CardGameProductMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/CardGameRuleMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/CardGameUserMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/CardProductMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/CardUserHitMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/CardUserMapper.xml
create mode 100644 src/main/resources/mybatis/hit/PupuUpsHistoryMapper.xml
create mode 100644 src/main/resources/mybatis/hit/PupuUserMapper.xml
delete mode 100644 src/main/resources/mybatis/hit/SystemDictMapper.xml
diff --git a/pom.xml b/pom.xml
index 21dea62..2c49e84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,6 +44,12 @@
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+ 2.2.13.RELEASE
+
@@ -282,8 +288,12 @@
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
-
+
${project.artifactId}
diff --git a/src/main/java/com/ruoyi/RuoYiApplication.java b/src/main/java/com/ruoyi/RuoYiApplication.java
index 32eb6f1..3b2c891 100644
--- a/src/main/java/com/ruoyi/RuoYiApplication.java
+++ b/src/main/java/com/ruoyi/RuoYiApplication.java
@@ -3,12 +3,14 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 启动程序
*
* @author ruoyi
*/
+@EnableScheduling
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
diff --git a/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
index 5ddfb81..8aae19e 100644
--- a/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+++ b/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -113,6 +113,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous()
+ .antMatchers("/echo/*").anonymous()
+ .antMatchers("/echo").anonymous()
+ //便于接口测试,允许请求跳过认证
+ .antMatchers("/hit/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
diff --git a/src/main/java/com/ruoyi/framework/task/RyTask.java b/src/main/java/com/ruoyi/framework/task/RyTask.java
index eb7f5b9..95c8f49 100644
--- a/src/main/java/com/ruoyi/framework/task/RyTask.java
+++ b/src/main/java/com/ruoyi/framework/task/RyTask.java
@@ -1,8 +1,16 @@
package com.ruoyi.framework.task;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ruoyi.project.hit.util.Util1;
+import com.ruoyi.project.hit.util.webSocket.WsServerEndpoint;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;
+import javax.websocket.EndpointConfig;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* 定时任务调度测试
*
@@ -25,4 +33,41 @@ public class RyTask
{
System.out.println("执行无参方法");
}
+
+ public void reportCurrentTime1() {
+ System.out.println("11");
+
+ WsServerEndpoint wsServerEndpoint=new WsServerEndpoint();
+ try {
+// wsServerEndpoint.onOpen(wsServerEndpointMap.get("id"),wsServerEndpointMap.get("session"));
+ wsServerEndpoint.sendMessage("jsonString");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+
+ /*long l = System.currentTimeMillis();
+ Map upsMap = Util1.upsMap;
+ for (Map.Entry entry : upsMap.entrySet()) {
+ if(l-entry.getValue()>=30000){
+ System.out.println(entry.getKey());
+ WsServerEndpoint wsServerEndpoint=new WsServerEndpoint();
+ Map map=new HashMap<>();
+ map.put("id",1);
+ map.put("msg","111");
+ ObjectMapper objectMapper = new ObjectMapper();
+ try {
+ String jsonString = objectMapper.writeValueAsString(map);
+ wsServerEndpoint.sendMessage(jsonString);
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+ }*/
+ }
}
diff --git a/src/main/java/com/ruoyi/project/hit/controller/CardGameController.java b/src/main/java/com/ruoyi/project/hit/controller/CardGameController.java
deleted file mode 100644
index 12eca32..0000000
--- a/src/main/java/com/ruoyi/project/hit/controller/CardGameController.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.ruoyi.project.hit.controller;
-
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.hit.controller.vo.ListCardGameVo;
-import com.ruoyi.project.hit.controller.vo.ListCardProductVo;
-import com.ruoyi.project.hit.domain.CardGame;
-import com.ruoyi.project.hit.domain.CardProduct;
-import com.ruoyi.project.hit.service.CardGameService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/*
-活动管理
- */
-@RestController
-@RequestMapping("/hit/game")
-public class CardGameController extends BaseController {
-
- @Autowired
- private CardGameService cardGameService;
-
-
-
- @GetMapping("/list")
- public TableDataInfo list(ListCardGameVo listCardGameVo)
- {
- System.out.println("111");
- startPage();
- List list = cardGameService.selectCardGameList(listCardGameVo);
- return getDataTable(list);
- }
-
- /**
- * 新增活动
- * @param cardGame
- * @return
- */
- @PostMapping
- public AjaxResult addCardGame(@RequestBody CardGame cardGame)
- {
- cardGameService.addCardGame(cardGame);
- return AjaxResult.success();
- }
-
- /**
- * 根据id查询活动
- * @param id
- * @return
- */
- @GetMapping("/{id}")
- public AjaxResult getCardGameById(@PathVariable("id") Integer id)
- {
- //多条数据集合
- Map data = cardGameService.getCardGameDataById(id);
- return AjaxResult.success("查询成功",data);
- }
-
- /**
- * 修改活动
- * @param cardGame
- * @return
- */
- @PutMapping
- public AjaxResult updateCardGame(@RequestBody CardGame cardGame)
- {
- return toAjax(cardGameService.updateCardGame(cardGame));
- }
-
-
- @DeleteMapping("/{id}")
- public AjaxResult deleteCardGameById(@PathVariable("id") Integer id)
- {
- return toAjax(cardGameService.deleteCardGameById(id));
- }
-
- /**
- * 活动详情接口
- * @param id
- * @return
- */
- @GetMapping("/detail/{gameid}")
- public AjaxResult getCardGameDetailById(@PathVariable("gameid") Integer id)
- {
- //多条数据集合
- Map data = cardGameService.getCardGameDetailById(id);
- return AjaxResult.success("查询成功",data);
- }
-
-
-
-
-
-
-}
diff --git a/src/main/java/com/ruoyi/project/hit/controller/CardGameProductController.java b/src/main/java/com/ruoyi/project/hit/controller/CardGameProductController.java
deleted file mode 100644
index 1e55325..0000000
--- a/src/main/java/com/ruoyi/project/hit/controller/CardGameProductController.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.ruoyi.project.hit.controller;
-
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.hit.domain.CardGameProduct;
-import com.ruoyi.project.hit.service.CardGameProductService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-/*
-活动奖品配置
- */
-@RestController
-@RequestMapping("/hit/game_product")
-public class CardGameProductController extends BaseController {
- @Autowired
- private CardGameProductService cardGameProductService;
-
- /**
- * 活动奖品配置
- * @param cardGameProduct
- * @return
- */
- @PostMapping
- public AjaxResult configGameProduct(@RequestBody CardGameProduct cardGameProduct)
- {
- return toAjax(cardGameProductService.configGameProduct(cardGameProduct));
- }
-
- @DeleteMapping("/{id}")
- public AjaxResult deleteGameProduct(@PathVariable("id") Integer id)
- {
- cardGameProductService.deleteGameProduct(id);
- return AjaxResult.success("删除成功",null);
- }
-
-}
diff --git a/src/main/java/com/ruoyi/project/hit/controller/CardGameRuleController.java b/src/main/java/com/ruoyi/project/hit/controller/CardGameRuleController.java
deleted file mode 100644
index 7f76c39..0000000
--- a/src/main/java/com/ruoyi/project/hit/controller/CardGameRuleController.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.ruoyi.project.hit.controller;
-
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.hit.domain.CardGameProduct;
-import com.ruoyi.project.hit.domain.CardGameRule;
-import com.ruoyi.project.hit.service.CardGameRuleService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-/*
-活动奖品配置
- */
-@RestController
-@RequestMapping("/hit/game_rule")
-public class CardGameRuleController extends BaseController {
- @Autowired
- private CardGameRuleService cardGameRuleService;
-
-
- /**
- * 中奖策略配置接口
- * @param cardGameRule
- * @return
- */
- @PostMapping
- public AjaxResult configGameRule(@RequestBody CardGameRule cardGameRule)
- {
- return toAjax(cardGameRuleService.configGameRule(cardGameRule));
- }
-
- @DeleteMapping("/{id}")
- public AjaxResult deleteGameProduct(@PathVariable("id") Integer id)
- {
- cardGameRuleService.deleteGameRule(id);
- return AjaxResult.success("删除成功",null);
- }
-
-}
diff --git a/src/main/java/com/ruoyi/project/hit/controller/CardProductController.java b/src/main/java/com/ruoyi/project/hit/controller/CardProductController.java
deleted file mode 100644
index d598d6c..0000000
--- a/src/main/java/com/ruoyi/project/hit/controller/CardProductController.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package com.ruoyi.project.hit.controller;
-
-import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.support.ExcelTypeEnum;
-import com.alibaba.fastjson.JSON;
-import com.ruoyi.common.exception.CustomException;
-import com.ruoyi.common.utils.ServletUtils;
-import com.ruoyi.common.utils.http.HttpHelper;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.hit.controller.vo.ExcelCardProductVo;
-import com.ruoyi.project.hit.controller.vo.ListCardProductVo;
-import com.ruoyi.project.hit.controller.vo.ListCardUserVo;
-import com.ruoyi.project.hit.domain.CardProduct;
-import com.ruoyi.project.hit.service.CardProductService;
-import com.ruoyi.project.system.domain.SysUser;
-import io.swagger.annotations.Api;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.util.*;
-
-@RestController
-@RequestMapping("/hit/product")
-@Api(tags = "EasyExcel")
-public class CardProductController extends BaseController {
- @Autowired
- private CardProductService cardProductService;
-
-
- /**
- * 获取奖品列表
- */
- @GetMapping("/list")
- public TableDataInfo list(ListCardProductVo listCardProductVo)
- {
- startPage();
- List list = cardProductService.selectCardProductList(listCardProductVo);
- return getDataTable(list);
- }
-
- /**
- * 根据id查询奖品
- * @param id
- * @return
- */
- @GetMapping("/{id}")
- public AjaxResult getProductById(@PathVariable Integer id)
- {
- return AjaxResult.success(cardProductService.getProductById(id));
- }
-
-
-
- /**
- * 修改奖品列表
- */
- @PutMapping
- public AjaxResult updateProduct(@RequestBody CardProduct cardProduct)
- {
- cardProductService.updateProduct(cardProduct);
- return AjaxResult.success("修改成功");
- }
-
- /**
- * 删除奖品
- */
- @DeleteMapping("/{id}")
- public AjaxResult deleteProduct(@PathVariable Integer id)
- {
- return toAjax(cardProductService.deleteProduct(id));
- }
-
- /**
- * 新增奖品
- * @param cardProduct
- * @return
- */
- @PostMapping
- public AjaxResult addProduct(@RequestBody CardProduct cardProduct)
- {
- return toAjax(cardProductService.addProduct(cardProduct));
- }
-
- /**
- * 奖品列表显示
- * @return 奖品列表
- */
- @GetMapping("/select")
- public AjaxResult select()
- {
- List