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> list=cardProductService.select(); - return AjaxResult.success("查询成功",list); - } - - /** - * 奖品列表导入接口 - * @param file - * @return - * @throws Exception - */ - @Log(title = "奖品管理", businessType = BusinessType.IMPORT) -// @PreAuthorize("@ss.hasPermi('system:user:import')") - @PostMapping("/uploadExcel") - public AjaxResult importData(@RequestPart(value = "myExcel") MultipartFile file) throws Exception - { - try { - List cardProducts = EasyExcel.read(file.getInputStream()) - .head(CardProduct.class) - .sheet() - .doReadSync(); - if(cardProducts.size()==0){ - throw new CustomException("导入失败,excel表空数据"); - } - - boolean b = cardProductService.saveBatch(cardProducts); - if(b){ - return AjaxResult.success(null); - }else { - throw new CustomException("导入失败,存在错误数据"); - } - } catch (IOException e) { - return AjaxResult.error(); - } - - } - - - /** - *excel表导出 - * @param ids - */ - @PostMapping("/export") - public AjaxResult export(@RequestBody List ids,HttpServletResponse response){ - if(ids.isEmpty()){ - throw new CustomException("未选择要导出的数据"); - } -// List cardProducts = cardProductService.listByIds(ids); -// String s1=exportUserExcel(cardProducts,response); -// response.reset(); -// AjaxResult result =AjaxResult.success(s1); -// String json = JSON.toJSONString(result); -// ServletUtils.renderString(response, json); - String s1=""; - try { - List cardProducts = cardProductService.listByIds(ids); - s1=exportUserExcel(cardProducts,response); - } catch (Exception e) { - e.printStackTrace(); - response.reset(); - AjaxResult result = AjaxResult.error(e.getMessage()); - String json = JSON.toJSONString(result); - HttpHelper.renderString(response, json); - } - return null; - } - - - - public String exportUserExcel(List cardProducts,HttpServletResponse response)throws Exception { - String s1=""; - - s1 ="product_" +this.setExcelResponseProp(response, "奖品列表"); - EasyExcel.write(response.getOutputStream()) - .head(CardProduct.class) - .excelType(ExcelTypeEnum.XLSX) - .sheet("奖品列表") - .doWrite(cardProducts);; - return s1; - } - - /** - * 设置响应结果 - * - * @param response 响应结果对象 - * @param rawFileName 文件名 - *@throws UnsupportedEncodingException 不支持编码异常 - */ - private String setExcelResponseProp(HttpServletResponse response, String rawFileName) throws UnsupportedEncodingException { - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setCharacterEncoding("utf-8"); - String fileName = new Date().toString(); - - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - return fileName; - } - -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/CardUserController.java b/src/main/java/com/ruoyi/project/hit/controller/CardUserController.java deleted file mode 100644 index 24b1e0f..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/CardUserController.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ruoyi.project.hit.controller; - - - -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.enums.BusinessType; -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.ListCardUserVo; -import com.ruoyi.project.hit.domain.CardUser; -import com.ruoyi.project.hit.domain.SystemDict; -import com.ruoyi.project.hit.service.CardUserService; -import com.ruoyi.project.hit.service.SystemDictService; -import com.ruoyi.project.system.domain.SysPost; -import org.springframework.beans.factory.annotation.Autowired; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.HashMap; -import java.util.List; - -@RestController -@RequestMapping("/hit/card") -public class CardUserController extends BaseController { - @Autowired - private CardUserService cardUserService; - /** - * 获取會員列表 - */ - // @PreAuthorize("@ss.hasPermi('system:dict:list')") - @GetMapping("/list") - public TableDataInfo list(ListCardUserVo listCardUserVo) - { - startPage(); - List list = cardUserService.selectCardUserList(listCardUserVo); - return getDataTable(list); - } - - - -} - diff --git a/src/main/java/com/ruoyi/project/hit/controller/InfoController.java b/src/main/java/com/ruoyi/project/hit/controller/InfoController.java deleted file mode 100644 index aedb5b1..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/InfoController.java +++ /dev/null @@ -1,60 +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.ListCardProductVo; -import com.ruoyi.project.hit.controller.vo.ListInfoVo; -import com.ruoyi.project.hit.controller.vo.TotalInfoVo; -import com.ruoyi.project.hit.domain.CardGame; -import com.ruoyi.project.hit.domain.CardProduct; -import com.ruoyi.project.hit.service.CardGameService; -import com.ruoyi.project.hit.service.CardUserHitService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.HashMap; -import java.util.List; -/* -信息管理 - */ -@RestController -@RequestMapping("/hit/info") -public class InfoController extends BaseController { - - @Autowired - private CardUserHitService cardUserHitService; - - /** - * 中奖统计列表显示 - * @param totalInfoVo 中奖统计列表显示的参数 - * @return 中奖统计列表 - */ - @GetMapping("/total") - public TableDataInfo info(TotalInfoVo totalInfoVo) - { - startPage(); - List list = cardUserHitService.selectCardUserHitInfo(totalInfoVo); - return getDataTable(list); - } - - /** - * 中奖统计详情显示 - * @param gameid 活动id - * @return 活动中奖详情 - */ - @GetMapping("/{gameid}") - public AjaxResult getInfo(@PathVariable Integer gameid) - { - return AjaxResult.success(cardUserHitService.selectCardUserHitInfoByGameId(gameid)); - } - - - @GetMapping("/list") - public TableDataInfo list(ListInfoVo listInfoVo) - { - startPage(); - List list = cardUserHitService.selectCardUserHitList(listInfoVo); - return getDataTable(list); - } -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/PupuUpsHistoryController.java b/src/main/java/com/ruoyi/project/hit/controller/PupuUpsHistoryController.java new file mode 100644 index 0000000..02cad23 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/controller/PupuUpsHistoryController.java @@ -0,0 +1,62 @@ +package com.ruoyi.project.hit.controller; + +import com.alibaba.fastjson.JSONArray; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.project.hit.domain.PupuUpsHistory; +import com.ruoyi.project.hit.service.PupuUpsHistoryService; +import com.ruoyi.project.hit.util.Util1; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +@RestController +@RequestMapping("/hit/history") +public class PupuUpsHistoryController extends BaseController { + @Autowired + private PupuUpsHistoryService pupuUpsHistoryService; + @Autowired + private RedisTemplate redisTemplate; + + /** + * 历史记录新增 + * @return + */ + @PutMapping("/add") + public AjaxResult add() throws IOException { + String data = Util1.getdetail(); + ObjectMapper mapper = new ObjectMapper(); + Map map=new HashMap<>(); + try { + map = mapper.readValue(data, Map.class); +// System.out.println(map); + } catch (IOException e) { + e.printStackTrace(); + } + ArrayList> list = (ArrayList>) map.get("data"); + + ArrayList newList=new ArrayList<>(); + + for (Map stringObjectMap : list) { + if(stringObjectMap.size()==6){ + PupuUpsHistory historyFromMap = Util1.getHistoryFromMap(stringObjectMap); + newList.add(historyFromMap); + String jsonTime= JSONArray.toJSONString(historyFromMap.getTime()); + redisTemplate.opsForValue().set("ups:"+historyFromMap.getUpsId(),jsonTime,5, TimeUnit.MILLISECONDS); + } + } + boolean b = pupuUpsHistoryService.saveBatch(newList); + return AjaxResult.success(b); + } + + +} diff --git a/src/main/java/com/ruoyi/project/hit/controller/PupuUserController.java b/src/main/java/com/ruoyi/project/hit/controller/PupuUserController.java new file mode 100644 index 0000000..771fb2d --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/controller/PupuUserController.java @@ -0,0 +1,41 @@ +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.PupuUser; +import com.ruoyi.project.hit.domain.vo.UserLoginVO; +import com.ruoyi.project.hit.service.PupuUserService; +import com.ruoyi.project.hit.util.webSocket.WsServerEndpoint; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +@RestController +@RequestMapping("/hit/user") +public class PupuUserController extends BaseController { + @Autowired + private PupuUserService pupuUserService; + + @Autowired + private WsServerEndpoint wsServerEndpoint; + @PostMapping("/login") + public AjaxResult login(@RequestBody UserLoginVO userLoginVO){ + PupuUser loginer = pupuUserService.login(userLoginVO); + if(loginer!=null){ + return AjaxResult.success(loginer); + }else { + return AjaxResult.error("账号或密码错误"); + } + } + @PostMapping("/register") + public AjaxResult register(@Validated @RequestBody PupuUser pupuUser){ + return toAjax(pupuUserService.register(pupuUser)); + } + @GetMapping("/aa") + public void aa() throws Exception { + wsServerEndpoint.sendAllUser("67"); + } + +} diff --git a/src/main/java/com/ruoyi/project/hit/controller/SystemDictController.java b/src/main/java/com/ruoyi/project/hit/controller/SystemDictController.java deleted file mode 100644 index 7577c83..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/SystemDictController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.ruoyi.project.hit.controller; - -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.enums.BusinessType; -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.domain.SystemDict; -import com.ruoyi.project.hit.service.SystemDictService; -import com.ruoyi.project.system.domain.SysPost; -import org.springframework.beans.factory.annotation.Autowired; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/hit/dict") -public class SystemDictController extends BaseController { - @Autowired - private SystemDictService systemDictService; - /** - * 获取會員等級列表 - */ - // @PreAuthorize("@ss.hasPermi('system:dict:list')") - @GetMapping("/list") - public TableDataInfo list(SystemDict dict) - { - startPage(); - List list = systemDictService.selectSystemDictList(dict); - return getDataTable(list); - } - - - /** - * 新增会员等级 - */ -// @PreAuthorize("@ss.hasPermi('system:dict:add')") - @Log(title = "会员等级管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SystemDict dict) - { - if (UserConstants.NOT_UNIQUE.equals(systemDictService.checkDictValueUnique(dict))) - { - return AjaxResult.error("新增会员等级'" + dict.getDictValue() + "'失败,会员等级名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(systemDictService.checkDictKeyUnique(dict))) - { - return AjaxResult.error("新增会员等级'" + dict.getDictKey() + "'失败,会员等级代号已存在"); - } -// dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(systemDictService.insertDict(dict)); - } - - /** - * 删除会员等级 - */ -// @PreAuthorize("@ss.hasPermi('system:post:remove')") - @Log(title = "会员等级管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{id}") - public AjaxResult remove(@PathVariable Integer id) - { - System.out.println("111"); - return toAjax(systemDictService.deleteDictById(id)); - } - - /** - * 根据会员等级编号获取详细信息 - */ -// @PreAuthorize("@ss.hasPermi('system:post:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable Long id) - { - return AjaxResult.success(systemDictService.selectDictById(id)); - } - - - /** - * 修改会员等级 - */ -// @PreAuthorize("@ss.hasPermi('system:post:edit')") - @Log(title = "会员等级管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SystemDict dict) - { - if (UserConstants.NOT_UNIQUE.equals(systemDictService.checkDictValueUnique(dict))) - { - return AjaxResult.error("修改会员等级'" + dict.getDictValue() + "'失败,会员等级名称已存在"); - } - else if (UserConstants.NOT_UNIQUE.equals(systemDictService.checkDictKeyUnique(dict))) - { - return AjaxResult.error("修改会员等级'" + dict.getDictKey() + "'失败,会员等级代号已存在"); - } - - return toAjax(systemDictService.updateDict(dict)); - } - - - /** - * 会员等级列表显示接口(填充下拉框) - */ -// @PreAuthorize("@ss.hasPermi('system:post:query')") - @GetMapping(value = "/selectOption/{type}") - public AjaxResult selectOption(@PathVariable Integer type) - { - return AjaxResult.success(systemDictService.selectOption(type)); - } - -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/vo/ExcelCardProductVo.java b/src/main/java/com/ruoyi/project/hit/controller/vo/ExcelCardProductVo.java deleted file mode 100644 index 5cff2f6..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/vo/ExcelCardProductVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ruoyi.project.hit.controller.vo; - -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.format.NumberFormat; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ExcelCardProductVo { - @ExcelProperty("奖品名称") - @ColumnWidth(20) - private String pname; - - @ExcelProperty("图片url路径") - @ColumnWidth(20) - private String pic; - - @ExcelProperty("奖品简介") - @ColumnWidth(20) - private String content; - - @ExcelProperty("奖品市场价") - @NumberFormat("#.##") - @ColumnWidth(20) - private BigDecimal price; - - @ExcelProperty("逻辑删除字段0:正常 1:已删除") - @ColumnWidth(20) - private Integer delState; -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardGameVo.java b/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardGameVo.java deleted file mode 100644 index 80e22ce..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardGameVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ruoyi.project.hit.controller.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -/** - * 封装活动列表显示的参数 - */ -public class ListCardGameVo { - - private String title; - - private Date startTime; - - private Date endTime; - - private Integer type; - -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardProductVo.java b/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardProductVo.java deleted file mode 100644 index a6e8c01..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardProductVo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.project.hit.controller.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ListCardProductVo { - private String pname; - - private double priceLow; - - private double priceHigh; -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardUserVo.java b/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardUserVo.java deleted file mode 100644 index 2b62beb..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/vo/ListCardUserVo.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.ruoyi.project.hit.controller.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/* -封装会员信息的查询条件 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ListCardUserVo { - - private String userName; - - private String realname; - - private String idCard; - - private String phone; - - private Integer level; - - private Date startTime; - - private Date endTime; - -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/vo/ListInfoVo.java b/src/main/java/com/ruoyi/project/hit/controller/vo/ListInfoVo.java deleted file mode 100644 index 33dfdb0..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/vo/ListInfoVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ruoyi.project.hit.controller.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ListInfoVo { - private String title; - - private String username; - - private String phone; - - private String pname; - - private Date startTime; - - private Date endTime; -} diff --git a/src/main/java/com/ruoyi/project/hit/controller/vo/TotalInfoVo.java b/src/main/java/com/ruoyi/project/hit/controller/vo/TotalInfoVo.java deleted file mode 100644 index f5640e7..0000000 --- a/src/main/java/com/ruoyi/project/hit/controller/vo/TotalInfoVo.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ruoyi.project.hit.controller.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -/** - * 封装中奖统计列表显示的参数 - */ -public class TotalInfoVo { - - private String title; - - private Date startTime; - - private Date endTime; - -} diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardGame.java b/src/main/java/com/ruoyi/project/hit/domain/CardGame.java deleted file mode 100644 index 458138b..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardGame.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.*; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * @TableName card_game - */ -@TableName(value ="card_game") -@Data -public class CardGame implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - private String title; - - private String pic; - - private String content; - - private Date startTime; - - private Date endTime; - - private Integer type; - - private Integer status; - - //自动填充时间 - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardGameProduct.java b/src/main/java/com/ruoyi/project/hit/domain/CardGameProduct.java deleted file mode 100644 index ae84903..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardGameProduct.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import lombok.Data; - -/** - * @TableName card_game_product - */ -@TableName(value ="card_game_product") -@Data -public class CardGameProduct implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - private Integer gameid; - - private Integer productid; - - private Integer amount; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardGameRule.java b/src/main/java/com/ruoyi/project/hit/domain/CardGameRule.java deleted file mode 100644 index 6f61e5f..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardGameRule.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import lombok.Data; - -/** - * @TableName card_game_rule - */ -@TableName(value ="card_game_rule") -@Data -public class CardGameRule implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - private Integer gameid; - - private Integer levelid; - - private Integer enterCount; - - private Integer hitCount; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardGameUser.java b/src/main/java/com/ruoyi/project/hit/domain/CardGameUser.java deleted file mode 100644 index 4a329b3..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardGameUser.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @TableName card_game_user - */ -@TableName(value ="card_game_user") -@Data - -public class CardGameUser implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - private Integer userid; - - private Integer gameid; - - private Date createtime; - - private static final long serialVersionUID = 1L; - - public CardGameUser(Integer userid, Integer gameid, Date createtime) { - this.userid = userid; - this.gameid = gameid; - this.createtime = createtime; - } -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardProduct.java b/src/main/java/com/ruoyi/project/hit/domain/CardProduct.java deleted file mode 100644 index c731e10..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardProduct.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.alibaba.excel.annotation.ExcelIgnore; -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.format.NumberFormat; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.math.BigDecimal; -import lombok.Data; - -/** - * @TableName card_product - */ -@TableName(value ="card_product") -@Data -public class CardProduct implements Serializable { - @TableId(type = IdType.AUTO) - @ExcelIgnore - private Integer id; - - @ExcelProperty("奖品名称") - @ColumnWidth(20) - private String pname; - - @ExcelProperty("图片url路径") - @ColumnWidth(20) - private String pic; - - @ExcelProperty("奖品简介") - @ColumnWidth(20) - private String content; - - @ExcelProperty("奖品市场价") - @NumberFormat("#.##") - @ColumnWidth(20) - private BigDecimal price; - - @ExcelProperty("逻辑删除字段0:正常 1:已删除") - @ColumnWidth(20) - private Integer delState; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardUser.java b/src/main/java/com/ruoyi/project/hit/domain/CardUser.java deleted file mode 100644 index d9b58b6..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardUser.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.*; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * @TableName card_user - */ -@TableName(value ="card_user") -@Data -public class CardUser implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - @NotEmpty(message = "账号不能为空") - private String userName; - - @NotEmpty(message = "密码不能为空") - private String userPass; - - private String pic; - - @NotEmpty(message = "真实姓名不能为空") - private String realname; - - private String idCard; - - @NotEmpty(message = "手机号不能为空") - private String phone; - - private Integer level; - - //自动填充时间 - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - private Integer delState; - -// private String remark; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/CardUserHit.java b/src/main/java/com/ruoyi/project/hit/domain/CardUserHit.java deleted file mode 100644 index aea1169..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/CardUserHit.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * @TableName card_user_hit - */ -@TableName(value ="card_user_hit") -@Data -public class CardUserHit implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - private Integer gameid; - - private Integer userid; - - private Integer productid; - - private Date hittime; - - private static final long serialVersionUID = 1L; - - public CardUserHit(Integer gameid, Integer userid, Integer productid, Date hittime) { - this.gameid = gameid; - this.userid = userid; - this.productid = productid; - this.hittime = hittime; - } -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/PupuUpsHistory.java b/src/main/java/com/ruoyi/project/hit/domain/PupuUpsHistory.java new file mode 100644 index 0000000..54f3982 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/domain/PupuUpsHistory.java @@ -0,0 +1,45 @@ +package com.ruoyi.project.hit.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * @TableName pupu_ups_history + */ +@TableName(value ="pupu_ups_history") +@Data +public class PupuUpsHistory implements Serializable { + @TableId(type = IdType.AUTO) + private Integer id; + + private Integer upsId; + + private String identifier; + + private Date time; + + private String value; + + private String dataType; + + private String name; + + private String accessMode; + + private static final long serialVersionUID = 1L; + + public PupuUpsHistory(Integer upsId, String identifier, Date time, String value, String dataType, String name, String accessMode) { + this.upsId = upsId; + this.identifier = identifier; + this.time = time; + this.value = value; + this.dataType = dataType; + this.name = name; + this.accessMode = accessMode; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/PupuUser.java b/src/main/java/com/ruoyi/project/hit/domain/PupuUser.java new file mode 100644 index 0000000..a561061 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/domain/PupuUser.java @@ -0,0 +1,41 @@ +package com.ruoyi.project.hit.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; + +/** + * @TableName pupu_user + */ +@TableName(value ="pupu_user") +@Data +public class PupuUser implements Serializable { + @TableId(type = IdType.AUTO) + private Integer userId; + + @NotBlank(message = "用户名不能为空") + @Size(min = 6, max = 16, message = "用户名长度必须在6到16个字符之间") + private String userName; + + @NotBlank(message = "密码不能为空") + @Size(min = 8, message = "密码长度至少为8个字符") + @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W]).+$", message = "密码必须包含至少一个大写字母、一个小写字母、一个数字和一个特殊字符") + private String password; + + @NotBlank(message = "性别不能为空") + @Pattern(regexp = "^(男|女|未知)$", message = "性别必须是男、女或未知") + private String gender; + + private String pic; + + private Integer status; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/SystemDict.java b/src/main/java/com/ruoyi/project/hit/domain/SystemDict.java deleted file mode 100644 index faa1ba1..0000000 --- a/src/main/java/com/ruoyi/project/hit/domain/SystemDict.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.ruoyi.project.hit.domain; - -import com.baomidou.mybatisplus.annotation.*; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * @TableName system_dict - */ -@TableName(value ="system_dict") -@Data -public class SystemDict implements Serializable { - @TableId(type = IdType.AUTO) - private Integer id; - - private String dictType; - - private Integer dictKey; - - private String dictValue; - - private Integer delState; - - //自动填充时间 - @TableField(fill = FieldFill.INSERT) - private Date createTime; - - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateTime; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/domain/vo/UserLoginVO.java b/src/main/java/com/ruoyi/project/hit/domain/vo/UserLoginVO.java new file mode 100644 index 0000000..d945d6c --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/domain/vo/UserLoginVO.java @@ -0,0 +1,10 @@ +package com.ruoyi.project.hit.domain.vo; + +import lombok.Data; + +@Data +public class UserLoginVO { + private String userName; + + private String password; +} diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardGameMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardGameMapper.java deleted file mode 100644 index 61d5b18..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardGameMapper.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.controller.vo.ListCardGameVo; -import com.ruoyi.project.hit.controller.vo.ListInfoVo; -import com.ruoyi.project.hit.controller.vo.TotalInfoVo; -import com.ruoyi.project.hit.domain.CardGame; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author HP -* @description 针对表【card_game】的数据库操作Mapper -* @createDate 2024-05-25 21:09:47 -* @Entity com.ruoyi.project.hit.domain.CardGame -*/ -public interface CardGameMapper extends BaseMapper { - - - List selectCardGameList(ListCardGameVo listCardGameVo); - - HashMap getCardGameByGameId(Integer id); - - List showAllCardGame(); - - List getCardByDate(Date now); - - HashMap getCardGameBygameid(Integer gameid); -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardGameProductMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardGameProductMapper.java deleted file mode 100644 index 8e8e545..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardGameProductMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.domain.CardGameProduct; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ruoyi.project.uniapp.controller.vo.CardProductVo; - -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_game_product】的数据库操作Mapper -* @createDate 2024-05-28 16:27:44 -* @Entity com.ruoyi.project.hit.domain.CardGameProduct -*/ -public interface CardGameProductMapper extends BaseMapper { - - List getGameProductByGameId(Integer id); - - int getSumAmountByGameId(Integer gameid); - - List getGameProductList(Integer id); -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardGameRuleMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardGameRuleMapper.java deleted file mode 100644 index 619eedb..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardGameRuleMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.domain.CardGameRule; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_game_rule】的数据库操作Mapper -* @createDate 2024-05-22 22:59:16 -* @Entity com.ruoyi.project.hit.domain.CardGameRule -*/ -public interface CardGameRuleMapper extends BaseMapper { - - List getGameRuleListByGameId(Integer id); - - int getHitCountSumByGameId(Integer gameid); -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardGameUserMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardGameUserMapper.java deleted file mode 100644 index fd75658..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardGameUserMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.domain.CardGameUser; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** -* @author HP -* @description 针对表【card_game_user】的数据库操作Mapper -* @createDate 2024-07-12 16:48:34 -* @Entity com.ruoyi.project.hit.domain.CardGameUser -*/ -public interface CardGameUserMapper extends BaseMapper { - -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardProductMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardProductMapper.java deleted file mode 100644 index b0e4900..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardProductMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.domain.CardProduct; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** -* @author HP -* @description 针对表【card_product】的数据库操作Mapper -* @createDate 2024-05-24 20:50:39 -* @Entity com.ruoyi.project.hit.domain.CardProduct -*/ -public interface CardProductMapper extends BaseMapper { - -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardUserHitMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardUserHitMapper.java deleted file mode 100644 index 64910ae..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardUserHitMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.controller.vo.ListInfoVo; -import com.ruoyi.project.hit.controller.vo.TotalInfoVo; -import com.ruoyi.project.hit.domain.CardUserHit; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author HP -* @description 针对表【card_user_hit】的数据库操作Mapper -* @createDate 2024-05-28 23:47:42 -* @Entity com.ruoyi.project.hit.domain.CardUserHit -*/ -public interface CardUserHitMapper extends BaseMapper { - List selectCardUserHitInfo(TotalInfoVo totalInfoVo); - -// Map getCardGameBygameid(Integer gameid); - - List getProductsBygameid(Integer gameid); - - List selectCardUserHitList(ListInfoVo listInfoVo); - - List winnerRecord(Integer userId); -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/CardUserMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/CardUserMapper.java deleted file mode 100644 index ce9bad8..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/CardUserMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.controller.vo.ListCardUserVo; -import com.ruoyi.project.hit.domain.CardUser; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_user】的数据库操作Mapper -* @createDate 2024-05-22 22:53:27 -* @Entity com.ruoyi.project.hit.domain.CardUser -*/ -public interface CardUserMapper extends BaseMapper { - - List selectCardUserList(ListCardUserVo listCardUserVo); -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/mapper/PupuUpsHistoryMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/PupuUpsHistoryMapper.java new file mode 100644 index 0000000..b852a08 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/mapper/PupuUpsHistoryMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.project.hit.mapper; + +import com.ruoyi.project.hit.domain.PupuUpsHistory; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author HP +* @description 针对表【pupu_ups_history】的数据库操作Mapper +* @createDate 2024-09-04 13:45:24 +* @Entity com.ruoyi.project.hit.domain.PupuUpsHistory +*/ +public interface PupuUpsHistoryMapper extends BaseMapper { + +} + + + + diff --git a/src/main/java/com/ruoyi/project/hit/mapper/PupuUserMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/PupuUserMapper.java new file mode 100644 index 0000000..e986131 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/mapper/PupuUserMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.project.hit.mapper; + +import com.ruoyi.project.hit.domain.PupuUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author HP +* @description 针对表【pupu_user】的数据库操作Mapper +* @createDate 2024-09-04 11:26:14 +* @Entity com.ruoyi.project.hit.domain.PupuUser +*/ +public interface PupuUserMapper extends BaseMapper { + +} + + + + diff --git a/src/main/java/com/ruoyi/project/hit/mapper/SystemDictMapper.java b/src/main/java/com/ruoyi/project/hit/mapper/SystemDictMapper.java deleted file mode 100644 index 6b78fcc..0000000 --- a/src/main/java/com/ruoyi/project/hit/mapper/SystemDictMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ruoyi.project.hit.mapper; - -import com.ruoyi.project.hit.domain.SystemDict; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** -* @author yifeng868 -* @description 针对表【system_dict】的数据库操作Mapper -* @createDate 2024-05-11 15:59:46 -* @Entity com.ruoyi.project.hit.domain.SystemDict -*/ -public interface SystemDictMapper extends BaseMapper { - -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/CardGameProductService.java b/src/main/java/com/ruoyi/project/hit/service/CardGameProductService.java deleted file mode 100644 index c8022c7..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardGameProductService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.project.hit.domain.CardGameProduct; -import com.baomidou.mybatisplus.extension.service.IService; -import com.ruoyi.project.uniapp.controller.vo.CardProductVo; - -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_game_product】的数据库操作Service -* @createDate 2024-05-28 16:27:44 -*/ -public interface CardGameProductService extends IService { - - /** - *根据productid查询总记录数 - * @param id - * @return - */ - Long queryByProductId(Integer id); - - /** - * 通过活动id(gameid)拿到对应奖品数据 - * @param id gameid - * @return - */ - List getGameProductByGameId(Integer id); - - /** - * 通过活动id(gameid)删除对应奖品数据 - * @param gameid - * @return - */ - int deleteByGameId(Integer gameid); - - /** - * 活动奖品配置 - * @param cardGameProduct - * @return - */ - int configGameProduct(CardGameProduct cardGameProduct); - - /** - * 通过gameid拿到该活动配置的奖品总数量 - * @param gameid - * @return - */ - int getSumAmountByGameId(Integer gameid); - - int deleteGameProduct(Integer id); - - List getGameProductList(Integer id); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/CardGameRuleService.java b/src/main/java/com/ruoyi/project/hit/service/CardGameRuleService.java deleted file mode 100644 index 90a26c7..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardGameRuleService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.project.hit.domain.CardGameRule; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_game_rule】的数据库操作Service -* @createDate 2024-05-22 22:59:16 -*/ -public interface CardGameRuleService extends IService { - - /** - *根据会员等级编号查询总记录数 - * @param dictKey - * @return - */ - Long queryByDictKey(Integer dictKey); - - List getGameRuleListByGameId(Integer id); - - /** - * 通过活动id删除对应的活动奖品策略 - * @param gameid - * @return - */ - int deleteByGameId(Integer gameid); - - /** - * 中奖策略配置接口 - * @param cardGameRule - * @return - */ - int configGameRule(CardGameRule cardGameRule); - - /** - * 通过gameid拿到该活动允许中奖的总次数 - * @param gameid - * @return - */ - int getHitCountSumByGameId(Integer gameid); - - int deleteGameRule(Integer id); - - List getGameRuleList(Integer id); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/CardGameService.java b/src/main/java/com/ruoyi/project/hit/service/CardGameService.java deleted file mode 100644 index 90f8283..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardGameService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.project.hit.controller.vo.ListCardGameVo; -import com.ruoyi.project.hit.domain.CardGame; -import com.baomidou.mybatisplus.extension.service.IService; -import com.ruoyi.project.uniapp.controller.vo.CardUserGameVo; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author HP -* @description 针对表【card_game】的数据库操作Service -* @createDate 2024-05-25 21:09:47 -*/ -public interface CardGameService extends IService { - - - /** - * 活动列表显示 - * @param listCardGameVo - * @return - */ - List selectCardGameList(ListCardGameVo listCardGameVo); - - int addCardGame(CardGame cardGame); - - /** - * 根据id查询活动 - * @param id - * @return - */ - Map getCardGameDataById(Integer id); - - int updateCardGame(CardGame cardGame); - - int deleteCardGameById(Integer id); - - /** - * 活动详情接口 - * @param id - * @return - */ - Map getCardGameDetailById(Integer id); - - CardGame getCardGameByGameId(Integer gameid); - - List carousel(); - - List showAllCardGame(); - - Map getGameDetail(Integer gameId); - - void preHot(Date now); - - HashMap getCardGameBygameid(Integer gameid); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/CardGameUserService.java b/src/main/java/com/ruoyi/project/hit/service/CardGameUserService.java deleted file mode 100644 index 27fa585..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardGameUserService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.project.hit.domain.CardGameUser; -import com.baomidou.mybatisplus.extension.service.IService; - -/** -* @author HP -* @description 针对表【card_game_user】的数据库操作Service -* @createDate 2024-07-12 16:48:34 -*/ -public interface CardGameUserService extends IService { - - int addCardGameUser(CardGameUser cardGameUser); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/CardProductService.java b/src/main/java/com/ruoyi/project/hit/service/CardProductService.java deleted file mode 100644 index ed32dd5..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardProductService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.framework.web.domain.AjaxResult; -import com.ruoyi.project.hit.controller.vo.ExcelCardProductVo; -import com.ruoyi.project.hit.controller.vo.ListCardProductVo; -import com.ruoyi.project.hit.domain.CardProduct; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author HP -* @description 针对表【card_product】的数据库操作Service -* @createDate 2024-05-24 20:50:39 -*/ -public interface CardProductService extends IService { - - /** - * 获取奖品列表 - * @param listCardProductVo - * @return - */ - List selectCardProductList(ListCardProductVo listCardProductVo); - - /** - * 修改奖品 - * @param cardProduct - */ - int updateProduct(CardProduct cardProduct); - - /** - * 根据id查询奖品 - * @param id - * @return - */ - CardProduct getProductById(Integer id); - - /** - * 删除奖品 - * @param id - * @return - */ - int deleteProduct(Integer id); - - /** - * 新增奖品 - * @param cardProduct - * @return - */ - int addProduct(CardProduct cardProduct); - - /** - * 奖品列表显示 - * @return - */ - List> select(); - - -} diff --git a/src/main/java/com/ruoyi/project/hit/service/CardUserHitService.java b/src/main/java/com/ruoyi/project/hit/service/CardUserHitService.java deleted file mode 100644 index f626b04..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardUserHitService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.project.hit.controller.vo.ListInfoVo; -import com.ruoyi.project.hit.controller.vo.TotalInfoVo; -import com.ruoyi.project.hit.domain.CardUserHit; -import com.baomidou.mybatisplus.extension.service.IService; -import com.ruoyi.project.uniapp.controller.vo.CardProductVo; -import com.ruoyi.project.uniapp.controller.vo.CardUserGameVo; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author HP -* @description 针对表【card_user_hit】的数据库操作Service -* @createDate 2024-05-28 23:47:42 -*/ -public interface CardUserHitService extends IService { - - /** - * 中奖统计列表显示 - * @param totalInfoVo - * @return - */ - List selectCardUserHitInfo(TotalInfoVo totalInfoVo); - - /** - * 中奖统计详情显示 - * @param gameid 活动id - * @return 中奖统计详情 - */ - Map selectCardUserHitInfoByGameId(Integer gameid); - - /** - * 中奖列表显示 - * @param listInfoVo 中奖列表显示参数 - * @return 中奖列表 - */ - List selectCardUserHitList(ListInfoVo listInfoVo); - - CardProductVo getPrizeDraw(CardUserGameVo cardUserGameVo); - - int addCardUserHit(CardUserHit cardUserHit); - - List winnerRecord(Integer userId); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/CardUserService.java b/src/main/java/com/ruoyi/project/hit/service/CardUserService.java deleted file mode 100644 index 385454a..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/CardUserService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.framework.web.domain.AjaxResult; -import com.ruoyi.project.hit.controller.vo.ListCardUserVo; -import com.ruoyi.project.hit.domain.CardUser; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_user】的数据库操作Service -* @createDate 2024-05-22 22:53:27 -*/ -public interface CardUserService extends IService { - - /** - *根据会员等级编号查询总记录数 - * @param dictKey - * @return - */ - Long queryByDictKey(Integer dictKey); - - /** - * - * @param listCardUserVo - * @return - */ - List selectCardUserList(ListCardUserVo listCardUserVo); - - CardUser login(String userName, String userPass); - - boolean weatherLogin(Integer userId); - - int addCardUser(CardUser cardUser); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/PupuUpsHistoryService.java b/src/main/java/com/ruoyi/project/hit/service/PupuUpsHistoryService.java new file mode 100644 index 0000000..5626f9d --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/service/PupuUpsHistoryService.java @@ -0,0 +1,13 @@ +package com.ruoyi.project.hit.service; + +import com.ruoyi.project.hit.domain.PupuUpsHistory; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author HP +* @description 针对表【pupu_ups_history】的数据库操作Service +* @createDate 2024-09-04 13:45:24 +*/ +public interface PupuUpsHistoryService extends IService { + +} diff --git a/src/main/java/com/ruoyi/project/hit/service/PupuUserService.java b/src/main/java/com/ruoyi/project/hit/service/PupuUserService.java new file mode 100644 index 0000000..e29d4e6 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/service/PupuUserService.java @@ -0,0 +1,17 @@ +package com.ruoyi.project.hit.service; + +import com.ruoyi.project.hit.domain.PupuUser; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.project.hit.domain.vo.UserLoginVO; + +/** +* @author HP +* @description 针对表【pupu_user】的数据库操作Service +* @createDate 2024-09-04 11:26:14 +*/ +public interface PupuUserService extends IService { + + PupuUser login(UserLoginVO userLoginVO); + + int register(PupuUser pupuUser); +} diff --git a/src/main/java/com/ruoyi/project/hit/service/SystemDictService.java b/src/main/java/com/ruoyi/project/hit/service/SystemDictService.java deleted file mode 100644 index 744985f..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/SystemDictService.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.ruoyi.project.hit.service; - -import com.ruoyi.project.hit.domain.SystemDict; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** -* @author yifeng868 -* @description 针对表【system_dict】的数据库操作Service -* @createDate 2024-05-11 15:59:46 -*/ -public interface SystemDictService extends IService { - /** - * 获取用户 - * @param dict - * @return - */ - List selectSystemDictList(SystemDict dict); - - /** - * 校验会员等级名称 - * - * @param dict 会员等级信息 - * @return 结果 - */ - String checkDictValueUnique(SystemDict dict); - - /** - * 校验会员等级代号 - * - * @param dict 会员等级信息 - * @return 结果 - */ - String checkDictKeyUnique(SystemDict dict); - - /** - * 新增保存会员等级信息 - * - * @param dict 会员等级信息 - * @return 结果 - */ - int insertDict(SystemDict dict); - - /** - * 删除会员等级信息 - * - * @param id 会员id - * @return 结果 - */ - int deleteDictById(Integer id); - - /** - * 通过id获取会员等级信息 - * - * @param id 会员id - * @return 结果 - */ - SystemDict selectDictById(Long id); - - - /** - * 更新会员等级信息 - * - * @param dict 会员等级信息 - * @return 结果 - */ - int updateDict(SystemDict dict); - - - /** - * 根据字典类型查询字典信息 - * @param type 1:会员等级 2:活动类型 - * @return - */ - List selectOption(Integer type); -} diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameProductServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardGameProductServiceImpl.java deleted file mode 100644 index 6d04721..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameProductServiceImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.project.hit.domain.CardGame; -import com.ruoyi.project.hit.domain.CardGameProduct; -import com.ruoyi.project.hit.service.CardGameProductService; -import com.ruoyi.project.hit.mapper.CardGameProductMapper; -import com.ruoyi.project.hit.service.CardGameService; -import com.ruoyi.project.hit.service.CardUserHitService; -import com.ruoyi.project.uniapp.controller.vo.CardProductVo; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_game_product】的数据库操作Service实现 -* @createDate 2024-05-28 16:27:44 -*/ -@Service -public class CardGameProductServiceImpl extends ServiceImpl - implements CardGameProductService{ - - @Resource - private CardGameProductMapper cardGameProductMapper; - @Resource - private CardUserHitService cardUserHitService; - @Resource - private CardGameService cardGameService; - - @Override - public Long queryByProductId(Integer id) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGameProduct::getProductid,id); - return cardGameProductMapper.selectCount(wrapper); - } - - @Override - public List getGameProductByGameId(Integer id) { - return cardGameProductMapper.getGameProductByGameId(id); - } - - /** - * 通过活动id(gameid)删除对应奖品数据 - * @param gameid - * @return - */ - @Override - public int deleteByGameId(Integer gameid) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGameProduct::getGameid,gameid); - return cardGameProductMapper.delete(wrapper); - } - - /** - * 活动奖品配置 - * @param cardGameProduct - * @return - */ - @Override - public int configGameProduct(CardGameProduct cardGameProduct) { - return cardGameProductMapper.insert(cardGameProduct); - } - - @Override - public int getSumAmountByGameId(Integer gameid) { - return cardGameProductMapper.getSumAmountByGameId(gameid); - } - - @Override - public int deleteGameProduct(Integer id) { - CardGameProduct cardGameProduct = cardGameProductMapper.selectById(id); - CardGame cardGame = cardGameService.getCardGameByGameId(cardGameProduct.getGameid()); - //如果活动已开始,则不可删除 - if(cardGame.getStartTime().before(new Date())){ - throw new CustomException("活动已开始,不可执行删除操作"); - } - //活动已开始时,不允许删除该活动的奖品 - return cardGameProductMapper.deleteById(id); - } - - @Override - public List getGameProductList(Integer id) { - return cardGameProductMapper.getGameProductList(id); - } -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameRuleServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardGameRuleServiceImpl.java deleted file mode 100644 index 586892a..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameRuleServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.project.hit.domain.CardGameRule; -import com.ruoyi.project.hit.domain.CardUser; -import com.ruoyi.project.hit.service.CardGameProductService; -import com.ruoyi.project.hit.service.CardGameRuleService; -import com.ruoyi.project.hit.mapper.CardGameRuleMapper; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; - -/** -* @author HP -* @description 针对表【card_game_rule】的数据库操作Service实现 -* @createDate 2024-05-22 22:59:16 -*/ -@Service -public class CardGameRuleServiceImpl extends ServiceImpl - implements CardGameRuleService{ - - @Resource - private CardGameRuleMapper cardGameRuleMapper; - @Resource - private CardGameProductService cardGameProductService; - - - @Override - public Long queryByDictKey(Integer dictKey) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGameRule::getLevelid,dictKey); - return cardGameRuleMapper.selectCount(wrapper); - } - - /** - * 通过gameid拿到gameRuleList - * @param id gameid - * @return - */ - @Override - public List getGameRuleListByGameId(Integer id) { - return cardGameRuleMapper.getGameRuleListByGameId(id); - } - - @Override - public int deleteByGameId(Integer gameid) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGameRule::getGameid,gameid); - return cardGameRuleMapper.delete(wrapper); - } - - @Override - public int configGameRule(CardGameRule cardGameRule) { - if(cardGameRule.getEnterCount() wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGameRule::getGameid,cardGameRule.getGameid()); - wrapper.eq(CardGameRule::getLevelid,cardGameRule.getLevelid()); - CardGameRule cardGameRule1 = cardGameRuleMapper.selectOne(wrapper); - if(cardGameRule1!=null){ - throw new CustomException("已为该活动的此会员等级配置奖品,请勿重复配置"); - } - if(cardGameRuleMapper.getHitCountSumByGameId(cardGameRule.getGameid())+cardGameRule.getHitCount()>cardGameProductService.getSumAmountByGameId(cardGameRule.getGameid())){ - throw new CustomException("配置奖品数量超出所准备的数量,配置失败"); - } - - - return cardGameRuleMapper.insert(cardGameRule); - } - - @Override - public int getHitCountSumByGameId(Integer gameid) { - return cardGameRuleMapper.getHitCountSumByGameId(gameid); - } - - @Override - public int deleteGameRule(Integer id) { - return cardGameRuleMapper.deleteById(id); - } - - @Override - public List getGameRuleList(Integer id) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGameRule::getGameid,id); - return cardGameRuleMapper.selectList(wrapper); - } - -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardGameServiceImpl.java deleted file mode 100644 index 898f351..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameServiceImpl.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.alibaba.fastjson.JSONArray; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.project.hit.controller.vo.ListCardGameVo; -import com.ruoyi.project.hit.domain.CardGame; -import com.ruoyi.project.hit.domain.CardGameRule; -import com.ruoyi.project.hit.service.CardGameProductService; -import com.ruoyi.project.hit.service.CardGameRuleService; -import com.ruoyi.project.hit.service.CardGameService; -import com.ruoyi.project.hit.mapper.CardGameMapper; -import com.ruoyi.project.hit.service.CardUserHitService; -import com.ruoyi.project.uniapp.controller.vo.CardProductVo; -import com.ruoyi.project.uniapp.controller.vo.CardUserGameVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.TimeUnit; - -/** -* @author HP -* @description 针对表【card_game】的数据库操作Service实现 -* @createDate 2024-05-25 21:09:47 -*/ -@Slf4j -@Service -public class CardGameServiceImpl extends ServiceImpl - implements CardGameService{ - @Autowired - private RedisTemplate redisTemplate; - - @Resource - private CardGameMapper cardGameMapper; - @Resource - private CardGameRuleService cardGameRuleService; - @Resource - private CardGameProductService cardGameProductService; - @Resource - private CardUserHitService cardUserHitService; - - @Override - public List selectCardGameList(ListCardGameVo listCardGameVo) { - return cardGameMapper.selectCardGameList(listCardGameVo); - } - - @Override - public int addCardGame(CardGame cardGame) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardGame::getTitle,cardGame.getTitle()); - CardGame cardGame1 = cardGameMapper.selectOne(wrapper); - if(null!=cardGame1){ - throw new CustomException("该活动标题已存在,添加失败"); - } - //活动状态 0:未开始 1:已结束(已加载) - if(cardGame.getStartTime().after(new Date())){ - cardGame.setStatus(0); - }else { - cardGame.setStatus(1); - } - return cardGameMapper.insert(cardGame); - } - - @Override - public Map getCardGameDataById(Integer id) { - Map map=new HashMap<>(); - - List list1 = cardGameRuleService.getGameRuleListByGameId(id); - map.put("gameRuleList",list1); - List list2=cardGameProductService.getGameProductByGameId(id); - map.put("gameProductList",list2); - CardGame cardGame = cardGameMapper.selectById(id); - map.put("cardGame",cardGame); - return map; - } - - @Override - public int updateCardGame(CardGame cardGame) { - LambdaQueryWrapper wrapper =new LambdaQueryWrapper<>(); - wrapper.eq(CardGame::getTitle,cardGame.getTitle()); - wrapper.ne(CardGame::getId,cardGame.getId()); - CardGame cardGame1 = cardGameMapper.selectOne(wrapper); - if(cardGame1!=null){ - throw new CustomException("该活动标题已存在,修改失败"); - } - return cardGameMapper.updateById(cardGame); - } - - @Override - public int deleteCardGameById(Integer id) { - CardGame cardGame = cardGameMapper.selectById(id); - //如果活动已开始,则不可删除 - if(cardGame.getStartTime().before(new Date())){ - throw new CustomException("活动已开始,不可执行删除操作"); - } - //删除对应活动奖品配置信息 - cardGameProductService.deleteByGameId(id); - //删除对应活动配置的活动奖品策略 - cardGameRuleService.deleteByGameId(id); - return cardGameMapper.deleteById(id); - } - - @Override - public Map getCardGameDetailById(Integer id) { - Map map=new HashMap<>(); - - List list1 = cardGameRuleService.getGameRuleListByGameId(id); - map.put("gameRuleList",list1); - List list2=cardGameProductService.getGameProductByGameId(id); - map.put("gameProductList",list2); - HashMap cardGame = cardGameMapper.getCardGameByGameId(id); - map.put("cardGame",cardGame); - return map; - } - - @Override - public CardGame getCardGameByGameId(Integer gameid) { - return cardGameMapper.selectById(gameid); - } - - @Override - public List carousel() { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.select(CardGame::getPic); - wrapper.select(CardGame::getTitle); - return cardGameMapper.selectList(wrapper); - } - - @Override - public List showAllCardGame() { - return cardGameMapper.showAllCardGame(); - } - - @Override - public Map getGameDetail(Integer gameId) { - Map map=new HashMap(); - List gameRuleList = cardGameRuleService.getGameRuleListByGameId(gameId); - map.put("gameRuleList",gameRuleList); - - List gameProductList = cardGameProductService.getGameProductByGameId(gameId); - map.put("gameProductList",gameProductList); - Map map1 = cardUserHitService.selectCardUserHitInfoByGameId(gameId); - map.putAll(map1); - return map; - } - - @Override - public void preHot(Date now) { - List cardGameList = cardGameMapper.getCardByDate(now); - if(cardGameList.size()==0){ - return; - } - //活动信息缓存redis(json字符串存储) - for (CardGame cardGame : cardGameList) { - String jsonCardGame = JSONArray.toJSONString(cardGame); - //失效时间 - long l=cardGame.getEndTime().getTime()-now.getTime(); - redisTemplate.opsForValue().set("cardGame:"+cardGame.getId(),jsonCardGame,l,TimeUnit.MILLISECONDS); - - List gameRuleList = cardGameRuleService.getGameRuleList(cardGame.getId()); - for (CardGameRule cardGameRule : gameRuleList) { - //最大中奖数缓存redis(hash存储) - redisTemplate.opsForHash().put("cardGame_maxHitCount:"+cardGame.getId(),cardGameRule.getLevelid(),cardGameRule.getHitCount()); - //最大抽奖数缓存redis(hash存储) - redisTemplate.opsForHash().put("cardGame_maxEnterCount:"+cardGame.getId(),cardGameRule.getLevelid(),cardGameRule.getEnterCount()); - } - //设置两个hash失效时间 - redisTemplate.expire("cardGame_maxHitCount:"+cardGame.getId(),l, TimeUnit.MILLISECONDS); - redisTemplate.expire("cardGame_maxEnterCount:"+cardGame.getId(),l, TimeUnit.MILLISECONDS); - - List gameProductList = cardGameProductService.getGameProductList(cardGame.getId()); - //抽奖令牌桶 - List tokenList=new ArrayList<>(); - for (CardProductVo cardProductVo : gameProductList) { - for (int i = 0; i < cardProductVo.getAmount(); i++) { - //给每个奖品都配置一个时间戳 - Long start=cardGame.getStartTime().getTime(); - Long end=cardGame.getEndTime().getTime(); - //时间差 - int time= (int) (end-start); - Long token=start+new Random().nextInt(time); - //避免重复 - token=token*10000+new Random().nextInt(9999); - tokenList.add(token); - //奖品-令牌缓存redis(string存储) - redisTemplate.opsForValue().set("gameId_token:"+cardGame.getId()+"_"+token,cardProductVo,l,TimeUnit.MILLISECONDS); - } - - } - //由小到大排 - Collections.sort(tokenList); - //令牌集合redis缓存(list存储) - redisTemplate.opsForList().rightPushAll("game_token:"+cardGame.getId(),tokenList); - redisTemplate.expire("game_token:"+cardGame.getId(),l,TimeUnit.MILLISECONDS); - - //活动状态置1 - cardGame.setStatus(1); - cardGameMapper.updateById(cardGame); - } - - - } - - @Override - public HashMap getCardGameBygameid(Integer gameid) { - return cardGameMapper.getCardGameBygameid(gameid); - } -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameUserServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardGameUserServiceImpl.java deleted file mode 100644 index ab38865..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardGameUserServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.project.hit.domain.CardGameUser; -import com.ruoyi.project.hit.service.CardGameUserService; -import com.ruoyi.project.hit.mapper.CardGameUserMapper; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** -* @author HP -* @description 针对表【card_game_user】的数据库操作Service实现 -* @createDate 2024-07-12 16:48:34 -*/ -@Service -public class CardGameUserServiceImpl extends ServiceImpl - implements CardGameUserService{ - @Resource - private CardGameUserMapper cardGameUserMapper; - - @Override - public int addCardGameUser(CardGameUser cardGameUser) { - return cardGameUserMapper.insert(cardGameUser); - } -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardProductServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardProductServiceImpl.java deleted file mode 100644 index fdf9dad..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardProductServiceImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.mchange.lang.DoubleUtils; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.project.hit.controller.vo.ExcelCardProductVo; -import com.ruoyi.project.hit.controller.vo.ListCardProductVo; -import com.ruoyi.project.hit.domain.CardProduct; -import com.ruoyi.project.hit.domain.CardUser; -import com.ruoyi.project.hit.domain.SystemDict; -import com.ruoyi.project.hit.mapper.CardUserMapper; -import com.ruoyi.project.hit.service.CardGameProductService; -import com.ruoyi.project.hit.service.CardProductService; -import com.ruoyi.project.hit.mapper.CardProductMapper; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** -* @author HP -* @description 针对表【card_product】的数据库操作Service实现 -* @createDate 2024-05-24 20:50:39 -*/ -@Service -public class CardProductServiceImpl extends ServiceImpl - implements CardProductService{ - @Resource - private CardProductMapper cardProductMapper; - @Resource - private CardGameProductService cardGameProductService; - - @Override - public List selectCardProductList(ListCardProductVo listCardProductVo) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - if (StringUtils.isNotEmpty(listCardProductVo.getPname())){ - wrapper.like(CardProduct::getPname,listCardProductVo.getPname()); - } - if (listCardProductVo.getPriceLow()!=0){ - wrapper.ge(CardProduct::getPrice,listCardProductVo.getPriceLow()); - } - if (listCardProductVo.getPriceHigh()!=0){ - wrapper.le(CardProduct::getPrice,listCardProductVo.getPriceHigh()); - } - return cardProductMapper.selectList(wrapper); - } - - @Override - public int updateProduct(CardProduct cardProduct) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.ne(CardProduct::getId,cardProduct.getId()); - wrapper.eq(CardProduct::getPname,cardProduct.getPname()); - CardProduct cardProduct1 = cardProductMapper.selectOne(wrapper); - if(cardProduct1!=null){ - throw new CustomException("该奖品名已存在,修改失败"); - } - return cardProductMapper.updateById(cardProduct); - } - - @Override - public CardProduct getProductById(Integer id) { - return cardProductMapper.selectById(id); - } - - @Override - public int deleteProduct(Integer id) { - Long i = cardGameProductService.queryByProductId(id); - if(i>0){ - throw new CustomException("该奖品已被活动配置,无法删除"); - } - return cardProductMapper.deleteById(id); - } - - @Override - public int addProduct(CardProduct cardProduct) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardProduct::getPname,cardProduct.getPname()); - CardProduct cardProduct1 = cardProductMapper.selectOne(wrapper); - if(cardProduct1!=null){ - throw new CustomException("该奖品名已存在,添加失败"); - } - return cardProductMapper.insert(cardProduct); - } - - @Override - public List> select() { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.select(CardProduct::getId,CardProduct::getPname); - return cardProductMapper.selectMaps(wrapper); - } - - - -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardUserHitServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardUserHitServiceImpl.java deleted file mode 100644 index c9c3961..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardUserHitServiceImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.bean.BeanUtils; -import com.ruoyi.project.hit.controller.vo.ListInfoVo; -import com.ruoyi.project.hit.controller.vo.TotalInfoVo; -import com.ruoyi.project.hit.domain.*; -import com.ruoyi.project.hit.service.CardGameService; -import com.ruoyi.project.hit.service.CardUserHitService; -import com.ruoyi.project.hit.mapper.CardUserHitMapper; -import com.ruoyi.project.hit.service.CardUserService; -import com.ruoyi.project.uniapp.controller.vo.CardProductVo; -import com.ruoyi.project.uniapp.controller.vo.CardUserGameVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** -* @author HP -* @description 针对表【card_user_hit】的数据库操作Service实现 -* @createDate 2024-05-28 23:47:42 -*/ -@Slf4j -@Service -public class CardUserHitServiceImpl extends ServiceImpl - implements CardUserHitService{ - @Resource - private CardUserHitMapper cardUserHitMapper; - - @Autowired - private CardGameService cardGameService; - @Autowired - private CardUserService cardUserService; - - @Autowired - private RedisTemplate redisTemplate; - @Autowired - private RabbitTemplate rabbitTemplate; - - @Override - public List selectCardUserHitInfo(TotalInfoVo totalInfoVo) { - return cardUserHitMapper.selectCardUserHitInfo(totalInfoVo); - } - - @Override - public Map selectCardUserHitInfoByGameId(Integer gameid) { - Map map=new HashMap<>(); - //根据活动id拿到活动详情以及活动类型(2表) - Map map1 = cardGameService.getCardGameBygameid(gameid); -// log.debug("cardGame",map1); - map.put("cardGame",map1); - CardGame cardGame = cardGameService.getCardGameByGameId(gameid); - if(StringUtils.isNotNull(cardGame)&&cardGame.getEndTime().before(new Date())){ - //根据活动id拿到活动中奖明细(3表) - List hashMapList=cardUserHitMapper.getProductsBygameid(gameid); - map.put("products",hashMapList); - } - return map; - } - - @Override - public List selectCardUserHitList(ListInfoVo listInfoVo) { - return cardUserHitMapper.selectCardUserHitList(listInfoVo); - } - - @Override - public CardProductVo getPrizeDraw(CardUserGameVo cardUserGameVo) { - Date now=new Date(); - boolean b1 = cardUserService.weatherLogin(cardUserGameVo.getUserId()); - if(!b1){ - throw new CustomException("用户未登录"); - } - CardGame cardGame = JSON.parseObject((String) redisTemplate.opsForValue().get("cardGame:" + cardUserGameVo.getGameId()),CardGame.class); - CardUser cardUser= (CardUser) redisTemplate.opsForValue().get("user_login:"+cardUserGameVo.getUserId()); - if(StringUtils.isNull(cardGame)||now.before(cardGame.getStartTime())){ - throw new CustomException("活动未开始"); - } - if(now.after(cardGame.getEndTime())){ - throw new CustomException("活动已结束"); - } - //判断该用户是否参与过抽奖 - Boolean b = redisTemplate.hasKey("cardGame_user:" + cardUserGameVo.getGameId() + "_" + cardUserGameVo.getUserId()); - if(!b){ - //value:抽奖次数 - redisTemplate.opsForValue().set("cardGame_user:" + cardUserGameVo.getGameId() + "_" + cardUserGameVo.getUserId(),0,(cardGame.getEndTime().getTime()-now.getTime()), TimeUnit.MILLISECONDS); - //value:中奖次数 - redisTemplate.opsForValue().set("cardGame_user_hit:" + cardUserGameVo.getGameId() + "_" + cardUserGameVo.getUserId(),0,(cardGame.getEndTime().getTime()-now.getTime()), TimeUnit.MILLISECONDS); - } - int maxEnterCount = (int) redisTemplate.opsForHash().get("cardGame_maxEnterCount:" + cardUserGameVo.getGameId(), cardUser.getLevel()); - int EnterCount=(int) redisTemplate.opsForValue().get("cardGame_user:" + cardUserGameVo.getGameId() + "_" + cardUserGameVo.getUserId()); - if(EnterCount>=maxEnterCount){ - throw new CustomException("抽奖次数已达上限"); - } - int maxHitCount = (int) redisTemplate.opsForHash().get("cardGame_maxHitCount:" + cardUserGameVo.getGameId(), cardUser.getLevel()); - int HitCount=(int) redisTemplate.opsForValue().get("cardGame_user_hit:" + cardUserGameVo.getGameId() + "_" + cardUserGameVo.getUserId()); - //抽奖记录次数加一 - redisTemplate.opsForValue().increment("cardGame_user:" + cardUserGameVo.getGameId() + "_" + cardUserGameVo.getUserId(),1); - //mq写入抽奖记录到数据库 - CardGameUser cardGameUser=new CardGameUser(cardUserGameVo.getUserId(),cardUserGameVo.getGameId(),now); - String cardGameUserStr= JSONObject.toJSONString(cardGameUser); - rabbitTemplate.convertAndSend("drawRecord",cardGameUserStr); - //该用户已经达到最大中奖次数 - if(HitCount>=maxHitCount){ - return null; - } - //抽奖流程 - Long token= (Long) redisTemplate.opsForList().leftPop("game_token:"+cardUserGameVo.getGameId()); - if(StringUtils.isNull(token)){ - throw new CustomException("奖品已抽完"); - } - if(now.getTime() winnerRecord(Integer userId) { - return cardUserHitMapper.winnerRecord(userId); - } - -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/CardUserServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/CardUserServiceImpl.java deleted file mode 100644 index 1d55d97..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/CardUserServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.project.hit.controller.vo.ListCardUserVo; -import com.ruoyi.project.hit.domain.CardUser; -import com.ruoyi.project.hit.domain.SystemDict; -import com.ruoyi.project.hit.service.CardUserService; -import com.ruoyi.project.hit.mapper.CardUserMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.TimeoutUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** -* @author HP -* @description 针对表【card_user】的数据库操作Service实现 -* @createDate 2024-05-22 22:53:27 -*/ -@Service -public class CardUserServiceImpl extends ServiceImpl - implements CardUserService{ - @Autowired - private RedisTemplate redisTemplate; - - @Resource - private CardUserMapper cardUserMapper; - - @Override - public Long queryByDictKey(Integer dictKey) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardUser::getLevel,dictKey); - return cardUserMapper.selectCount(wrapper); - } - - @Override - public List selectCardUserList(ListCardUserVo listCardUserVo) { - return cardUserMapper.selectCardUserList(listCardUserVo); - } - - @Override - public CardUser login(String userName, String userPass) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(CardUser::getUserName,userName); - wrapper.eq(CardUser::getUserPass,userPass); - CardUser cardUser = cardUserMapper.selectOne(wrapper); - if(StringUtils.isNotNull(cardUser)){ - redisTemplate.opsForValue().set("user_login:"+cardUser.getId(),cardUser, 30, TimeUnit.MINUTES); - return cardUser; - } - throw new CustomException("登录失败"); - - } - - @Override - public boolean weatherLogin(Integer userId) { - return redisTemplate.hasKey("user_login:"+userId); - } - - @Override - public int addCardUser(CardUser cardUser) { - return cardUserMapper.insert(cardUser); - } -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/PupuUpsHistoryServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/PupuUpsHistoryServiceImpl.java new file mode 100644 index 0000000..be47c74 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/service/impl/PupuUpsHistoryServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.project.hit.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.project.hit.domain.PupuUpsHistory; +import com.ruoyi.project.hit.service.PupuUpsHistoryService; +import com.ruoyi.project.hit.mapper.PupuUpsHistoryMapper; +import org.springframework.stereotype.Service; + +/** +* @author HP +* @description 针对表【pupu_ups_history】的数据库操作Service实现 +* @createDate 2024-09-04 13:45:24 +*/ +@Service +public class PupuUpsHistoryServiceImpl extends ServiceImpl + implements PupuUpsHistoryService{ + +} + + + + diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/PupuUserServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/PupuUserServiceImpl.java new file mode 100644 index 0000000..ddb148d --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/service/impl/PupuUserServiceImpl.java @@ -0,0 +1,50 @@ +package com.ruoyi.project.hit.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.exception.CustomException; +import com.ruoyi.project.hit.domain.PupuUser; +import com.ruoyi.project.hit.domain.vo.UserLoginVO; +import com.ruoyi.project.hit.service.PupuUserService; +import com.ruoyi.project.hit.mapper.PupuUserMapper; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + + + +/** +* @author HP +* @description 针对表【pupu_user】的数据库操作Service实现 +* @createDate 2024-09-04 11:26:14 +*/ +@Service +public class PupuUserServiceImpl extends ServiceImpl + implements PupuUserService{ + + @Resource + private PupuUserMapper pupuUserMapper; + + @Override + public PupuUser login(UserLoginVO userLoginVO) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(PupuUser::getUserName,userLoginVO.getUserName()); + wrapper.eq(PupuUser::getPassword,userLoginVO.getPassword()); + return pupuUserMapper.selectOne(wrapper); + } + + @Override + public int register(PupuUser pupuUser) { + int i=0; + try { + i = pupuUserMapper.insert(pupuUser); + } catch (Exception e){ + throw new CustomException("账号已存在"); + } + return i; + } +} + + + + diff --git a/src/main/java/com/ruoyi/project/hit/service/impl/SystemDictServiceImpl.java b/src/main/java/com/ruoyi/project/hit/service/impl/SystemDictServiceImpl.java deleted file mode 100644 index 945e94e..0000000 --- a/src/main/java/com/ruoyi/project/hit/service/impl/SystemDictServiceImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.ruoyi.project.hit.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.project.hit.domain.SystemDict; -import com.ruoyi.project.hit.mapper.CardUserMapper; -import com.ruoyi.project.hit.service.CardGameRuleService; -import com.ruoyi.project.hit.service.CardUserService; -import com.ruoyi.project.hit.service.SystemDictService; -import com.ruoyi.project.hit.mapper.SystemDictMapper; - -import com.ruoyi.project.system.domain.SysPost; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; - -/** -* @author yifeng868 -* @description 针对表【system_dict】的数据库操作Service实现 -* @createDate 2024-05-11 15:59:46 -*/ -@Service -public class SystemDictServiceImpl extends ServiceImpl - implements SystemDictService{ - @Resource - private SystemDictMapper systemDictMapper; - @Resource - private CardUserService cardUserService; - @Resource - private CardGameRuleService cardGameRuleService; - - - - @Override - public List selectSystemDictList(SystemDict dict) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(SystemDict::getDictType,dict.getDictType()); - if (StringUtils.isNotEmpty(dict.getDictValue())){ - wrapper.like(SystemDict::getDictValue,dict.getDictValue()); - } - return systemDictMapper.selectList(wrapper); - } - - /** - * 校验会员等级名称是否唯一 - * - * @param dict 会员等级信息 - * @return 结果 - */ - @Override - public String checkDictValueUnique(SystemDict dict) { - //是否传入id的判断 - Long distId = StringUtils.isNull(dict.getId()) ? -1L : dict.getId(); - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(SystemDict::getDictType,dict.getDictType()); - wrapper.eq(SystemDict::getDictValue,dict.getDictValue()); - SystemDict info = systemDictMapper.selectOne(wrapper); - if (StringUtils.isNotNull(info) && info.getId().longValue() != distId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - - } - - /** - * 校验会员等级编码是否唯一 - * - * @param dict 会员等级信息 - * @return 结果 - */ - @Override - public String checkDictKeyUnique(SystemDict dict) { - Long distId = StringUtils.isNull(dict.getId()) ? -1L : dict.getId(); - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(SystemDict::getDictType,dict.getDictType()); - wrapper.eq(SystemDict::getDictKey,dict.getDictKey()); - SystemDict info = systemDictMapper.selectOne(wrapper); - if (StringUtils.isNotNull(info) && info.getId().longValue() != distId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - - } - - - /** - * 新增保存会员等级信息 - * - * @param dict 会员等级信息 - * @return 结果 - */ - @Override - public int insertDict(SystemDict dict) { - return systemDictMapper.insert(dict); - } - - /** - * 删除会员等级信息 - * - * @param id 会员等级ID - * @return 结果 - */ - @Override - public int deleteDictById(Integer id) { - //根据id查询会员等级编号 - SystemDict systemDict = systemDictMapper.selectById(id); - Long i=cardUserService.queryByDictKey(systemDict.getDictKey()); - if(i>0){ - throw new CustomException("会员等级编号在其他处调用"); - } - Long j=cardGameRuleService.queryByDictKey(systemDict.getDictKey()); - if(j>0){ - throw new CustomException("会员等级编号在其他处调用"); - } - - return systemDictMapper.deleteById(id); - } - - /** - * 通过会员等级ID查询信息 - * - * @param id 会员等级id - * @return - */ - @Override - public SystemDict selectDictById(Long id) { - return systemDictMapper.selectById(id); - } - - @Override - public int updateDict(SystemDict dict) { - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(SystemDict::getId,dict.getId()); - return systemDictMapper.update(dict,wrapper); - } - - @Override - public List selectOption(Integer type) { - String dictType=""; - if(type==1){ - dictType="userlevel"; - }else if(type==2){ - dictType="gametype"; - } - LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); - wrapper.eq(SystemDict::getDictType,dictType); - wrapper.select(SystemDict::getDictKey,SystemDict::getDictValue); - System.out.println(systemDictMapper.selectList(wrapper)); - return systemDictMapper.selectList(wrapper); - } -} - - - - diff --git a/src/main/java/com/ruoyi/project/hit/util/ScheduledTasks.java b/src/main/java/com/ruoyi/project/hit/util/ScheduledTasks.java new file mode 100644 index 0000000..fa90743 --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/util/ScheduledTasks.java @@ -0,0 +1,35 @@ +package com.ruoyi.project.hit.util; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.core.Cursor; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ScanOptions; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.Date; +import java.util.Map; + +@Component +public class ScheduledTasks { + + // 定时任务,每30秒执行一次 +// @Scheduled(fixedRate = 3000) + public void reportCurrentTime1() { + System.out.println(11); + long l = System.currentTimeMillis(); + Map upsMap = Util1.upsMap; + for (Map.Entry entry : upsMap.entrySet()) { + if(l-entry.getValue()>=30000){ + System.out.println(entry.getKey()); + } + } + + } + + + +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/project/hit/util/Token.java b/src/main/java/com/ruoyi/project/hit/util/Token.java new file mode 100644 index 0000000..773c22d --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/util/Token.java @@ -0,0 +1,70 @@ +package com.ruoyi.project.hit.util; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Base64; + + +public class Token { + + public static String assembleToken(String version, String resourceName, String expirationTime, String signatureMethod, String accessKey) + throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException { + StringBuilder sb = new StringBuilder(); + String res = URLEncoder.encode(resourceName, "UTF-8"); + String sig = URLEncoder.encode(generatorSignature(version, resourceName, expirationTime, accessKey, signatureMethod), "UTF-8"); + sb.append("version=") + .append(version) + .append("&res=") + .append(res) + .append("&et=") + .append(expirationTime) + .append("&method=") + .append(signatureMethod) + .append("&sign=") + .append(sig); + return sb.toString(); + } + + public static String generatorSignature(String version, String resourceName, String expirationTime, String accessKey, String signatureMethod) + throws NoSuchAlgorithmException, InvalidKeyException { + String encryptText = expirationTime + "\n" + signatureMethod + "\n" + resourceName + "\n" + version; + String signature; + byte[] bytes = HmacEncrypt(encryptText, accessKey, signatureMethod); + signature = Base64.getEncoder().encodeToString(bytes); + return signature; + } + + public static byte[] HmacEncrypt(String data, String key, String signatureMethod) + throws NoSuchAlgorithmException, InvalidKeyException { + //根据给定的字节数组构造一个密钥,第二参数指定一个密钥算法的名称 + SecretKeySpec signinKey = null; + signinKey = new SecretKeySpec(Base64.getDecoder().decode(key), + "Hmac" + signatureMethod.toUpperCase()); + //生成一个指定 Mac 算法 的 Mac 对象 + Mac mac = null; + mac = Mac.getInstance("Hmac" + signatureMethod.toUpperCase()); + //用给定密钥初始化 Mac 对象 + mac.init(signinKey); + //完成 Mac 操作 + return mac.doFinal(data.getBytes()); + } + + public enum SignatureMethod { + SHA1, MD5, SHA256; + } + + public static void main(String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException { + String version = "2022-05-01"; + String resourceName = "userid/12321"; + //用户自定义token过期时间 + String expirationTime = System.currentTimeMillis() / 1000 + 3600 + ""; + String signatureMethod = SignatureMethod.SHA1.name().toLowerCase(); + String accessKey = "KuF3NT/jUBJ62LNBB/A8XZA9CqS3Cu79B/ABmfA1UCw="; + String token = assembleToken(version, resourceName, expirationTime, signatureMethod, accessKey); + System.out.println("Authorization:" + token); + } +} diff --git a/src/main/java/com/ruoyi/project/hit/util/Util1.java b/src/main/java/com/ruoyi/project/hit/util/Util1.java new file mode 100644 index 0000000..dea919b --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/util/Util1.java @@ -0,0 +1,59 @@ +package com.ruoyi.project.hit.util; + +import com.ruoyi.project.hit.domain.PupuUpsHistory; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import java.io.IOException; +import java.util.Date; +import java.util.Map; + +public class Util1 { + public static Map upsMap; + public static String getdetail() throws IOException { + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + Request request = new Request.Builder() + .url("https://iot-api.heclouds.com/thingmodel/query-device-property?product_id=Tz9a5iUEkS&device_name=shante") + .addHeader("Authorization", "version=2022-05-01&res=products%2FTz9a5iUEkS%2Fdevices%2Fshante&et=2079998482&method=md5&sign=Gf925YWwSO7SAlOKY98l2Q%3D%3D") + .build(); + Response response = client.newCall(request).execute(); + return (response.body().string()); + } + + public static String convertToCamelCase(String input) { + StringBuilder result = new StringBuilder(); + boolean nextUpperCase = false; + + for (char c : input.toCharArray()) { + if (c == '_') { + nextUpperCase = true; + } else if (nextUpperCase) { + result.append(Character.toUpperCase(c)); + nextUpperCase = false; + } else { + result.append(c); + } + } + + // 如果字符串以下划线开头,则结果需要首字母大写 + if (Character.isLowerCase(result.charAt(0)) && input.startsWith("_")) { + result.setCharAt(0, Character.toUpperCase(result.charAt(0))); + } + + return result.toString(); + } + + //将map转为需要的pupuUpsHistory对象 + public static PupuUpsHistory getHistoryFromMap(Map map) { + PupuUpsHistory history=null; + + history = new PupuUpsHistory(null,(String) map.get("identifier"),new Date((Long) map.get("time")) , + (String) map.get("value"),(String) map.get("data_type"),(String) map.get("name"),(String) map.get("access_mode")); + upsMap.put(history.getUpsId(),(Long) map.get("time")); + return history; + } + + +} diff --git a/src/main/java/com/ruoyi/project/hit/util/webSocket/WebSocketConfig.java b/src/main/java/com/ruoyi/project/hit/util/webSocket/WebSocketConfig.java new file mode 100644 index 0000000..0df0b2c --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/util/webSocket/WebSocketConfig.java @@ -0,0 +1,16 @@ +package com.ruoyi.project.hit.util.webSocket; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.config.annotation.EnableWebSocket; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +@Configuration +@EnableWebSocket +public class WebSocketConfig { + @Bean + public ServerEndpointExporter serverEndpoint() { + return new ServerEndpointExporter(); + } + +} diff --git a/src/main/java/com/ruoyi/project/hit/util/webSocket/WsServerEndpoint.java b/src/main/java/com/ruoyi/project/hit/util/webSocket/WsServerEndpoint.java new file mode 100644 index 0000000..cf59fee --- /dev/null +++ b/src/main/java/com/ruoyi/project/hit/util/webSocket/WsServerEndpoint.java @@ -0,0 +1,99 @@ +package com.ruoyi.project.hit.util.webSocket; + +import com.alibaba.fastjson.JSONObject; + + +import org.springframework.stereotype.Component; + +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.time.Instant; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +@ServerEndpoint("/echo/{id}") +@Component +public class WsServerEndpoint { + public static Map wsServerEndpointMap = new ConcurrentHashMap<>(); + + private Session session; + + private String id; + // 收到消息 + @OnMessage + public void onMessage(String message) throws Exception { + JSONObject jsonObject = JSONObject.parseObject(message); + String id= (String) jsonObject.get("id"); + String msg=(String) jsonObject.get("msg"); + + if (message.equalsIgnoreCase("bye")) { + // 由服务器主动关闭连接。状态码为 NORMAL_CLOSURE(正常关闭)。 + this.session.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, "Bye"));; + return; + } + if(id!=null) + { + if("-1".equals(id)) + { + sendAllUser("1"); + } + else { + sendToUser(id, msg); + } + } + +// this.session.getAsyncRemote().sendText("["+ Instant.now().toEpochMilli() +"] Hello " + message); + } + + // 连接打开 + @OnOpen + public void onOpen(@PathParam(value = "id") String id, Session session, EndpointConfig endpointConfig){ + System.out.println("开启连接"); + // 保存 session 到对象 + this.session = session; + this.id = id; + wsServerEndpointMap.put(id,this); + System.out.println(wsServerEndpointMap.toString()); + } + + // 连接关闭 + @OnClose + public void onClose(CloseReason closeReason){ + wsServerEndpointMap.remove(this); + System.out.println("断开连接"); + } + + // 连接异常 + @OnError + public void onError(Throwable throwable) throws IOException { + System.out.println(throwable); + // 关闭连接。状态码为 UNEXPECTED_CONDITION(意料之外的异常) + this.session.close(new CloseReason(CloseReason.CloseCodes.UNEXPECTED_CONDITION, throwable.getMessage())); + } + + public void sendMessage(String message) throws Exception { + this.session.getAsyncRemote().sendText(message); + } + public void sendToUser(String id, String message) throws Exception { + if(wsServerEndpointMap.containsKey(id)){ + wsServerEndpointMap.get(id).session.getAsyncRemote().sendText(message); + } + } + public void sendAllUser(String message) throws Exception{ + for (String s : wsServerEndpointMap.keySet()) { + wsServerEndpointMap.get(s).sendMessage(message); + } + } + + public static void main(String[] args) { + System.out.println(wsServerEndpointMap.toString()); + try { + wsServerEndpointMap.get("1").sendMessage("000"); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/com/ruoyi/project/uniapp/controller/BonusController.java b/src/main/java/com/ruoyi/project/uniapp/controller/BonusController.java deleted file mode 100644 index 21a9992..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/controller/BonusController.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.ruoyi.project.uniapp.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.domain.CardGame; -import com.ruoyi.project.hit.domain.CardUser; -import com.ruoyi.project.hit.service.CardGameService; -import com.ruoyi.project.hit.service.CardUserHitService; -import com.ruoyi.project.hit.service.CardUserService; -import com.ruoyi.project.uniapp.controller.vo.CardUserGameVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import javax.xml.crypto.Data; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -@EnableScheduling -@RestController -@RequestMapping("/uniapp/bonus") -public class BonusController extends BaseController { - @Autowired - private CardUserService cardUserService; - @Autowired - private CardGameService cardGameService; - @Autowired - private CardUserHitService cardUserHitService; - - - - @GetMapping("/showAllCardGame") - public TableDataInfo showAllCardGame(){ - startPage(); - List list = cardGameService.showAllCardGame(); - return getDataTable(list); - } - - /** - * 活动详情 - * @param gameId - * @return - */ - @PostMapping("/getGameDetail/{gameId}") - public AjaxResult getGameDetail(@PathVariable(value = "gameId")Integer gameId){ - return AjaxResult.success(cardGameService.getGameDetail(gameId)); - } - - /** - * 抽奖业务 - * @param cardUserGameVo - * @return - */ - @PostMapping("/getPrizeDraw") - public AjaxResult getPrizeDraw(@RequestBody CardUserGameVo cardUserGameVo){ - return AjaxResult.success(cardUserHitService.getPrizeDraw(cardUserGameVo)); - } - - /** - * 活动预热 - */ - @Scheduled(fixedRate = 60000) - public void preHot(){ - Date now=new Date(); - cardGameService.preHot(now); - } - - -} diff --git a/src/main/java/com/ruoyi/project/uniapp/controller/HomePageController.java b/src/main/java/com/ruoyi/project/uniapp/controller/HomePageController.java deleted file mode 100644 index 207d8ee..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/controller/HomePageController.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.ruoyi.project.uniapp.controller; - -import com.ruoyi.framework.web.controller.BaseController; -import com.ruoyi.framework.web.domain.AjaxResult; -import com.ruoyi.project.hit.domain.CardGame; -import com.ruoyi.project.hit.service.CardGameService; -import com.ruoyi.project.hit.service.CardSaleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/uniapp/homePage") -public class HomePageController extends BaseController { - - @Autowired - private CardGameService cardGameService; - @Autowired - private CardSaleService cardSaleService; - /** - * 主页轮播图 - * @return - */ - @GetMapping("/carousel") - public AjaxResult carousel(){ - List carousel = cardGameService.carousel(); - return AjaxResult.success(carousel); - } - - /** - * 热度榜单 - * @return - */ - @GetMapping("/getHotSale") - public AjaxResult getHotSale(){ - return AjaxResult.success(cardSaleService.getHotSale()); - } - - @GetMapping("/getAllHotSale") - public AjaxResult getAllHotSale(){ - return AjaxResult.success(cardSaleService.getAllHotSale()); - } - - /** - * 点击(热度增加) - * @param id - * @return - */ - @PostMapping("/addHotSaleNum/{saleId}") - public AjaxResult addHotSaleNum(@PathVariable(value = "saleId")Integer id){ - cardSaleService.addHotSaleNum(id); - return AjaxResult.success(); - } - - - -} diff --git a/src/main/java/com/ruoyi/project/uniapp/controller/PersonalCenterController.java b/src/main/java/com/ruoyi/project/uniapp/controller/PersonalCenterController.java deleted file mode 100644 index d213cad..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/controller/PersonalCenterController.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ruoyi.project.uniapp.controller; - -import com.ruoyi.framework.web.controller.BaseController; -import com.ruoyi.framework.web.domain.AjaxResult; -import com.ruoyi.project.hit.domain.CardUser; -import com.ruoyi.project.hit.service.CardUserHitService; -import com.ruoyi.project.hit.service.CardUserService; -import com.ruoyi.project.uniapp.controller.vo.CardUserVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; -import java.util.List; - -@RestController -@RequestMapping("/uniapp/personalCenter") -public class PersonalCenterController extends BaseController { - - @Autowired - private CardUserService cardUserService; - @Autowired - private CardUserHitService cardUserHitService; - - @PostMapping("/login") - public AjaxResult login(@RequestBody @Valid CardUserVo cardUser){ - CardUser user = cardUserService.login(cardUser.getUserName(), cardUser.getUserPass()); - return AjaxResult.success("登录成功",user); - } - - @PostMapping("/addCardUser") - public AjaxResult addCardUser(@Valid @RequestBody CardUser cardUser){ - return toAjax(cardUserService.addCardUser(cardUser)); - } - - @GetMapping("/winnerRecord/{userId}") - public AjaxResult getMyWinnerRecord(@PathVariable(value = "userId")Integer userId){ - return AjaxResult.success(cardUserHitService.winnerRecord(userId)); - } -} diff --git a/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardProductVo.java b/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardProductVo.java deleted file mode 100644 index 63739bc..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardProductVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ruoyi.project.uniapp.controller.vo; - -import com.alibaba.excel.annotation.ExcelIgnore; -import com.alibaba.excel.annotation.ExcelProperty; -import com.alibaba.excel.annotation.format.NumberFormat; -import com.alibaba.excel.annotation.write.style.ColumnWidth; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; - -import java.math.BigDecimal; - -@Data -public class CardProductVo { - @TableId(type = IdType.AUTO) - private Integer id; - - private String pname; - - private String pic; - - private String content; - - private BigDecimal price; - - private Integer delState; - - private Integer amount; -} diff --git a/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserGameVo.java b/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserGameVo.java deleted file mode 100644 index aaf89f1..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserGameVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ruoyi.project.uniapp.controller.vo; - -import lombok.Data; - -import javax.validation.constraints.NotNull; - -@Data -public class CardUserGameVo { - @NotNull(message = "用户id不能为空") - private Integer userId; - @NotNull(message = "活动id不能为空") - private Integer gameId; -} diff --git a/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserVo.java b/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserVo.java deleted file mode 100644 index 303c23b..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/controller/vo/CardUserVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ruoyi.project.uniapp.controller.vo; - -import lombok.Data; - -import javax.validation.constraints.NotEmpty; - -@Data -public class CardUserVo { - @NotEmpty(message = "账号不能为空") - private String userName; - - @NotEmpty(message = "密码不能为空") - private String userPass; -} diff --git a/src/main/java/com/ruoyi/project/uniapp/mq/Consumer01.java b/src/main/java/com/ruoyi/project/uniapp/mq/Consumer01.java deleted file mode 100644 index 9296fe1..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/mq/Consumer01.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ruoyi.project.uniapp.mq; - -import com.alibaba.fastjson.JSON; -import com.ruoyi.project.hit.domain.CardGameUser; -import com.ruoyi.project.hit.service.CardGameUserService; -import org.springframework.amqp.rabbit.annotation.RabbitHandler; -import org.springframework.amqp.rabbit.annotation.RabbitListener; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@RabbitListener(queues = "drawRecord") -@Component -public class Consumer01 { - @Resource - private CardGameUserService cardGameUserService; - - @RabbitHandler - public void addCardGameUser(String cardGameUserStr){ - CardGameUser cardGameUser= JSON.parseObject(cardGameUserStr,CardGameUser.class); - cardGameUserService.addCardGameUser(cardGameUser); - } -} diff --git a/src/main/java/com/ruoyi/project/uniapp/mq/Consumer02.java b/src/main/java/com/ruoyi/project/uniapp/mq/Consumer02.java deleted file mode 100644 index bd351d0..0000000 --- a/src/main/java/com/ruoyi/project/uniapp/mq/Consumer02.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ruoyi.project.uniapp.mq; - -import com.alibaba.fastjson.JSON; -import com.ruoyi.project.hit.domain.CardUserHit; -import com.ruoyi.project.hit.service.CardUserHitService; -import org.springframework.amqp.rabbit.annotation.RabbitHandler; -import org.springframework.amqp.rabbit.annotation.RabbitListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@RabbitListener(queues = "winnerRecord") -@Component -public class Consumer02 { - @Autowired - private CardUserHitService cardUserHitService; - @RabbitHandler - public void addCardUserHit(String cardUserHitStr){ - CardUserHit cardUserHit= JSON.parseObject(cardUserHitStr,CardUserHit.class); - cardUserHitService.addCardUserHit(cardUserHit); - } -} diff --git a/src/main/resources/application-druid.yml b/src/main/resources/application-druid.yml index 5ead43c..22cdd6e 100644 --- a/src/main/resources/application-druid.yml +++ b/src/main/resources/application-druid.yml @@ -10,7 +10,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://localhost:3306/his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: 123456 # 从库数据源 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 404d436..efb5bb7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -83,6 +83,10 @@ spring: password: guest username: guest port: 5672 + task: + scheduling: + pool: + size: 10 # token配置 token: diff --git a/src/main/resources/mybatis/hit/CardGameMapper.xml b/src/main/resources/mybatis/hit/CardGameMapper.xml deleted file mode 100644 index 773269a..0000000 --- a/src/main/resources/mybatis/hit/CardGameMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - id,title,pic, - content,start_time,end_time, - type,status,create_time, - update_time - - - - - - - - diff --git a/src/main/resources/mybatis/hit/CardGameProductMapper.xml b/src/main/resources/mybatis/hit/CardGameProductMapper.xml deleted file mode 100644 index 5dd85d8..0000000 --- a/src/main/resources/mybatis/hit/CardGameProductMapper.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - id,gameid,productid, - amount - - - - - - diff --git a/src/main/resources/mybatis/hit/CardGameRuleMapper.xml b/src/main/resources/mybatis/hit/CardGameRuleMapper.xml deleted file mode 100644 index ce30f4f..0000000 --- a/src/main/resources/mybatis/hit/CardGameRuleMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - id,gameid,levelid, - enter_count,hit_count - - - - - diff --git a/src/main/resources/mybatis/hit/CardGameUserMapper.xml b/src/main/resources/mybatis/hit/CardGameUserMapper.xml deleted file mode 100644 index 1d31b05..0000000 --- a/src/main/resources/mybatis/hit/CardGameUserMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - id,userid,gameid, - createtime - - diff --git a/src/main/resources/mybatis/hit/CardProductMapper.xml b/src/main/resources/mybatis/hit/CardProductMapper.xml deleted file mode 100644 index 3e6016e..0000000 --- a/src/main/resources/mybatis/hit/CardProductMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - id,pname,pic, - content,price,del_state - - diff --git a/src/main/resources/mybatis/hit/CardUserHitMapper.xml b/src/main/resources/mybatis/hit/CardUserHitMapper.xml deleted file mode 100644 index 99fbd71..0000000 --- a/src/main/resources/mybatis/hit/CardUserHitMapper.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - id,gameid,userid, - productid,hittime - - - - - - - - - diff --git a/src/main/resources/mybatis/hit/CardUserMapper.xml b/src/main/resources/mybatis/hit/CardUserMapper.xml deleted file mode 100644 index 7de98c0..0000000 --- a/src/main/resources/mybatis/hit/CardUserMapper.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - id - ,user_name,user_pass, - pic,realname,id_card, - phone,level,create_time, - update_time,del_state,remark - - - - diff --git a/src/main/resources/mybatis/hit/PupuUpsHistoryMapper.xml b/src/main/resources/mybatis/hit/PupuUpsHistoryMapper.xml new file mode 100644 index 0000000..a2f87fe --- /dev/null +++ b/src/main/resources/mybatis/hit/PupuUpsHistoryMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + id,ups_id,identifier, + time,value,data_type, + name,access_mode + + diff --git a/src/main/resources/mybatis/hit/PupuUserMapper.xml b/src/main/resources/mybatis/hit/PupuUserMapper.xml new file mode 100644 index 0000000..df37c47 --- /dev/null +++ b/src/main/resources/mybatis/hit/PupuUserMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + user_id,user_name,password, + gender,pic,status + + diff --git a/src/main/resources/mybatis/hit/SystemDictMapper.xml b/src/main/resources/mybatis/hit/SystemDictMapper.xml deleted file mode 100644 index 493fc67..0000000 --- a/src/main/resources/mybatis/hit/SystemDictMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - id,dict_type,dict_key, - dict_value,del_state,create_time, - update_time - -