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