菜单管理模块新增modulesUrl字段
This commit is contained in:
@@ -50,6 +50,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
"/api/open/**",
|
"/api/open/**",
|
||||||
"/hxz/v1/**",
|
"/hxz/v1/**",
|
||||||
"/api/sendSmsCaptcha",
|
"/api/sendSmsCaptcha",
|
||||||
|
"/api/parseToken/*",
|
||||||
"/api/login-alipay/*",
|
"/api/login-alipay/*",
|
||||||
"/api/wx-login/loginByMpWxPhone",
|
"/api/wx-login/loginByMpWxPhone",
|
||||||
"/api/shop/payment/mp-alipay/notify",
|
"/api/shop/payment/mp-alipay/notify",
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
package com.gxwebsoft.common.system.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.EnvironmentService;
|
||||||
|
import com.gxwebsoft.common.system.entity.Environment;
|
||||||
|
import com.gxwebsoft.common.system.param.EnvironmentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境管理控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-18 08:45:13
|
||||||
|
*/
|
||||||
|
@Api(tags = "环境管理管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/system/environment")
|
||||||
|
public class EnvironmentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private EnvironmentService environmentService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("分页查询环境管理")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Environment>> page(EnvironmentParam param) {
|
||||||
|
PageParam<Environment, EnvironmentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(environmentService.page(page, page.getWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(environmentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("查询全部环境管理")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Environment>> list(EnvironmentParam param) {
|
||||||
|
PageParam<Environment, EnvironmentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(environmentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(environmentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询环境管理")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Environment> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(environmentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(environmentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加环境管理")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Environment environment) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
environment.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (environmentService.save(environment)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改环境管理")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Environment environment) {
|
||||||
|
if (environmentService.updateById(environment)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除环境管理")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (environmentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加环境管理")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Environment> list) {
|
||||||
|
if (environmentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改环境管理")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Environment> batchParam) {
|
||||||
|
if (batchParam.update(environmentService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('sys:company:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除环境管理")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (environmentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@ import com.gxwebsoft.common.core.web.ApiResult;
|
|||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.common.core.web.ExistenceParam;
|
import com.gxwebsoft.common.core.web.ExistenceParam;
|
||||||
import com.gxwebsoft.common.system.entity.*;
|
import com.gxwebsoft.common.system.entity.*;
|
||||||
|
import com.gxwebsoft.common.system.mapper.CompanyMapper;
|
||||||
import com.gxwebsoft.common.system.param.LoginParam;
|
import com.gxwebsoft.common.system.param.LoginParam;
|
||||||
import com.gxwebsoft.common.system.param.SmsCaptchaParam;
|
import com.gxwebsoft.common.system.param.SmsCaptchaParam;
|
||||||
import com.gxwebsoft.common.system.param.UpdatePasswordParam;
|
import com.gxwebsoft.common.system.param.UpdatePasswordParam;
|
||||||
@@ -32,8 +33,10 @@ import com.gxwebsoft.common.system.result.CaptchaResult;
|
|||||||
import com.gxwebsoft.common.system.result.LoginResult;
|
import com.gxwebsoft.common.system.result.LoginResult;
|
||||||
import com.gxwebsoft.common.system.service.*;
|
import com.gxwebsoft.common.system.service.*;
|
||||||
import com.wf.captcha.SpecCaptcha;
|
import com.wf.captcha.SpecCaptcha;
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Isolation;
|
import org.springframework.transaction.annotation.Isolation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -261,57 +264,68 @@ public class MainController extends BaseController {
|
|||||||
return success("获取成功", url);
|
return success("获取成功", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("解析token")
|
||||||
|
@GetMapping("/parseToken/{token}")
|
||||||
|
public ApiResult<?> parseToken(@PathVariable("token") String token) {
|
||||||
|
Claims claims = JwtUtil.parseToken(token, configProperties.getTokenKey());
|
||||||
|
return success(claims);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("短信验证码")
|
@ApiOperation("短信验证码")
|
||||||
@PostMapping("/sendSmsCaptcha")
|
@PostMapping("/sendSmsCaptcha")
|
||||||
public ApiResult<?> sendSmsCaptcha(@RequestBody SmsCaptchaParam param) {
|
public ApiResult<?> sendSmsCaptcha(@RequestBody SmsCaptchaParam param) {
|
||||||
// 读取短信配置信息
|
// 默认配置
|
||||||
|
String accessKeyId = "LTAI5tBH45bs2fys3fav";
|
||||||
|
String accessKeySecret = "FpDRt8ejUtuz0fHDkW52";
|
||||||
|
String userTemplateId = "SMS_257840118";
|
||||||
|
String sign = "南宁网宿科技";
|
||||||
|
|
||||||
|
// 读取租户的短信配置
|
||||||
String string = redisUtil.get("setting:sms:5");
|
String string = redisUtil.get("setting:sms:5");
|
||||||
if (string == null) {
|
if (string != null) {
|
||||||
throw new BusinessException("请先配置短信");
|
JSONObject jsonObject = JSONObject.parseObject(string);
|
||||||
|
accessKeyId = jsonObject.getString("accessKeyId");
|
||||||
|
accessKeySecret = jsonObject.getString("accessKeySecret");
|
||||||
|
userTemplateId = jsonObject.getString("userTemplateId");
|
||||||
|
sign = jsonObject.getString("sign");
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = JSONObject.parseObject(string);
|
|
||||||
String accessKeyId = jsonObject.getString("accessKeyId");
|
DefaultProfile profile = DefaultProfile.getProfile("regionld", accessKeyId, accessKeySecret);
|
||||||
String accessKeySecret = jsonObject.getString("accessKeySecret");
|
IAcsClient client = new DefaultAcsClient(profile);
|
||||||
String userTemplateId = jsonObject.getString("userTemplateId");
|
CommonRequest request = new CommonRequest();
|
||||||
String sign = jsonObject.getString("sign");
|
request.setSysMethod(MethodType.POST);
|
||||||
if (accessKeyId != null) {
|
request.setSysDomain("dysmsapi.aliyuncs.com");
|
||||||
DefaultProfile profile = DefaultProfile.getProfile("regionld", accessKeyId, accessKeySecret);
|
request.setSysVersion("2017-05-25");
|
||||||
IAcsClient client = new DefaultAcsClient(profile);
|
request.setSysAction("SendSms");
|
||||||
CommonRequest request = new CommonRequest();
|
request.putQueryParameter("RegionId", "cn-hangzhou");
|
||||||
request.setSysMethod(MethodType.POST);
|
request.putQueryParameter("PhoneNumbers", param.getPhone());
|
||||||
request.setSysDomain("dysmsapi.aliyuncs.com");
|
request.putQueryParameter("SignName", sign);
|
||||||
request.setSysVersion("2017-05-25");
|
request.putQueryParameter("TemplateCode", userTemplateId);
|
||||||
request.setSysAction("SendSms");
|
// 生成短信验证码
|
||||||
request.putQueryParameter("RegionId", "cn-hangzhou");
|
Random randObj = new Random();
|
||||||
request.putQueryParameter("PhoneNumbers", param.getPhone());
|
String code = Integer.toString(100000 + randObj.nextInt(900000));
|
||||||
request.putQueryParameter("SignName", sign);
|
request.putQueryParameter("TemplateParam", "{\"code\":" + code + "}");
|
||||||
request.putQueryParameter("TemplateCode", userTemplateId);
|
try {
|
||||||
// 生成短信验证码
|
CommonResponse response = client.getCommonResponse(request);
|
||||||
Random randObj = new Random();
|
System.out.println("response = " + response);
|
||||||
String code = Integer.toString(100000 + randObj.nextInt(900000));
|
String json = response.getData();
|
||||||
request.putQueryParameter("TemplateParam", "{\"code\":" + code + "}");
|
System.out.println("json = " + json);
|
||||||
try {
|
Gson g = new Gson();
|
||||||
CommonResponse response = client.getCommonResponse(request);
|
HashMap result = g.fromJson(json, HashMap.class);
|
||||||
System.out.println("response = " + response);
|
System.out.println("result = " + result);
|
||||||
String json = response.getData();
|
if ("OK".equals(result.get("Message"))) {
|
||||||
System.out.println("json = " + json);
|
System.out.println("======================== = " + result);
|
||||||
Gson g = new Gson();
|
cacheClient.set(param.getPhone(), code, 5L, TimeUnit.MINUTES);
|
||||||
HashMap result = g.fromJson(json, HashMap.class);
|
String key = "code:" + param.getPhone();
|
||||||
System.out.println("result = " + result);
|
redisUtil.set(key, code, 5L, TimeUnit.MINUTES);
|
||||||
if ("OK".equals(result.get("Message"))) {
|
return success("发送成功", result.get("Message"));
|
||||||
System.out.println("======================== = " + result);
|
} else {
|
||||||
cacheClient.set(param.getPhone(), code, 5L, TimeUnit.MINUTES);
|
return fail("发送失败");
|
||||||
String key = "code:" + param.getPhone();
|
|
||||||
redisUtil.set(key, code, 5L, TimeUnit.MINUTES);
|
|
||||||
return success("发送成功", result.get("Message"));
|
|
||||||
} else {
|
|
||||||
return fail("发送失败");
|
|
||||||
}
|
|
||||||
} catch (ServerException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClientException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
} catch (ServerException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (ClientException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return fail("发送失败");
|
return fail("发送失败");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.gxwebsoft.common.system.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境管理
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-18 08:45:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Environment对象", description = "环境管理")
|
||||||
|
@TableName("sys_environment")
|
||||||
|
public class Environment implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "插件id")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "环境名称")
|
||||||
|
private String environmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "环境编号")
|
||||||
|
private String environmentCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "服务器厂商")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "服务器IP")
|
||||||
|
private String serverIp;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模块访问地址")
|
||||||
|
private String modulesUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模块API")
|
||||||
|
private String modulesApi;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 10待审核 20已通过 30已驳回")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.common.system.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.common.system.entity.Environment;
|
||||||
|
import com.gxwebsoft.common.system.param.EnvironmentParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境管理Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-18 08:45:13
|
||||||
|
*/
|
||||||
|
public interface EnvironmentMapper extends BaseMapper<Environment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Environment>
|
||||||
|
*/
|
||||||
|
List<Environment> selectPageRel(@Param("page") IPage<Environment> page,
|
||||||
|
@Param("param") EnvironmentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Environment> selectListRel(@Param("param") EnvironmentParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<?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.gxwebsoft.common.system.mapper.EnvironmentMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM sys_environment a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.environmentName != null">
|
||||||
|
AND a.environment_name LIKE CONCAT('%', #{param.environmentName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.environmentCode != null">
|
||||||
|
AND a.environment_code LIKE CONCAT('%', #{param.environmentCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.brand != null">
|
||||||
|
AND a.brand LIKE CONCAT('%', #{param.brand}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.serverIp != null">
|
||||||
|
AND a.server_ip LIKE CONCAT('%', #{param.serverIp}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.modulesUrl != null">
|
||||||
|
AND a.modules_url LIKE CONCAT('%', #{param.modulesUrl}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.modulesApi != null">
|
||||||
|
AND a.modules_api LIKE CONCAT('%', #{param.modulesApi}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.Environment">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.Environment">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.gxwebsoft.common.system.param;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境管理查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-18 08:45:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "EnvironmentParam对象", description = "环境管理查询参数")
|
||||||
|
public class EnvironmentParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "插件id")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "环境名称")
|
||||||
|
private String environmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "环境编号")
|
||||||
|
private String environmentCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "服务器厂商")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "服务器IP")
|
||||||
|
private String serverIp;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模块访问地址")
|
||||||
|
private String modulesUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "模块API")
|
||||||
|
private String modulesApi;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 10待审核 20已通过 30已驳回")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.common.system.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.Environment;
|
||||||
|
import com.gxwebsoft.common.system.param.EnvironmentParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境管理Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-18 08:45:13
|
||||||
|
*/
|
||||||
|
public interface EnvironmentService extends IService<Environment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<Environment>
|
||||||
|
*/
|
||||||
|
PageResult<Environment> pageRel(EnvironmentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Environment>
|
||||||
|
*/
|
||||||
|
List<Environment> listRel(EnvironmentParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id 插件id
|
||||||
|
* @return Environment
|
||||||
|
*/
|
||||||
|
Environment getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.common.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.common.system.mapper.EnvironmentMapper;
|
||||||
|
import com.gxwebsoft.common.system.service.EnvironmentService;
|
||||||
|
import com.gxwebsoft.common.system.entity.Environment;
|
||||||
|
import com.gxwebsoft.common.system.param.EnvironmentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境管理Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2023-10-18 08:45:13
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EnvironmentServiceImpl extends ServiceImpl<EnvironmentMapper, Environment> implements EnvironmentService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Environment> pageRel(EnvironmentParam param) {
|
||||||
|
PageParam<Environment, EnvironmentParam> page = new PageParam<>(param);
|
||||||
|
//page.setDefaultOrder("create_time desc");
|
||||||
|
List<Environment> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Environment> listRel(EnvironmentParam param) {
|
||||||
|
List<Environment> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<Environment, EnvironmentParam> page = new PageParam<>();
|
||||||
|
//page.setDefaultOrder("create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Environment getByIdRel(Integer id) {
|
||||||
|
EnvironmentParam param = new EnvironmentParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -55,7 +55,8 @@ public class SysGenerator {
|
|||||||
// "sys_user_referee"
|
// "sys_user_referee"
|
||||||
// "sys_notice"
|
// "sys_notice"
|
||||||
// "sys_plug"
|
// "sys_plug"
|
||||||
"sys_plug_record"
|
// "sys_plug_record",
|
||||||
|
"sys_environment"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
Reference in New Issue
Block a user