作者 钟来

问卷调查添加手机号

@@ -18,7 +18,26 @@ public class SysMonitorServer extends BaseEntity { @@ -18,7 +18,26 @@ public class SysMonitorServer extends BaseEntity {
18 private Integer connection_count; 18 private Integer connection_count;
19 @ApiModelProperty("创建时间") 19 @ApiModelProperty("创建时间")
20 private Long create_time; 20 private Long create_time;
  21 + @ApiModelProperty("内存信息")
  22 + private String memory_info;
  23 + @ApiModelProperty("cpu信息")
  24 + private String cpu_info;
21 25
  26 + public String getMemory_info() {
  27 + return memory_info;
  28 + }
  29 +
  30 + public void setMemory_info(String memory_info) {
  31 + this.memory_info = memory_info;
  32 + }
  33 +
  34 + public String getCpu_info() {
  35 + return cpu_info;
  36 + }
  37 +
  38 + public void setCpu_info(String cpu_info) {
  39 + this.cpu_info = cpu_info;
  40 + }
22 public String getIp() { 41 public String getIp() {
23 return ip; 42 return ip;
24 } 43 }
@@ -19,7 +19,26 @@ public class SysMonitorServerLog { @@ -19,7 +19,26 @@ public class SysMonitorServerLog {
19 private Integer connection_count; 19 private Integer connection_count;
20 @ApiModelProperty("创建时间") 20 @ApiModelProperty("创建时间")
21 private Long create_time; 21 private Long create_time;
  22 + @ApiModelProperty("内存信息")
  23 + private String memory_info;
  24 + @ApiModelProperty("cpu信息")
  25 + private String cpu_info;
22 26
  27 + public String getMemory_info() {
  28 + return memory_info;
  29 + }
  30 +
  31 + public void setMemory_info(String memory_info) {
  32 + this.memory_info = memory_info;
  33 + }
  34 +
  35 + public String getCpu_info() {
  36 + return cpu_info;
  37 + }
  38 +
  39 + public void setCpu_info(String cpu_info) {
  40 + this.cpu_info = cpu_info;
  41 + }
23 public Integer getId() { 42 public Integer getId() {
24 return id; 43 return id;
25 } 44 }
1 package com.zhonglai.luhui.order.service.controller; 1 package com.zhonglai.luhui.order.service.controller;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +import javax.servlet.http.HttpServletRequest;
4 import javax.servlet.http.HttpServletResponse; 5 import javax.servlet.http.HttpServletResponse;
5 6
  7 +import com.ruoyi.common.utils.DESUtil;
6 import com.ruoyi.common.utils.DateUtils; 8 import com.ruoyi.common.utils.DateUtils;
  9 +import com.ruoyi.common.utils.StringUtils;
7 import io.swagger.annotations.Api; 10 import io.swagger.annotations.Api;
8 import io.swagger.annotations.ApiOperation; 11 import io.swagger.annotations.ApiOperation;
9 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +39,7 @@ public class ContentGroupManagementController extends BaseController @@ -36,7 +39,7 @@ public class ContentGroupManagementController extends BaseController
36 { 39 {
37 @Autowired 40 @Autowired
38 private IContentGroupManagementService contentGroupManagementService; 41 private IContentGroupManagementService contentGroupManagementService;
39 - 42 + public static String ENCODE_KEY = "com/zhonglai";
40 /** 43 /**
41 * 查询分组内容管理列表 44 * 查询分组内容管理列表
42 */ 45 */
@@ -65,9 +68,34 @@ public class ContentGroupManagementController extends BaseController @@ -65,9 +68,34 @@ public class ContentGroupManagementController extends BaseController
65 @ApiOperation("新增分组内容管理") 68 @ApiOperation("新增分组内容管理")
66 @Log(title = "分组内容管理", businessType = BusinessType.INSERT) 69 @Log(title = "分组内容管理", businessType = BusinessType.INSERT)
67 @PostMapping 70 @PostMapping
68 - public AjaxResult add(@RequestBody ContentGroupManagement contentGroupManagement) 71 + public AjaxResult add(@RequestBody ContentGroupManagement contentGroupManagement, HttpServletRequest httpServletRequest)
69 { 72 {
  73 + if(StringUtils.isNoneBlank(contentGroupManagement.getPhone()))
  74 + {
  75 + String key = httpServletRequest.getHeader("key");
  76 + String code = httpServletRequest.getParameter("code");
  77 + if(org.apache.commons.lang3.StringUtils.isBlank(key) || key.equals("undefined"))
  78 + {
  79 + return AjaxResult.error("请求密钥错误");
  80 + }
70 81
  82 + String[] keys = DESUtil.decode(key, ENCODE_KEY).split("_");
  83 + Integer time = Integer.parseInt(keys[2]);
  84 + if((DateUtils.getNowTimeMilly()-time)>5*60)
  85 + {
  86 + return AjaxResult.success("验证码超时");
  87 + }
  88 + //code
  89 + if(!keys[0].equals(code))
  90 + {
  91 + return AjaxResult.success("验证码错误");
  92 + }
  93 + //phone
  94 + if(!keys[1].equals(contentGroupManagement.getPhone()))
  95 + {
  96 + return AjaxResult.success("手机号不一致");
  97 + }
  98 + }
71 contentGroupManagement.setCreate_time(DateUtils.getNowTimeMilly()); 99 contentGroupManagement.setCreate_time(DateUtils.getNowTimeMilly());
72 contentGroupManagement.setUpdate_time(contentGroupManagement.getCreate_time()); 100 contentGroupManagement.setUpdate_time(contentGroupManagement.getCreate_time());
73 return toAjax(contentGroupManagementService.insertContentGroupManagement(contentGroupManagement)); 101 return toAjax(contentGroupManagementService.insertContentGroupManagement(contentGroupManagement));
@@ -43,6 +43,17 @@ public class ContentGroupManagement extends BaseEntity @@ -43,6 +43,17 @@ public class ContentGroupManagement extends BaseEntity
43 @ApiModelProperty("更新时间") 43 @ApiModelProperty("更新时间")
44 private Integer update_time; 44 private Integer update_time;
45 45
  46 + @ApiModelProperty("手机号(如何不为空就需求校验)")
  47 + private String phone;
  48 +
  49 + public String getPhone() {
  50 + return phone;
  51 + }
  52 +
  53 + public void setPhone(String phone) {
  54 + this.phone = phone;
  55 + }
  56 +
46 public Integer getUpdate_time() { 57 public Integer getUpdate_time() {
47 return update_time; 58 return update_time;
48 } 59 }