实现检测脚本查询、删除、升级为模板,检测相关配置
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.njcn.gather.system.auth.filter;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.constant.SecurityConstants;
|
||||
import com.njcn.common.utils.JwtUtil;
|
||||
import com.njcn.gather.system.pojo.constant.SystemValidMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2024/11/18
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AuthGlobalFilter implements Filter, Ordered {
|
||||
private final static List<String> IGNORE_URI = Arrays.asList("/admin/login");
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
|
||||
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpServletResponse res = (HttpServletResponse) response;
|
||||
|
||||
//设置允许跨域的配置
|
||||
// 这里填写允许进行跨域的主机ip(正式上线时可以动态配置具体允许的域名和IP)
|
||||
//rep.setHeader("Access-Control-Allow-Origin", "*");
|
||||
// 允许的访问方法
|
||||
//rep.setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, OPTIONS, DELETE, PATCH");
|
||||
// Access-Control-Max-Age 用于 CORS 相关配置的缓存
|
||||
//rep.setHeader("Access-Control-Max-Age", "3600");
|
||||
//rep.setHeader("Access-Control-Allow-Headers", "token,Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
|
||||
res.setCharacterEncoding("UTF-8");
|
||||
res.setContentType("application/json; charset=utf-8");
|
||||
|
||||
String requestURI = req.getRequestURI();
|
||||
if (IGNORE_URI.contains(requestURI)) {
|
||||
filterChain.doFilter(req, res);
|
||||
} else {
|
||||
String tokenStr = req.getHeader(SecurityConstants.AUTHORIZATION_KEY);
|
||||
if (StrUtil.isNotBlank(tokenStr)) {
|
||||
tokenStr = tokenStr.replace(SecurityConstants.AUTHORIZATION_PREFIX, Strings.EMPTY);
|
||||
}
|
||||
if (StrUtil.isBlank(tokenStr) || !JwtUtil.verifyToken(tokenStr) || JwtUtil.isExpired(tokenStr)) {
|
||||
res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
res.getWriter().write(SystemValidMessage.TOKEN_VALID_ERROR);
|
||||
res.sendRedirect("/admin/login");
|
||||
} else {
|
||||
filterChain.doFilter(req, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.gather.system.config.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.gather.system.config.pojo.param.SysTestConfigParam;
|
||||
import com.njcn.gather.system.config.pojo.po.SysTestConfig;
|
||||
import com.njcn.gather.system.config.service.ISysTestConfigService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-16
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "检测相关配置")
|
||||
@RestController
|
||||
@RequestMapping("/sysTestConfig")
|
||||
@RequiredArgsConstructor
|
||||
public class SysTestConfigController extends BaseController {
|
||||
private final ISysTestConfigService sysTestConfigService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getConfig")
|
||||
@ApiOperation("获取检测相关配置信息")
|
||||
public HttpResult<SysTestConfig> getConfig() {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
SysTestConfig sysTestConfig = sysTestConfigService.getConfig();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sysTestConfig, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增检测相关配置信息")
|
||||
@ApiImplicitParam(name = "sysTestConfig", value = "检测相关配置信息", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated SysTestConfigParam param) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
boolean result = sysTestConfigService.addTestConfig(param);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改检测相关配置信息")
|
||||
@ApiImplicitParam(name = "sysTestConfig", value = "检测相关配置信息", required = true)
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated SysTestConfigParam.UpdateParam sysTestConfig) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe);
|
||||
boolean result = sysTestConfigService.updateTestConfig(sysTestConfig);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.gather.system.config.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.njcn.gather.system.config.pojo.po.SysTestConfig;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-16
|
||||
*/
|
||||
public interface SysTestConfigMapper extends MPJBaseMapper<SysTestConfig> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.gather.system.config.mapper.SysTestConfigMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.gather.system.config.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.gather.system.pojo.constant.SystemValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2024/11/16
|
||||
*/
|
||||
@Data
|
||||
public class SysTestConfigParam {
|
||||
|
||||
@ApiModelProperty(value = "检测报告是否自动生成0 否;1是")
|
||||
@NotNull(message = SystemValidMessage.AUTO_GENERATE_NOT_NULL)
|
||||
@Min(value = 0, message = SystemValidMessage.AUTO_GENERATE_FORMAT_ERROR)
|
||||
@Max(value = 1, message = SystemValidMessage.AUTO_GENERATE_FORMAT_ERROR)
|
||||
private Integer autoGenerate;
|
||||
|
||||
@ApiModelProperty(value = "最大复检次数")
|
||||
@NotNull(message = SystemValidMessage.MAX_RECHECK_NOT_NULL)
|
||||
private Integer maxTime;
|
||||
|
||||
@ApiModelProperty(value = "数据处理规则")
|
||||
@NotBlank(message = SystemValidMessage.DATA_RULE_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = SystemValidMessage.DATA_RULE_FORMAT_ERROR)
|
||||
private String dataRule;
|
||||
|
||||
@Data
|
||||
public static class UpdateParam extends SysTestConfigParam {
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = SystemValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = SystemValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.gather.system.config.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_test_config")
|
||||
public class SysTestConfig extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 352471858515754310L;
|
||||
/**
|
||||
* 系统配置表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 检测报告是否自动生成: 0 否;1 是
|
||||
*/
|
||||
@TableField("Auto_Generate")
|
||||
private Integer autoGenerate;
|
||||
|
||||
/**
|
||||
* 最大复检次数,默认3次
|
||||
*/
|
||||
@TableField("Max_Time")
|
||||
private Integer maxTime;
|
||||
|
||||
/**
|
||||
* 数据处理规则, 关联字典(所有值、部分值、cp95值、平均值、任意值),默认任意值
|
||||
*/
|
||||
@TableField("Data_Rule")
|
||||
private String dataRule;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.gather.system.config.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.system.config.pojo.param.SysTestConfigParam;
|
||||
import com.njcn.gather.system.config.pojo.po.SysTestConfig;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-16
|
||||
*/
|
||||
public interface ISysTestConfigService extends IService<SysTestConfig> {
|
||||
|
||||
/**
|
||||
* 获取检测配置
|
||||
* @return
|
||||
*/
|
||||
SysTestConfig getConfig();
|
||||
|
||||
/**
|
||||
* 添加检测配置
|
||||
* @param param 检测配置
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
boolean addTestConfig(SysTestConfigParam param);
|
||||
|
||||
/**
|
||||
* 更新检测配置
|
||||
* @param param 检测配置
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
boolean updateTestConfig(SysTestConfigParam.UpdateParam param);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.gather.system.config.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.gather.system.config.mapper.SysTestConfigMapper;
|
||||
import com.njcn.gather.system.config.pojo.param.SysTestConfigParam;
|
||||
import com.njcn.gather.system.config.pojo.po.SysTestConfig;
|
||||
import com.njcn.gather.system.config.service.ISysTestConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-16
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysTestConfigServiceImpl extends ServiceImpl<SysTestConfigMapper, SysTestConfig> implements ISysTestConfigService {
|
||||
|
||||
@Override
|
||||
public SysTestConfig getConfig() {
|
||||
return this.getOne(new QueryWrapper<SysTestConfig>().last("LIMIT 1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addTestConfig(SysTestConfigParam param) {
|
||||
SysTestConfig sysTestConfig = new SysTestConfig();
|
||||
BeanUtils.copyProperties(param, sysTestConfig);
|
||||
sysTestConfig.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(sysTestConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTestConfig(SysTestConfigParam.UpdateParam param) {
|
||||
SysTestConfig sysTestConfig = new SysTestConfig();
|
||||
BeanUtils.copyProperties(param, sysTestConfig);
|
||||
return this.updateById(sysTestConfig);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.njcn.gather.system.reg.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.gather.system.reg.pojo.param.SysRegResParam;
|
||||
import com.njcn.gather.system.reg.pojo.po.SysRegRes;
|
||||
import com.njcn.gather.system.reg.service.ISysRegResService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "注册版本管理")
|
||||
@RestController
|
||||
@RequestMapping("/sysRegRes")
|
||||
@RequiredArgsConstructor
|
||||
public class SysRegResController extends BaseController {
|
||||
private final ISysRegResService sysRegResService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getRegResByType")
|
||||
@ApiOperation("根据类型id查询配置")
|
||||
@ApiImplicitParam(name = "type", value = "类型id,字典值", required = true)
|
||||
public HttpResult<SysRegRes> getRegResByType(@RequestParam("id") String typeId) {
|
||||
String methodDescribe = getMethodDescribe("listByTypeId");
|
||||
LogUtil.njcnDebug(log, "{},查询参数为:{}", methodDescribe, typeId);
|
||||
SysRegRes result = sysRegResService.getRegResByType(typeId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增注册版本")
|
||||
@ApiImplicitParam(name = "sysRegRes", value = "注册版本对象", required = true)
|
||||
public HttpResult<String> addRegRes(@RequestParam @Validated SysRegResParam param) {
|
||||
String methodDescribe = getMethodDescribe("addRegRes");
|
||||
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, param);
|
||||
boolean result = sysRegResService.addRegRes(param);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改配置")
|
||||
@ApiImplicitParam(name = "param", value = "注册版本更新对象", required = true)
|
||||
public HttpResult<String> updateRegRes(@RequestBody @Validated SysRegResParam.UpdateParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateRegRes");
|
||||
LogUtil.njcnDebug(log, "{},更新参数为:{}", methodDescribe, param);
|
||||
boolean result = sysRegResService.updateRegRes(param);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.gather.system.reg.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.njcn.gather.system.reg.pojo.po.SysRegRes;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface SysRegResMapper extends MPJBaseMapper<SysRegRes> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.gather.system.reg.mapper.SysRegResMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.gather.system.reg.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.gather.system.pojo.constant.SystemValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2024-11-21
|
||||
*/
|
||||
@Data
|
||||
public class SysRegResParam {
|
||||
|
||||
@ApiModelProperty("版本类型")
|
||||
@NotBlank(message = SystemValidMessage.TYPE_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = SystemValidMessage.ID_FORMAT_ERROR)
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("注册码")
|
||||
@NotBlank(message = SystemValidMessage.CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("密钥")
|
||||
private String licenseKey;
|
||||
|
||||
@Data
|
||||
public static class UpdateParam {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = SystemValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = SystemValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("录波数据有效组数")
|
||||
private Integer waveRecord;
|
||||
|
||||
@ApiModelProperty("实时数据有效组数")
|
||||
private Integer realTime;
|
||||
|
||||
@ApiModelProperty("统计数据有效组数")
|
||||
private Integer statistics;
|
||||
|
||||
@ApiModelProperty("短闪数据有效组数")
|
||||
private Integer flicker;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.gather.system.reg.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_reg_res")
|
||||
public class SysRegRes extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 801772692898301698L;
|
||||
/**
|
||||
* 版本注册表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 版本类型(模拟式、数字式、比对式)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 注册码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 密钥
|
||||
*/
|
||||
private String licenseKey;
|
||||
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
private LocalDate expireDate;
|
||||
|
||||
/**
|
||||
* 录波数据有效组数
|
||||
*/
|
||||
private Integer waveRecord;
|
||||
|
||||
/**
|
||||
* 实时数据有效组数
|
||||
*/
|
||||
private Integer realTime;
|
||||
|
||||
/**
|
||||
* 统计数据有效组数
|
||||
*/
|
||||
private Integer statistics;
|
||||
|
||||
/**
|
||||
* 短闪数据有效组数
|
||||
*/
|
||||
private Integer flicker;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.gather.system.reg.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.system.reg.pojo.param.SysRegResParam;
|
||||
import com.njcn.gather.system.reg.pojo.po.SysRegRes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface ISysRegResService extends IService<SysRegRes> {
|
||||
/**
|
||||
* 查询版本注册表
|
||||
* @return
|
||||
*/
|
||||
SysRegRes getRegResByType(String type);
|
||||
|
||||
/**
|
||||
* 新增版本注册表
|
||||
* @param sysRegResParam 版本注册表参数
|
||||
* @return 成功返回true,失败返回false
|
||||
*/
|
||||
boolean addRegRes(SysRegResParam sysRegResParam);
|
||||
|
||||
/**
|
||||
* 修改配置
|
||||
* @param param
|
||||
* @return 成功返回true,失败返回false
|
||||
*/
|
||||
boolean updateRegRes(SysRegResParam.UpdateParam param);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.gather.system.reg.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.gather.system.reg.mapper.SysRegResMapper;
|
||||
import com.njcn.gather.system.reg.pojo.param.SysRegResParam;
|
||||
import com.njcn.gather.system.reg.pojo.po.SysRegRes;
|
||||
import com.njcn.gather.system.reg.service.ISysRegResService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysRegResServiceImpl extends ServiceImpl<SysRegResMapper, SysRegRes> implements ISysRegResService {
|
||||
|
||||
@Override
|
||||
public SysRegRes getRegResByType(String type) {
|
||||
return this.lambdaQuery().eq(SysRegRes::getType, type).eq(SysRegRes::getState, DataStateEnum.ENABLE.getCode()).one();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addRegRes(SysRegResParam sysRegResParam) {
|
||||
SysRegRes sysRegRes = new SysRegRes();
|
||||
BeanUtil.copyProperties(sysRegResParam, sysRegRes);
|
||||
sysRegRes.setState(DataStateEnum.ENABLE.getCode());
|
||||
// todo 到期时间处理
|
||||
return this.save(sysRegRes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateRegRes(SysRegResParam.UpdateParam param) {
|
||||
SysRegRes sysRegRes = new SysRegRes();
|
||||
BeanUtil.copyProperties(param, sysRegRes);
|
||||
if (sysRegRes.getWaveRecord() == -1) {
|
||||
sysRegRes.setWaveRecord(null);
|
||||
}
|
||||
return this.updateById(sysRegRes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.njcn.gather.user.user.pojo.vo;
|
||||
|
||||
import com.njcn.gather.user.user.pojo.po.SysFunction;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MenuVO extends SysFunction {
|
||||
|
||||
private String redirect;
|
||||
|
||||
private MetaVO meta;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.gather.user.user.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetaVO {
|
||||
|
||||
/**
|
||||
* 菜单和面包屑对应的图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 路由标题 (用作 document.title || 菜单的名称)
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 路由外链时填写的访问地址
|
||||
*/
|
||||
@JsonProperty("isLink")
|
||||
private String isLink;
|
||||
|
||||
/**
|
||||
* 是否在菜单中隐藏 (通常列表详情页需要隐藏)
|
||||
*/
|
||||
@JsonProperty("isHide")
|
||||
private boolean isHide;
|
||||
|
||||
/**
|
||||
* 菜单是否全屏 (示例:数据大屏页面)
|
||||
*/
|
||||
@JsonProperty("isFull")
|
||||
private boolean isFull;
|
||||
|
||||
/**
|
||||
* 菜单是否固定在标签页中 (首页通常是固定项)
|
||||
*/
|
||||
@JsonProperty("isAffix")
|
||||
private boolean isAffix;
|
||||
|
||||
/**
|
||||
* 当前路由是否缓存
|
||||
*/
|
||||
@JsonProperty("isKeepAlive")
|
||||
private boolean isKeepAlive;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user