Compare commits
No commits in common. "18c65030500d9bbe2faa8ed4dd1875d1d9ad635f" and "29f17bf686ebfb767a0f79f12f30a503a0e434c4" have entirely different histories.
18c6503050
...
29f17bf686
|
@ -68,14 +68,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.muyu.common.security.utils.SecurityUtils;
|
|||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -45,9 +44,8 @@ public class SysLoginService {
|
|||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isAnyBlank(username, password)) {
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
||||
throw new ServiceException("用户/邮箱/密码必须填写");
|
||||
throw new ServiceException("用户/密码必须填写");
|
||||
}
|
||||
|
||||
// 密码如果不在指定范围内 错误
|
||||
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
|
@ -56,7 +54,7 @@ public class SysLoginService {
|
|||
}
|
||||
// 用户名不在指定范围内 错误
|
||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH ) {
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户名不在指定范围");
|
||||
throw new ServiceException("用户名不在指定范围");
|
||||
}
|
||||
|
@ -66,13 +64,12 @@ public class SysLoginService {
|
|||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单");
|
||||
throw new ServiceException("很遗憾,访问IP已被列入系统黑名单");
|
||||
}
|
||||
System.out.println(username);
|
||||
// 查询用户信息
|
||||
Result<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
||||
|
||||
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
|
||||
throw new ServiceException("登录用户/邮箱:" + username + " 不存在");
|
||||
throw new ServiceException("登录用户:" + username + " 不存在");
|
||||
}
|
||||
|
||||
if (Result.FAIL == userResult.getCode()) {
|
||||
|
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
package com.muyu.common.core.utils;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author yangle
|
||||
* @description: 对象工具类
|
||||
* @Date 2023-10-9 下午 04:56
|
||||
*/
|
||||
public class ObjUtils {
|
||||
|
||||
/**
|
||||
* 兼容
|
||||
* CharSequence: 如果长度为零,则认为为空。
|
||||
* Array: 如果长度为零,则认为为空。
|
||||
* Collection: 如果元素为零,则认为为空。
|
||||
* Map: 如果键值映射为零,则认为为空。
|
||||
* @param o 对象
|
||||
* @return 如果对象具有受支持的类型并且为空或null,则为true,否则为false
|
||||
*/
|
||||
public static boolean notNull(Object o){
|
||||
return ObjectUtils.isNotEmpty(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断long类型不为0
|
||||
* @param val 值
|
||||
* @return 返回值不为0
|
||||
*/
|
||||
public static boolean notNull(Long val){
|
||||
return ObjectUtils.isNotEmpty(val) && val != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断Integer类型不为0
|
||||
* @param val 值
|
||||
* @return 返回值不为0
|
||||
*/
|
||||
public static boolean notNull(Integer val){
|
||||
return ObjectUtils.isNotEmpty(val) && val != 0;
|
||||
}
|
||||
/**
|
||||
* 判断BigDecimal类型不为0
|
||||
* @param val 值
|
||||
* @return 返回值不为0
|
||||
*/
|
||||
public static boolean notNull(BigDecimal val){
|
||||
return ObjectUtils.isNotEmpty(val) && val.doubleValue() == 0.00;
|
||||
}
|
||||
/**
|
||||
* 判断BigDecimal类型不为0
|
||||
* @param val 值
|
||||
* @return 返回值不为0
|
||||
*/
|
||||
public static boolean notChildNull(Object[] val){
|
||||
for (Object o : val) {
|
||||
if (!notNull(o)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -58,7 +58,7 @@ public class IpUtils {
|
|||
ip = request.getRemoteAddr();
|
||||
}
|
||||
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "115.159.211.196" : getMultistageReverseProxyIp(ip);
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,7 +70,7 @@ public class IpUtils {
|
|||
*/
|
||||
public static boolean internalIp (String ip) {
|
||||
byte[] addr = textToNumericFormatV4(ip);
|
||||
return internalIp(addr) || "115.159.211.196".equals(ip);
|
||||
return internalIp(addr) || "127.0.0.1".equals(ip);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -197,7 +197,7 @@ public class IpUtils {
|
|||
return InetAddress.getLocalHost().getHostAddress();
|
||||
} catch (UnknownHostException e) {
|
||||
}
|
||||
return "115.159.211.196";
|
||||
return "127.0.0.1";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
因为每个数据库的地址数据库名不同
|
||||
找到多数据MybatisPlus多数据源依赖
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</dependency>
|
||||
在spring字段下添加datasource字段 用来区分不同的数据库
|
||||
在业务层上添加@DS注解(区分名)
|
||||
一个业务类不能同时调用多个数据源 解决方法是将业务类拆分 组合成多个业务类来连接多个数据库
|
|
@ -104,14 +104,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -29,12 +28,12 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 115.159.211.196:8718
|
||||
dashboard: 127.0.0.1:8718
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -83,14 +83,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -88,14 +88,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -94,14 +94,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-kvt</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-kvt-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,28 +0,0 @@
|
|||
package com.muyu.kvt.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* AssetStructureList 數據结构
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/21
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AssetStructureList {
|
||||
|
||||
private String name;
|
||||
private String systemName;
|
||||
private String databaseName;
|
||||
private Long type;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.muyu.kvt.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* ChildrenList 子列表
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/21
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ChildrenList {
|
||||
private String name;
|
||||
private String as;
|
||||
private Integer dataTotal;
|
||||
private Long type;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.muyu.kvt.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 数据库类型 dataType
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/21
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DataType {
|
||||
private Integer id;
|
||||
private String typeName;
|
||||
}
|
|
@ -1,185 +0,0 @@
|
|||
package com.muyu.kvt.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.kvt.domain.req.KvtEditReq;
|
||||
import com.muyu.kvt.domain.req.KvtQueryReq;
|
||||
import com.muyu.kvt.domain.req.KvtSaveReq;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
对象 kvt
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("kvt")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "Kvt", description = "kvt")
|
||||
public class Kvt extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 接入源名称 */
|
||||
@Excel(name = "接入源名称")
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@Excel(name = "数据来源系统名称")
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据接入类型 */
|
||||
@Excel(name = "数据接入类型")
|
||||
@ApiModelProperty(name = "数据接入类型", value = "数据接入类型")
|
||||
private Long type;
|
||||
|
||||
/** 主机地址 */
|
||||
@Excel(name = "主机地址")
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口地址 */
|
||||
@Excel(name = "端口地址")
|
||||
@ApiModelProperty(name = "端口地址", value = "端口地址")
|
||||
private String port;
|
||||
|
||||
/** 数据库名称 */
|
||||
@Excel(name = "数据库名称")
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@Excel(name = "数据连接参数")
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@Excel(name = "初始连接数量")
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@Excel(name = "最大连接数量")
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最大等待时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Date maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@Excel(name = "最大等待次数")
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Excel(name = "用户名")
|
||||
@ApiModelProperty(name = "用户名",value = "用户名")
|
||||
private String username;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Excel(name = "密码")
|
||||
@ApiModelProperty(name = "密码",value = "密码")
|
||||
private String password;
|
||||
|
||||
@Excel(name = "数据库类型")
|
||||
@ApiModelProperty(name = "数据库类型",value = "数据库类型")
|
||||
private Integer dateTypeId;
|
||||
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static Kvt queryBuild( KvtQueryReq kvtQueryReq){
|
||||
return Kvt.builder()
|
||||
.name(kvtQueryReq.getName())
|
||||
.systemName(kvtQueryReq.getSystemName())
|
||||
.type(kvtQueryReq.getType())
|
||||
.host(kvtQueryReq.getHost())
|
||||
.port(kvtQueryReq.getPort())
|
||||
.databaseName(kvtQueryReq.getDatabaseName())
|
||||
.connectionParam(kvtQueryReq.getConnectionParam())
|
||||
.initNum(kvtQueryReq.getInitNum())
|
||||
.maxNum(kvtQueryReq.getMaxNum())
|
||||
.maxWaitTime(kvtQueryReq.getMaxWaitTime())
|
||||
.maxWaitSize(kvtQueryReq.getMaxWaitSize())
|
||||
.username(kvtQueryReq.getUsername())
|
||||
.password(kvtQueryReq.getPassword())
|
||||
.dateTypeId(kvtQueryReq.getDateTypeId())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static Kvt saveBuild(KvtSaveReq kvtSaveReq){
|
||||
return Kvt.builder()
|
||||
.name(kvtSaveReq.getName())
|
||||
.systemName(kvtSaveReq.getSystemName())
|
||||
.type(kvtSaveReq.getType())
|
||||
.host(kvtSaveReq.getHost())
|
||||
.port(kvtSaveReq.getPort())
|
||||
.databaseName(kvtSaveReq.getDatabaseName())
|
||||
.connectionParam(kvtSaveReq.getConnectionParam())
|
||||
.initNum(kvtSaveReq.getInitNum())
|
||||
.maxNum(kvtSaveReq.getMaxNum())
|
||||
.maxWaitTime(kvtSaveReq.getMaxWaitTime())
|
||||
.maxWaitSize(kvtSaveReq.getMaxWaitSize())
|
||||
.username(kvtSaveReq.getUsername())
|
||||
.password(kvtSaveReq.getPassword())
|
||||
.dateTypeId(kvtSaveReq.getDateTypeId())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static Kvt editBuild(Long id, KvtEditReq kvtEditReq){
|
||||
return Kvt.builder()
|
||||
.id(id)
|
||||
.name(kvtEditReq.getName())
|
||||
.systemName(kvtEditReq.getSystemName())
|
||||
.type(kvtEditReq.getType())
|
||||
.host(kvtEditReq.getHost())
|
||||
.port(kvtEditReq.getPort())
|
||||
.databaseName(kvtEditReq.getDatabaseName())
|
||||
.connectionParam(kvtEditReq.getConnectionParam())
|
||||
.initNum(kvtEditReq.getInitNum())
|
||||
.maxNum(kvtEditReq.getMaxNum())
|
||||
.maxWaitTime(kvtEditReq.getMaxWaitTime())
|
||||
.maxWaitSize(kvtEditReq.getMaxWaitSize())
|
||||
.username(kvtEditReq.getUsername())
|
||||
.password(kvtEditReq.getPassword())
|
||||
.dateTypeId(kvtEditReq.getDateTypeId())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package com.muyu.kvt.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 表结构 Structure
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Structure {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 接入源名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 数据来源系统名称
|
||||
*/
|
||||
private String systemName;
|
||||
/**
|
||||
* 主机地址
|
||||
*/
|
||||
private String host;
|
||||
/**
|
||||
* 端口地址
|
||||
*/
|
||||
private String port;
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
/**
|
||||
* 数据连接参数
|
||||
*/
|
||||
private String connection_param;
|
||||
/**
|
||||
* 数据接入类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.muyu.kvt.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 表 Tables
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/21
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Tables {
|
||||
private Integer id;
|
||||
private String tableName;
|
||||
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.kvt.domain.req;
|
||||
|
||||
import com.muyu.kvt.domain.AssetStructureList;
|
||||
import com.muyu.kvt.domain.ChildrenList;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AssetStructureResponse
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/21
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
public class AssetStructureResponse {
|
||||
private List<AssetStructureList> assetStructureLists;
|
||||
private List<ChildrenList> childrenLists;
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
package com.muyu.kvt.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
对象 kvt
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "KvtEditReq", description = "kvt ")
|
||||
public class KvtEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 接入源名称 */
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据接入类型 */
|
||||
@ApiModelProperty(name = "数据接入类型", value = "数据接入类型")
|
||||
private Long type;
|
||||
|
||||
/** 主机地址 */
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口地址 */
|
||||
@ApiModelProperty(name = "端口地址", value = "端口地址")
|
||||
private String port;
|
||||
|
||||
/** 数据库名称 */
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Date maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
/*
|
||||
用户名
|
||||
*/
|
||||
@ApiModelProperty(name = "用户名",value = "用户名")
|
||||
public String username;
|
||||
/*
|
||||
密码
|
||||
*/
|
||||
@ApiModelProperty(name = "密码",value = "密码")
|
||||
public String password;
|
||||
|
||||
@ApiModelProperty(name = "数据库类型",value = "数据库类型")
|
||||
private Integer dateTypeId;
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
package com.muyu.kvt.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
对象 kvt
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "KvtQueryReq", description = "kvt ")
|
||||
public class KvtQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 接入源名称 */
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据接入类型 */
|
||||
@ApiModelProperty(name = "数据接入类型", value = "数据接入类型")
|
||||
private Long type;
|
||||
|
||||
/** 主机地址 */
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口地址 */
|
||||
@ApiModelProperty(name = "端口地址", value = "端口地址")
|
||||
private String port;
|
||||
|
||||
/** 数据库名称 */
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Date maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
/*
|
||||
用户名
|
||||
*/
|
||||
@ApiModelProperty(name = "用户名",value = "用户名")
|
||||
public String username;
|
||||
/*
|
||||
密码
|
||||
*/
|
||||
@ApiModelProperty(name = "密码",value = "密码")
|
||||
public String password;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "数据库类型",value = "数据库类型")
|
||||
private Integer dateTypeId;
|
||||
}
|
|
@ -1,103 +0,0 @@
|
|||
package com.muyu.kvt.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
对象 kvt
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "KvtSaveReq", description = "kvt")
|
||||
public class KvtSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 接入源名称 */
|
||||
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据接入类型 */
|
||||
|
||||
@ApiModelProperty(name = "数据接入类型", value = "数据接入类型")
|
||||
private Long type;
|
||||
|
||||
/** 主机地址 */
|
||||
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口地址 */
|
||||
|
||||
@ApiModelProperty(name = "端口地址", value = "端口地址")
|
||||
private String port;
|
||||
|
||||
/** 数据库名称 */
|
||||
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Date maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
|
||||
/*
|
||||
用户名
|
||||
*/
|
||||
@ApiModelProperty(name = "用户名",value = "用户名")
|
||||
public String username;
|
||||
/*
|
||||
密码
|
||||
*/
|
||||
@ApiModelProperty(name = "密码",value = "密码")
|
||||
public String password;
|
||||
|
||||
@ApiModelProperty(name = "数据库类型",value = "数据库类型")
|
||||
private Integer dateTypeId;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-kvt</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-kvt-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,116 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-kvt</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-kvt-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-kvt-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.kvt;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* MuyuApplication
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/21
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class MuyuApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MuyuApplication.class);
|
||||
}
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
package com.muyu.kvt.controller;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.kvt.domain.AssetStructureList;
|
||||
import com.muyu.kvt.domain.DataType;
|
||||
import com.muyu.kvt.domain.Kvt;
|
||||
import com.muyu.kvt.domain.Tables;
|
||||
import com.muyu.kvt.domain.req.AssetStructureResponse;
|
||||
import com.muyu.kvt.domain.req.KvtEditReq;
|
||||
import com.muyu.kvt.domain.req.KvtQueryReq;
|
||||
import com.muyu.kvt.domain.req.KvtSaveReq;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.muyu.kvt.service.KvtService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Api(tags = "kvt")
|
||||
@RestController
|
||||
@RequestMapping("/kvt")
|
||||
public class KvtController extends BaseController {
|
||||
@Autowired
|
||||
private KvtService kvtService;
|
||||
|
||||
/**
|
||||
* 查询kvt列表
|
||||
*/
|
||||
@ApiOperation("获取kvt列表")
|
||||
@RequiresPermissions("kvt:kvt:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Kvt>> list(KvtQueryReq kvtQueryReq) {
|
||||
startPage();
|
||||
List<Kvt> list = kvtService.list(Kvt.queryBuild(kvtQueryReq));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出kvt列表
|
||||
*/
|
||||
@ApiOperation("导出kvt列表")
|
||||
@RequiresPermissions("kvt:kvt:export")
|
||||
@Log(title = "kvt", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Kvt kvt) {
|
||||
List<Kvt> list = kvtService.list(kvt);
|
||||
ExcelUtil<Kvt> util = new ExcelUtil<Kvt>(Kvt.class);
|
||||
util.exportExcel(response, list, "kvt数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取kvt详细信息
|
||||
*/
|
||||
@ApiOperation("获取kvt详细信息")
|
||||
@RequiresPermissions("kvt:kvt:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<Kvt> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(kvtService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增kvt
|
||||
|
||||
*/
|
||||
@RequiresPermissions("kvt:kvt:add")
|
||||
@Log(title = "kvt ", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增kvt ")
|
||||
public Result<String> add(@RequestBody KvtSaveReq kvtSaveReq) {
|
||||
return toAjax(kvtService.save(Kvt.saveBuild(kvtSaveReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改kvt
|
||||
|
||||
*/
|
||||
@RequiresPermissions("kvt:kvt:edit")
|
||||
@Log(title = "kvt ", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改kvt")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody KvtEditReq kvtEditReq) {
|
||||
return toAjax(kvtService.updateById(Kvt.editBuild(id,kvtEditReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除kvt
|
||||
|
||||
*/
|
||||
@RequiresPermissions("kvt:kvt:remove")
|
||||
@Log(title = "kvt ", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除kvt")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(kvtService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试连接
|
||||
*/
|
||||
@PostMapping("/connectionTest")
|
||||
public Result connectionTest(@RequestBody Kvt kvt) throws SQLException, ClassNotFoundException {
|
||||
boolean test= kvtService.connectionTest(kvt);
|
||||
if (test){
|
||||
return Result.success("测试成功");
|
||||
}else {
|
||||
return Result.error("测试失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/dataTypeList")
|
||||
public Result<List<DataType>> dataTypeList(){
|
||||
List<DataType> dataTypeList=kvtService.dataTypeList();
|
||||
return Result.success(dataTypeList);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/synchronizationAdd")
|
||||
public Result synchronizationAdd (@RequestBody Kvt kvt) throws SQLException, ClassNotFoundException {
|
||||
kvtService.synchronizationAdd(kvt);
|
||||
return Result.success();
|
||||
|
||||
}
|
||||
|
||||
// @PostMapping("/selectName")
|
||||
// public Result<List<String>> listResult(@RequestParam String name) throws SQLException, ClassNotFoundException {
|
||||
// Kvt kvt= kvtService.listResult(name);
|
||||
// List<String> list= kvtService.kvtList(kvt);
|
||||
// return Result.success(list);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/assetStructureResponse")
|
||||
// public Result<List<AssetStructureResponse>> assetStructureResponse( ) throws SQLException, ClassNotFoundException {
|
||||
// List<AssetStructureResponse> assetStructureList= kvtService.assetStructureResponse();
|
||||
//
|
||||
// return Result.success(assetStructureList) ;
|
||||
// }
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.muyu.kvt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.kvt.domain.AssetStructureList;
|
||||
import com.muyu.kvt.domain.DataType;
|
||||
import com.muyu.kvt.domain.Kvt;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
public interface KvtMapper extends BaseMapper<Kvt> {
|
||||
|
||||
List<DataType> dataTypeList();
|
||||
|
||||
|
||||
Kvt findName(String name);
|
||||
|
||||
List<AssetStructureList> assetStructureList();
|
||||
|
||||
|
||||
void synchronizationAdd(Kvt kvt);
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package com.muyu.kvt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.kvt.domain.AssetStructureList;
|
||||
import com.muyu.kvt.domain .DataType;
|
||||
import com.muyu.kvt.domain.Kvt;
|
||||
import com.muyu.kvt.domain.req.AssetStructureResponse;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* kvt
|
||||
Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
public interface KvtService extends IService<Kvt> {
|
||||
/**
|
||||
* 查询kvt
|
||||
列表
|
||||
*
|
||||
* @param kvt kvt
|
||||
|
||||
* @return kvt
|
||||
集合
|
||||
*/
|
||||
public List<Kvt> list(Kvt kvt);
|
||||
|
||||
boolean connectionTest(Kvt kvt) throws ClassNotFoundException, SQLException;
|
||||
|
||||
List<DataType> dataTypeList();
|
||||
|
||||
|
||||
Kvt listResult(String name);
|
||||
|
||||
// List<AssetStructureList> assetStructureList() throws ClassNotFoundException, SQLException;
|
||||
|
||||
List<AssetStructureResponse> assetStructureResponse() throws ClassNotFoundException, SQLException;
|
||||
|
||||
void synchronizationAdd(Kvt kvt) throws SQLException, ClassNotFoundException;
|
||||
|
||||
|
||||
// List<String> kvtList(Kvt kvt) throws ClassNotFoundException, SQLException;
|
||||
|
||||
}
|
|
@ -1,276 +0,0 @@
|
|||
package com.muyu.kvt.service.impl;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.kvt.domain.AssetStructureList;
|
||||
import com.muyu.kvt.domain.ChildrenList;
|
||||
import com.muyu.kvt.domain.DataType;
|
||||
import com.muyu.kvt.domain.Kvt;
|
||||
import com.muyu.kvt.domain.req.AssetStructureResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.kvt.mapper.KvtMapper;
|
||||
import com.muyu.kvt.service.KvtService;
|
||||
/**
|
||||
* kvt
|
||||
Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtService {
|
||||
|
||||
/**
|
||||
* 查询kvt列表
|
||||
*
|
||||
* @param kvt kvt
|
||||
* @return kvt
|
||||
|
||||
*/
|
||||
@Override
|
||||
public List<Kvt> list(Kvt kvt) {
|
||||
LambdaQueryWrapper<Kvt> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(kvt.getName())){
|
||||
queryWrapper.like(Kvt::getName, kvt.getName());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getSystemName())){
|
||||
queryWrapper.like(Kvt::getSystemName, kvt.getSystemName());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getType())){
|
||||
queryWrapper.eq(Kvt::getType, kvt.getType());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getHost())){
|
||||
queryWrapper.eq(Kvt::getHost, kvt.getHost());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getPort())){
|
||||
queryWrapper.eq(Kvt::getPort, kvt.getPort());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getDatabaseName())){
|
||||
queryWrapper.like(Kvt::getDatabaseName, kvt.getDatabaseName());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getConnectionParam())){
|
||||
queryWrapper.eq(Kvt::getConnectionParam, kvt.getConnectionParam());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getInitNum())){
|
||||
queryWrapper.eq(Kvt::getInitNum, kvt.getInitNum());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getMaxNum())){
|
||||
queryWrapper.eq(Kvt::getMaxNum, kvt.getMaxNum());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getMaxWaitTime())){
|
||||
queryWrapper.eq(Kvt::getMaxWaitTime, kvt.getMaxWaitTime());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(kvt.getMaxWaitSize())){
|
||||
queryWrapper.eq(Kvt::getMaxWaitSize, kvt.getMaxWaitSize());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean connectionTest(Kvt kvt) throws ClassNotFoundException, SQLException {
|
||||
String user = kvt.getUsername();
|
||||
String password = kvt.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+kvt.getHost()+":"+kvt.getPort()+"/"+kvt.getDatabaseName()+"?"+kvt.getConnectionParam();
|
||||
Class.forName(jdbcDriver);
|
||||
Connection connection = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
if (connection==null){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataType> dataTypeList() {
|
||||
return baseMapper.dataTypeList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Kvt listResult(String name) {
|
||||
return baseMapper.findName(name);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<AssetStructureList> assetStructureList() throws ClassNotFoundException, SQLException {
|
||||
// List<Kvt> list = list();
|
||||
// for (Kvt kvt : list) {
|
||||
// String user = kvt.getUsername();
|
||||
// String password = kvt.getPassword();
|
||||
// String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
// String jdbcUrl = "jdbc:mysql://" + kvt.getHost() + ":" + kvt.getPort() + "/" + kvt.getDatabaseName() + "?" + kvt.getConnectionParam();
|
||||
// Class.forName(jdbcDriver);
|
||||
// Connection connection = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
// if (connection == null) {
|
||||
// throw new RuntimeException("连接失败");
|
||||
// }
|
||||
//
|
||||
// AssetStructureList assetStructureList = new AssetStructureList();
|
||||
// assetStructureList.setName(kvt.getName());
|
||||
// assetStructureList.setType(kvt.getType());
|
||||
// assetStructureList.setSystemName(kvt.getSystemName());
|
||||
// assetStructureList.setDatabaseName(kvt.getDatabaseName());
|
||||
//
|
||||
//
|
||||
// }
|
||||
// AssetStructureList assetStructureList = new AssetStructureList();
|
||||
// return assetStructureList;
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<AssetStructureResponse> assetStructureResponse() throws ClassNotFoundException, SQLException {
|
||||
List<Kvt> list = list();
|
||||
for (Kvt kvt : list) {
|
||||
String user = kvt.getUsername();
|
||||
String password = kvt.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+kvt.getHost()+":"+kvt.getPort()+"/"+kvt.getDatabaseName()+"?"+kvt.getConnectionParam();
|
||||
Class.forName(jdbcDriver);
|
||||
Connection connection = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
if (connection==null){
|
||||
throw new RuntimeException("连接失败");
|
||||
}
|
||||
|
||||
AssetStructureList assetStructureList = new AssetStructureList();
|
||||
assetStructureList.setName(kvt.getName());
|
||||
assetStructureList.setType(kvt.getType());
|
||||
assetStructureList.setSystemName(kvt.getSystemName());
|
||||
assetStructureList.setDatabaseName(kvt.getDatabaseName());
|
||||
ArrayList<AssetStructureList> assetStructureLists = new ArrayList<>();
|
||||
assetStructureLists.add(assetStructureList);
|
||||
|
||||
Statement statement = connection.createStatement();
|
||||
String sql = "SHOW TABLES FROM "+kvt.getDatabaseName(); // 查询数据库中的所有表
|
||||
ResultSet resultSet = statement.executeQuery(sql);
|
||||
ResultSetMetaData metaData = resultSet.getMetaData();
|
||||
int columnCount = metaData.getColumnCount();
|
||||
|
||||
|
||||
List<ChildrenList> childrenLists = new ArrayList<>();
|
||||
List<AssetStructureResponse> assetStructureResponses = new ArrayList<>();
|
||||
|
||||
// 遍历结果集的列,获取表名
|
||||
while (resultSet.next()) {
|
||||
for (int i = 1; i <= columnCount; i++) {
|
||||
ChildrenList childrenList = new ChildrenList();
|
||||
String tableName = resultSet.getString(i);
|
||||
|
||||
|
||||
|
||||
String remark = "SELECT table_name, table_comment FROM information_schema.tables WHERE table_schema = '" + kvt.getDatabaseName() + "' AND table_name = '" + tableName + "'";
|
||||
System.out.println(remark);
|
||||
ResultSet resultSet22 = statement.executeQuery(remark);
|
||||
if (resultSet22.next()) {
|
||||
String tableComment = resultSet22.getString(tableName);
|
||||
System.out.println("表备注:" + tableComment);
|
||||
System.out.println("seggredhjrdfg"+tableComment);
|
||||
childrenList.setName(tableComment);
|
||||
}
|
||||
|
||||
|
||||
String count = "SELECT COUNT(*) AS total_records FROM "+tableName; // 查询数据库中的所有表
|
||||
ResultSet resultSet11 = statement.executeQuery(count);
|
||||
if (resultSet11.next()){
|
||||
int totalRecords = resultSet11.getInt(tableName);
|
||||
childrenList.setDataTotal(totalRecords);
|
||||
}
|
||||
|
||||
|
||||
childrenList.setAs(tableName);
|
||||
|
||||
|
||||
childrenList.setType(kvt.getType());
|
||||
childrenLists.add(childrenList);
|
||||
}
|
||||
}
|
||||
AssetStructureResponse build = AssetStructureResponse.builder()
|
||||
.assetStructureLists(assetStructureLists)
|
||||
.childrenLists(childrenLists)
|
||||
.build();
|
||||
assetStructureResponses.add(build );
|
||||
}
|
||||
|
||||
return assetStructureResponse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void synchronizationAdd(Kvt kvt) throws SQLException, ClassNotFoundException {
|
||||
boolean b = this.connectionTest(kvt);
|
||||
if (b){
|
||||
baseMapper.synchronizationAdd(kvt);
|
||||
}else {
|
||||
|
||||
throw new RuntimeException("同步失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<String> kvtList(Kvt kvt) {
|
||||
// String user = kvt.getUsername();
|
||||
// String password = kvt.getPassword();
|
||||
// String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
// String jdbcUrl = "jdbc:mysql://" + kvt.getHost() + ":" + kvt.getPort() + "/" + kvt.getDatabaseName() + "?" + kvt.getConnectionParam();
|
||||
//
|
||||
// Connection connection = null;
|
||||
// List<String> tables = new ArrayList<>();
|
||||
//
|
||||
// try {
|
||||
// Class.forName(jdbcDriver);
|
||||
// connection = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
// Statement statement = connection.createStatement();
|
||||
// String sql = "SHOW TABLES"; // 查询数据库中的所有表
|
||||
// ResultSet resultSet = statement.executeQuery(sql);
|
||||
// ResultSetMetaData metaData = resultSet.getMetaData();
|
||||
// int columnCount = metaData.getColumnCount();
|
||||
//
|
||||
// // 遍历结果集的列,获取表名
|
||||
// while (resultSet.next()) {
|
||||
// for (int i = 1; i <= columnCount; i++) {
|
||||
// String tableName = resultSet.getString(i);
|
||||
// tables.add(tableName);
|
||||
// System.out.println("表名:" + tableName);
|
||||
// }
|
||||
// }
|
||||
// } catch (ClassNotFoundException e) {
|
||||
// e.printStackTrace();
|
||||
// } catch (SQLException e) {
|
||||
// e.printStackTrace();
|
||||
// } finally {
|
||||
// // 关闭连接
|
||||
// if (connection != null) {
|
||||
// try {
|
||||
// connection.close();
|
||||
// } catch (SQLException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return tables;
|
||||
// }
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -1,31 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9567
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
main:
|
||||
allow-circular-references: true
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-kvt
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.kvt.mapper: DEBUG
|
|
@ -1,74 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,55 +0,0 @@
|
|||
<?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.muyu.kvt.mapper.KvtMapper">
|
||||
|
||||
<resultMap type="com.muyu.kvt.domain.Kvt" id="KvtResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="systemName" column="system_name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="host" column="host" />
|
||||
<result property="port" column="port" />
|
||||
<result property="databaseName" column="database_name" />
|
||||
<result property="connectionParam" column="connection_param" />
|
||||
<result property="initNum" column="init_num" />
|
||||
<result property="maxNum" column="max_num" />
|
||||
<result property="maxWaitTime" column="max_wait_time" />
|
||||
<result property="maxWaitSize" column="max_wait_size" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<result property="password" column="password" />
|
||||
<result property="dateTypeId" column="data_type_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKvtVo">
|
||||
select id, name, system_name, type, host, port, database_name, connection_param, init_num, max_num, max_wait_time, max_wait_size, remark, create_by, create_time, update_by, update_time,date_type_id
|
||||
from kvt
|
||||
</sql>
|
||||
|
||||
<select id="dataTypeList" resultType="com.muyu.kvt.domain.DataType">
|
||||
select * from data_type
|
||||
</select>
|
||||
<select id="findName" resultType="com.muyu.kvt.domain.Kvt">
|
||||
select * from kvt where name =#{name}
|
||||
</select>
|
||||
<select id="assetStructureList" resultType="com.muyu.kvt.domain.AssetStructureList">
|
||||
select * from kvt
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="synchronizationAdd">
|
||||
INSERT INTO `ry-cloud`.`synchronization`
|
||||
( `name`, `system_name`,`type`, `host`, `port`, `database_name`,
|
||||
`connection_param`)
|
||||
VALUES ( #{name}, #{systemName},#{type}, #{host}, #{port}, #{databaseName}, #{connectionParam});
|
||||
|
||||
|
||||
</insert>
|
||||
</mapper>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-kvt</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>muyu-kvt-common</module>
|
||||
<module>muyu-kvt-remote</module>
|
||||
<module>muyu-kvt-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -94,14 +94,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -1,111 +0,0 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.system.domain.AsUserDept;
|
||||
import com.muyu.system.domain.resp.AsUserDeotNumResponse;
|
||||
import com.muyu.system.service.service.IAsUserDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户与部门中间Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/userDept")
|
||||
public class AsUserDeptController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAsUserDeptService asUserDeptService;
|
||||
|
||||
/**
|
||||
* 查询用户与部门中间列表
|
||||
*/
|
||||
@RequiresPermissions("product:dept:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<AsUserDept>> list(AsUserDept asUserDept)
|
||||
{
|
||||
startPage();
|
||||
List<AsUserDept> list = asUserDeptService.selectAsUserDeptList(asUserDept);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户与部门中间列表
|
||||
*/
|
||||
@RequiresPermissions("product:dept:export")
|
||||
@Log(title = "用户与部门中间", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AsUserDept asUserDept)
|
||||
{
|
||||
List<AsUserDept> list = asUserDeptService.selectAsUserDeptList(asUserDept);
|
||||
ExcelUtil<AsUserDept> util = new ExcelUtil<AsUserDept>(AsUserDept.class);
|
||||
util.exportExcel(response, list, "用户与部门中间数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户与部门中间详细信息
|
||||
*/
|
||||
@RequiresPermissions("product:dept:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(asUserDeptService.selectAsUserDeptById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户与部门中间
|
||||
*/
|
||||
@RequiresPermissions("product:dept:add")
|
||||
@Log(title = "用户与部门中间", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody AsUserDept asUserDept)
|
||||
{
|
||||
return toAjax(asUserDeptService.insertAsUserDept(asUserDept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户与部门中间
|
||||
*/
|
||||
@RequiresPermissions("product:dept:edit")
|
||||
@Log(title = "用户与部门中间", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody AsUserDept asUserDept)
|
||||
{
|
||||
return toAjax(asUserDeptService.updateAsUserDept(asUserDept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户与部门中间
|
||||
*/
|
||||
@RequiresPermissions("product:dept:remove")
|
||||
@Log(title = "用户与部门中间", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(asUserDeptService.deleteAsUserDeptByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping("/UpdateAsUserDept")
|
||||
public Result list(@RequestParam("id") Long id)
|
||||
{
|
||||
return asUserDeptService.updateAsUserDeptRead(id);
|
||||
}
|
||||
|
||||
@GetMapping("/GetNum")
|
||||
public Result<AsUserDeotNumResponse> getNum(@RequestParam("noticeId") Long noticeId)
|
||||
{
|
||||
return asUserDeptService.getNum(noticeId);
|
||||
}
|
||||
}
|
|
@ -45,7 +45,6 @@ public class SysDictTypeController extends BaseController {
|
|||
util.exportExcel(response, list, "字典类型");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询字典类型详细
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,6 @@ import com.muyu.common.log.annotation.Log;
|
|||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.system.domain.SysMenu;
|
||||
import com.muyu.system.domain.resp.RoleMenuTreeResp;
|
||||
import com.muyu.system.service.SysMenuService;
|
||||
|
@ -16,9 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 菜单信息
|
||||
|
@ -38,12 +35,10 @@ public class SysMenuController extends BaseController {
|
|||
@GetMapping("/list")
|
||||
public Result list (SysMenu menu) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> sysMenus = menuService.selectMenuList(menu, userId);
|
||||
return success(sysMenus);
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
||||
return success(menus);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据菜单编号获取详细信息
|
||||
*/
|
||||
|
|
|
@ -8,8 +8,6 @@ import com.muyu.common.log.enums.BusinessType;
|
|||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.system.domain.SysNotice;
|
||||
import com.muyu.system.domain.req.SysNoticeRequest;
|
||||
import com.muyu.system.domain.resp.SysNoticeResponse;
|
||||
import com.muyu.system.service.SysNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -38,10 +36,6 @@ public class SysNoticeController extends BaseController {
|
|||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@PostMapping("/GetNoticeList")
|
||||
public Result<List<SysNoticeResponse>> getNoticeList(@RequestBody SysNoticeRequest sysNoticeRequest){
|
||||
return noticeService.getNoticeList(sysNoticeRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据通知公告编号获取详细信息
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.muyu.common.core.web.controller.BaseController;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import com.muyu.common.security.annotation.InnerAuth;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
|
@ -15,7 +14,6 @@ import com.muyu.common.system.domain.SysDept;
|
|||
import com.muyu.common.system.domain.SysRole;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.system.domain.SysUserOnline;
|
||||
import com.muyu.system.domain.resp.AuthRoleResp;
|
||||
import com.muyu.system.domain.resp.UserDetailInfoResp;
|
||||
import com.muyu.system.domain.resp.UserInfoResp;
|
||||
|
@ -26,7 +24,6 @@ import org.springframework.validation.annotation.Validated;
|
|||
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.util.List;
|
||||
|
@ -59,9 +56,6 @@ public class SysUserController extends BaseController {
|
|||
@Autowired
|
||||
private SysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private SysUserOnlineController sysUserOnlineController;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
|
@ -232,6 +226,7 @@ public class SysUserController extends BaseController {
|
|||
}
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
|
@ -239,18 +234,8 @@ public class SysUserController extends BaseController {
|
|||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public Result resetPwd (@RequestBody SysUser user) {
|
||||
SysUser sysUser = userService.selectUserById(user.getUserId());
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
Result<TableDataInfo<SysUserOnline>> list = sysUserOnlineController.list(user.getLoginIp(), user.getUserName());
|
||||
System.out.println(list);
|
||||
TableDataInfo<SysUserOnline> data = list.getData();
|
||||
List<SysUserOnline> rows = data.getRows();
|
||||
for (SysUserOnline row : rows) {
|
||||
if (row.getUserName().equals(sysUser.getUserName())){
|
||||
sysUserOnlineController.forceLogout(row.getTokenId());
|
||||
}
|
||||
}
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(userService.resetPwd(user));
|
||||
|
@ -305,6 +290,4 @@ public class SysUserController extends BaseController {
|
|||
public Result deptTree (SysDept dept) {
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
package com.muyu.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户与部门中间对象 as_user_dept
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-14
|
||||
*/
|
||||
public class AsUserDept extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long userId;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long noticeId;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String isRead;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setNoticeId(Long noticeId)
|
||||
{
|
||||
this.noticeId = noticeId;
|
||||
}
|
||||
|
||||
public Long getNoticeId()
|
||||
{
|
||||
return noticeId;
|
||||
}
|
||||
public void setIsRead(String isRead)
|
||||
{
|
||||
this.isRead = isRead;
|
||||
}
|
||||
|
||||
public String getIsRead()
|
||||
{
|
||||
return isRead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("noticeId", getNoticeId())
|
||||
.append("isRead", getIsRead())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -12,7 +12,6 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通知公告表 sys_notice
|
||||
|
@ -51,14 +50,7 @@ public class SysNotice extends BaseEntity {
|
|||
* 公告状态(0正常 1关闭)
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 部门id集合
|
||||
*/
|
||||
private List<List<Long>> sectionList;
|
||||
/**
|
||||
* 用户id集合
|
||||
*/
|
||||
private List<Long> personnelList;
|
||||
|
||||
public Long getNoticeId () {
|
||||
return noticeId;
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package com.muyu.system.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* SysNoticeRequest
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysNoticeRequest {
|
||||
private Long noticeId;
|
||||
private Long userId;
|
||||
private String noticeType;
|
||||
private String isRead;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.system.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* AsUserDeotNumResponse
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AsUserDeotNumResponse {
|
||||
private Long num;
|
||||
private Long readNum;
|
||||
private Long noReadNum;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.system.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* SysNoticeResponse
|
||||
*
|
||||
* @author LeYang
|
||||
* on 2024/4/14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class SysNoticeResponse{
|
||||
|
||||
private Date createTime;
|
||||
private String createBy;
|
||||
private String noticeType;
|
||||
private String isRead;
|
||||
private String noticeTitle;
|
||||
private String noticeContent;
|
||||
private Long noticeId;
|
||||
private Long id;
|
||||
|
||||
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import com.muyu.system.domain.AsUserDept;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与部门中间Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-14
|
||||
*/
|
||||
public interface AsUserDeptMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户与部门中间
|
||||
*
|
||||
* @param id 用户与部门中间主键
|
||||
* @return 用户与部门中间
|
||||
*/
|
||||
public AsUserDept selectAsUserDeptById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户与部门中间列表
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 用户与部门中间集合
|
||||
*/
|
||||
public List<AsUserDept> selectAsUserDeptList(AsUserDept asUserDept);
|
||||
|
||||
/**
|
||||
* 新增用户与部门中间
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAsUserDept(AsUserDept asUserDept);
|
||||
|
||||
/**
|
||||
* 修改用户与部门中间
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAsUserDept(AsUserDept asUserDept);
|
||||
|
||||
/**
|
||||
* 删除用户与部门中间
|
||||
*
|
||||
* @param id 用户与部门中间主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAsUserDeptById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户与部门中间
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAsUserDeptByIds(Long[] ids);
|
||||
|
||||
void insertBachAsUserDept(@Param("asUserDepts") List<AsUserDept> asUserDepts);
|
||||
|
||||
Long selectAsUserDeptNum(Long noticeId);
|
||||
|
||||
void updateAsUserDeptRead(Long id);
|
||||
|
||||
Long selectAsUserDeptReadNum(Long noticeId);
|
||||
}
|
|
@ -135,6 +135,4 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
|||
* @return 结果
|
||||
*/
|
||||
public SysMenu checkMenuNameUnique (@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@ package com.muyu.system.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.system.domain.SysNotice;
|
||||
import com.muyu.system.domain.req.SysNoticeRequest;
|
||||
import com.muyu.system.domain.resp.SysNoticeResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -66,10 +64,4 @@ public interface SysNoticeMapper extends BaseMapper<SysNotice> {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds (Long[] noticeIds);
|
||||
|
||||
List<SysNoticeResponse> getNoticeList(SysNoticeRequest sysNoticeRequest);
|
||||
|
||||
List<Long> selectUser();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -139,6 +139,4 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||
* @return 结果
|
||||
*/
|
||||
public SysUser checkEmailUnique (String email);
|
||||
|
||||
List<Long> selectDtptUser(@Param("sectionIds") List<Long> sectionIds);
|
||||
}
|
||||
|
|
|
@ -158,6 +158,4 @@ public interface SysMenuService extends IService<SysMenu> {
|
|||
* @return 结果
|
||||
*/
|
||||
public boolean checkMenuNameUnique (SysMenu menu);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.system.domain.SysNotice;
|
||||
import com.muyu.system.domain.req.SysNoticeRequest;
|
||||
import com.muyu.system.domain.resp.SysNoticeResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -67,6 +64,4 @@ public interface SysNoticeService extends IService<SysNotice> {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds (Long[] noticeIds);
|
||||
|
||||
Result<List<SysNoticeResponse>> getNoticeList(SysNoticeRequest sysNoticeRequest);
|
||||
}
|
||||
|
|
|
@ -60,40 +60,17 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuList (SysMenu menu, Long userId) {
|
||||
List<SysMenu> allSysMenu=null;
|
||||
List<SysMenu> menuList = null;
|
||||
boolean admin = SysUser.isAdmin(userId);
|
||||
// 管理员显示所有菜单信息
|
||||
if (admin) {
|
||||
if (SysUser.isAdmin(userId)) {
|
||||
menuList = menuMapper.selectMenuList(menu);
|
||||
} else {
|
||||
menu.getParams().put("userId", userId);
|
||||
menuList = menuMapper.selectMenuListByUserId(menu);
|
||||
}
|
||||
if(menuList.size()==1){
|
||||
SysMenu sysMenu = menuList.get(0);
|
||||
//调用查询ParentId父类id
|
||||
this.selectMenuParentId1(menuList,sysMenu);
|
||||
SysMenu sysMenu1 = new SysMenu();
|
||||
sysMenu1.setPerms(menu.getPerms());
|
||||
allSysMenu = admin ?menuMapper.selectMenuList(null):menuMapper.selectMenuListByUserId(sysMenu1);
|
||||
List<SysMenu> childList = this.getChildList(allSysMenu, sysMenu);
|
||||
menuList.addAll(childList);
|
||||
}
|
||||
return menuList;
|
||||
}
|
||||
|
||||
private void selectMenuParentId1(List<SysMenu> list,SysMenu menu) {
|
||||
if(menu.getParentId().equals(0L)){
|
||||
return;
|
||||
}else {
|
||||
SysMenu sysMenu = this.selectMenuById(menu.getParentId());
|
||||
list.add(sysMenu);
|
||||
selectMenuParentId1(list,sysMenu);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID查询权限
|
||||
*
|
||||
|
@ -344,8 +321,6 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取路由名称
|
||||
*
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.system.domain.AsUserDept;
|
||||
import com.muyu.system.domain.SysNotice;
|
||||
import com.muyu.system.domain.req.SysNoticeRequest;
|
||||
import com.muyu.system.domain.resp.SysNoticeResponse;
|
||||
import com.muyu.system.mapper.AsUserDeptMapper;
|
||||
import com.muyu.system.mapper.SysNoticeMapper;
|
||||
import com.muyu.system.mapper.SysUserMapper;
|
||||
import com.muyu.system.service.SysNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 公告 服务层实现
|
||||
|
@ -30,10 +19,6 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
|||
@Autowired
|
||||
private SysNoticeMapper noticeMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private AsUserDeptMapper asUserDeptMapper;
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
|
@ -54,40 +39,10 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
|||
* @return 公告集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice) {
|
||||
public List<SysNotice> selectNoticeList (SysNotice notice) {
|
||||
return noticeMapper.selectNoticeList(notice);
|
||||
}
|
||||
|
||||
|
||||
public List<AsUserDept> handleList(List<Long> personnelList ,List<List<Long>> sectionList,Long noticeId){
|
||||
ArrayList<Long> longs = new ArrayList<>();
|
||||
if (sectionList!=null && sectionList.size()!=0){
|
||||
sectionList.stream()
|
||||
.map(section -> {
|
||||
for (Long aLong : section) {
|
||||
longs.add(aLong);
|
||||
}
|
||||
return null;
|
||||
}).collect(Collectors.toList());
|
||||
List<Long> sectionIds =longs.stream().distinct().toList();
|
||||
List<Long> userIds= sysUserMapper.selectDtptUser(sectionIds);
|
||||
if (userIds !=null){
|
||||
personnelList.addAll(userIds);
|
||||
}
|
||||
}
|
||||
personnelList= personnelList.stream().distinct().toList();
|
||||
System.out.println(personnelList);
|
||||
List<AsUserDept> asUserDepts = personnelList.stream()
|
||||
.map(personnel -> {
|
||||
AsUserDept asUserDept = new AsUserDept();
|
||||
asUserDept.setNoticeId(personnel);
|
||||
asUserDept.setNoticeId(noticeId);
|
||||
asUserDept.setCreateBy(SecurityUtils.getUsername());
|
||||
asUserDept.setCreateTime(new Date());
|
||||
return asUserDept;
|
||||
}).toList();
|
||||
return asUserDepts;
|
||||
}
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
|
@ -96,28 +51,8 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertNotice (SysNotice notice) {
|
||||
int i = noticeMapper.insertNotice(notice);
|
||||
if (notice.getNoticeType().equals("1")){
|
||||
Long noticeId = notice.getNoticeId();
|
||||
List<Long> personnnelList = notice.getPersonnelList();
|
||||
List<List<Long>> sectionList = notice.getSectionList();
|
||||
List<AsUserDept> asUserDepts = handleList(personnnelList, sectionList, noticeId);
|
||||
asUserDeptMapper.insertBachAsUserDept(asUserDepts);
|
||||
}else {
|
||||
List<Long> userIds = noticeMapper.selectUser();
|
||||
List<AsUserDept> asUserDepts = userIds.stream().map(id -> {
|
||||
AsUserDept asUserDept = new AsUserDept();
|
||||
asUserDept.setNoticeId(notice.getNoticeId());
|
||||
asUserDept.setCreateTime(new Date());
|
||||
asUserDept.setUserId(id);
|
||||
asUserDept.setCreateBy(SecurityUtils.getUsername());
|
||||
return asUserDept;
|
||||
}).toList();
|
||||
asUserDeptMapper.insertBachAsUserDept(asUserDepts);
|
||||
}
|
||||
return i;
|
||||
return noticeMapper.insertNotice(notice);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,13 +90,4 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
|||
public int deleteNoticeByIds (Long[] noticeIds) {
|
||||
return noticeMapper.deleteNoticeByIds(noticeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<SysNoticeResponse>> getNoticeList(SysNoticeRequest sysNoticeRequest) {
|
||||
sysNoticeRequest.setNoticeId(
|
||||
SecurityUtils.getUserId()
|
||||
);
|
||||
List<SysNoticeResponse> noticeList= noticeMapper.getNoticeList(sysNoticeRequest);
|
||||
return Result.success(noticeList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
|||
@Autowired
|
||||
private SysUserPostMapper userPostMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询岗位信息集合
|
||||
*
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
package com.muyu.system.service.service;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.system.domain.AsUserDept;
|
||||
import com.muyu.system.domain.resp.AsUserDeotNumResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与部门中间Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-14
|
||||
*/
|
||||
public interface IAsUserDeptService
|
||||
{
|
||||
/**
|
||||
* 查询用户与部门中间
|
||||
*
|
||||
* @param id 用户与部门中间主键
|
||||
* @return 用户与部门中间
|
||||
*/
|
||||
public AsUserDept selectAsUserDeptById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户与部门中间列表
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 用户与部门中间集合
|
||||
*/
|
||||
public List<AsUserDept> selectAsUserDeptList(AsUserDept asUserDept);
|
||||
|
||||
/**
|
||||
* 新增用户与部门中间
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAsUserDept(AsUserDept asUserDept);
|
||||
|
||||
/**
|
||||
* 修改用户与部门中间
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAsUserDept(AsUserDept asUserDept);
|
||||
|
||||
/**
|
||||
* 批量删除用户与部门中间
|
||||
*
|
||||
* @param ids 需要删除的用户与部门中间主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAsUserDeptByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除用户与部门中间信息
|
||||
*
|
||||
* @param id 用户与部门中间主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAsUserDeptById(Long id);
|
||||
|
||||
Result updateAsUserDeptRead(Long id);
|
||||
|
||||
Result<AsUserDeotNumResponse> getNum(Long noticeId);
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
package com.muyu.system.service.service.impl;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.system.domain.AsUserDept;
|
||||
import com.muyu.system.domain.resp.AsUserDeotNumResponse;
|
||||
import com.muyu.system.mapper.AsUserDeptMapper;
|
||||
import com.muyu.system.service.service.IAsUserDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户与部门中间Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-14
|
||||
*/
|
||||
@Service
|
||||
public class AsUserDeptServiceImpl implements IAsUserDeptService
|
||||
{
|
||||
@Autowired
|
||||
private AsUserDeptMapper asUserDeptMapper;
|
||||
|
||||
/**
|
||||
* 查询用户与部门中间
|
||||
*
|
||||
* @param id 用户与部门中间主键
|
||||
* @return 用户与部门中间
|
||||
*/
|
||||
@Override
|
||||
public AsUserDept selectAsUserDeptById(Long id)
|
||||
{
|
||||
return asUserDeptMapper.selectAsUserDeptById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户与部门中间列表
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 用户与部门中间
|
||||
*/
|
||||
@Override
|
||||
public List<AsUserDept> selectAsUserDeptList(AsUserDept asUserDept)
|
||||
{
|
||||
return asUserDeptMapper.selectAsUserDeptList(asUserDept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户与部门中间
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAsUserDept(AsUserDept asUserDept)
|
||||
{
|
||||
asUserDept.setCreateTime(DateUtils.getNowDate());
|
||||
return asUserDeptMapper.insertAsUserDept(asUserDept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户与部门中间
|
||||
*
|
||||
* @param asUserDept 用户与部门中间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAsUserDept(AsUserDept asUserDept)
|
||||
{
|
||||
asUserDept.setUpdateTime(DateUtils.getNowDate());
|
||||
return asUserDeptMapper.updateAsUserDept(asUserDept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户与部门中间
|
||||
*
|
||||
* @param ids 需要删除的用户与部门中间主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAsUserDeptByIds(Long[] ids)
|
||||
{
|
||||
return asUserDeptMapper.deleteAsUserDeptByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户与部门中间信息
|
||||
*
|
||||
* @param id 用户与部门中间主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAsUserDeptById(Long id)
|
||||
{
|
||||
return asUserDeptMapper.deleteAsUserDeptById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result updateAsUserDeptRead(Long id) {
|
||||
asUserDeptMapper.updateAsUserDeptRead(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<AsUserDeotNumResponse> getNum(Long noticeId) {
|
||||
Long num = asUserDeptMapper.selectAsUserDeptNum(noticeId);
|
||||
Long readNum = asUserDeptMapper.selectAsUserDeptReadNum(noticeId);
|
||||
long noreadNum= num-readNum;
|
||||
return Result.success(AsUserDeotNumResponse.builder()
|
||||
.num(num)
|
||||
.readNum(readNum)
|
||||
.noReadNum(noreadNum)
|
||||
.build());
|
||||
}
|
||||
}
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
<?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.muyu.system.mapper.AsUserDeptMapper">
|
||||
|
||||
<resultMap type="com.muyu.system.domain.AsUserDept" id="AsUserDeptResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="isRead" column="is_read" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAsUserDeptVo">
|
||||
select id, user_id, notice_id, is_read, create_by, create_time, update_by, update_time, remark from as_user_dept
|
||||
</sql>
|
||||
|
||||
<select id="selectAsUserDeptList" parameterType="com.muyu.system.domain.AsUserDept" resultMap="AsUserDeptResult">
|
||||
<include refid="selectAsUserDeptVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="noticeId != null "> and notice_id = #{noticeId}</if>
|
||||
<if test="isRead != null and isRead != ''"> and is_read = #{isRead}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAsUserDeptById" parameterType="Long" resultMap="AsUserDeptResult">
|
||||
<include refid="selectAsUserDeptVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectAsUserDeptNum" resultType="java.lang.Long">
|
||||
select count(*) from as_user_dept where notice_id -#{noticeId}
|
||||
</select>
|
||||
<select id="selectAsUserDeptReadNum" resultType="java.lang.Long">
|
||||
select count(*) from as_user_dept where notice_id - #{noticeId} and is_read = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertAsUserDept" parameterType="com.muyu.system.domain.AsUserDept" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into as_user_dept
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="noticeId != null">notice_id,</if>
|
||||
<if test="isRead != null">is_read,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="noticeId != null">#{noticeId},</if>
|
||||
<if test="isRead != null">#{isRead},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBachAsUserDept">
|
||||
INSERT INTO `as_user_dept` (`user_id`, `notice_id`, `create_by`, `create_time`)
|
||||
VALUES
|
||||
<foreach collection="asUserDepts" separator="," item="asUserDept">
|
||||
(#{asUserDept.userId}, #{asUserDept.noticeId}, #{asUserDept.createBy}, #{asUserDept.createTime})
|
||||
</foreach>
|
||||
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="updateAsUserDept" parameterType="com.muyu.system.domain.AsUserDept">
|
||||
update as_user_dept
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="noticeId != null">notice_id = #{noticeId},</if>
|
||||
<if test="isRead != null">is_read = #{isRead},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateAsUserDeptRead">
|
||||
update as_user_dept set is_read =0 where id =#{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAsUserDeptById" parameterType="Long">
|
||||
delete from as_user_dept where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAsUserDeptByIds" parameterType="String">
|
||||
delete from as_user_dept where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -50,18 +50,6 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getNoticeList" resultType="com.muyu.system.domain.resp.SysNoticeResponse">
|
||||
select id,a.notice_id,is_read,a.create_by,a.create_time,notice_title,notice_content,notice_type
|
||||
from as_user_dept a join sys_notice n on a.notice_id=n.notice_id
|
||||
where a.user_id=#{userId}
|
||||
<if test="isRead !=null and isRead!= ''">
|
||||
and is_read =#{isRead}
|
||||
</if>
|
||||
<if test="noticeType !=null and noticeType!= ''">
|
||||
and n.notice_type =#{noticeType}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="com.muyu.system.domain.SysNotice">
|
||||
insert into sys_notice (
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName} or u.email= #{userName} and u.del_flag = '0'
|
||||
where u.user_name = #{userName} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
|
@ -183,13 +183,6 @@
|
|||
and del_flag = '0'
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectDtptUser" resultType="java.lang.Long">
|
||||
select user_id from sys_user where dept_id in (
|
||||
<foreach collection="sectionIds" separator="-" item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="com.muyu.common.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
<module>muyu-gen</module>
|
||||
<module>muyu-job</module>
|
||||
<module>muyu-file</module>
|
||||
<module>muyu-kvt</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -70,15 +69,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -14,11 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 115.159.211.196:8848
|
||||
namespace: b8ace5a6-28a3-4126-b109-9b6623c58dc0
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
33
pom.xml
33
pom.xml
|
@ -9,8 +9,8 @@
|
|||
<version>3.6.3</version>
|
||||
|
||||
<name>muyu</name>
|
||||
|
||||
<description>微服务系统</description>
|
||||
<url>http://www.muyu.vip</url>
|
||||
<description>若依微服务系统</description>
|
||||
|
||||
<properties>
|
||||
<muyu.version>3.6.3</muyu.version>
|
||||
|
@ -252,40 +252,15 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- 要将源码放上去,需要加入这个插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<configuration>
|
||||
<attach>true</attach>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>releases</id>
|
||||
<name>releases</name>
|
||||
<url>http://nexus.muyu.com:8081/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>http://nexus.muyu.com:8081/repository/maven-public/</url>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
|
@ -296,7 +271,7 @@
|
|||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>http://nexus.muyu.com:8081/repository/maven-public/</url>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
|
|
|
@ -67,8 +67,8 @@ create table sys_user (
|
|||
-- ----------------------------
|
||||
-- 初始化-用户信息表数据
|
||||
-- ----------------------------
|
||||
insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '115.159.211.196', sysdate(), 'admin', sysdate(), '', null, '管理员');
|
||||
insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '115.159.211.196', sysdate(), 'admin', sysdate(), '', null, '测试员');
|
||||
insert into sys_user values(1, 103, 'admin', '若依', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管理员');
|
||||
insert into sys_user values(2, 105, 'ry', '若依', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '测试员');
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
|
|
|
@ -40,7 +40,7 @@ insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_mod
|
|||
(5,'muyu-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: admin\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: root\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.muyu.system\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 系统模块接口文档\n license: Powered By muyu\n licenseUrl: https://muyu.vip','48e0ed4a040c402bdc2444213a82c910','2020-11-20 00:00:00','2022-09-29 02:49:09','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''),
|
||||
(6,'muyu-gen-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: root\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.muyu.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 代码生成接口文档\n license: Powered By muyu\n licenseUrl: https://muyu.vip\n\n# 代码生成\ngen:\n # 作者\n author: muyu\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.muyu.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n','eb592420b3fceae1402881887b8a6a0d','2020-11-20 00:00:00','2022-09-29 02:49:42','nacos','0:0:0:0:0:0:0:1','','','代码生成','null','null','yaml','',''),
|
||||
(7,'muyu-job-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: root\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.muyu.job.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 定时任务接口文档\n license: Powered By muyu\n licenseUrl: https://muyu.vip\n','edcf0e3fe13fea07b4ec08b1088f30b3','2020-11-20 00:00:00','2022-09-29 02:50:50','nacos','0:0:0:0:0:0:0:1','','','定时任务','null','null','yaml','',''),
|
||||
(8,'muyu-file-dev.yml','DEFAULT_GROUP','# 本地文件上传 \r\nfile:\r\n domain: http://115.159.211.196:9300\r\n path: D:/muyu/uploadPath\r\n prefix: /statics\r\n\r\n# FastDFS配置\r\nfdfs:\r\n domain: http://8.129.231.12\r\n soTimeout: 3000\r\n connectTimeout: 2000\r\n trackerList: 8.129.231.12:22122\r\n\r\n# Minio配置\r\nminio:\r\n url: http://8.129.231.12:9000\r\n accessKey: minioadmin\r\n secretKey: minioadmin\r\n bucketName: test','5382b93f3d8059d6068c0501fdd41195','2020-11-20 00:00:00','2020-12-21 21:01:59',NULL,'0:0:0:0:0:0:0:1','','','文件服务','null','null','yaml',NULL,''),
|
||||
(8,'muyu-file-dev.yml','DEFAULT_GROUP','# 本地文件上传 \r\nfile:\r\n domain: http://127.0.0.1:9300\r\n path: D:/muyu/uploadPath\r\n prefix: /statics\r\n\r\n# FastDFS配置\r\nfdfs:\r\n domain: http://8.129.231.12\r\n soTimeout: 3000\r\n connectTimeout: 2000\r\n trackerList: 8.129.231.12:22122\r\n\r\n# Minio配置\r\nminio:\r\n url: http://8.129.231.12:9000\r\n accessKey: minioadmin\r\n secretKey: minioadmin\r\n bucketName: test','5382b93f3d8059d6068c0501fdd41195','2020-11-20 00:00:00','2020-12-21 21:01:59',NULL,'0:0:0:0:0:0:0:1','','','文件服务','null','null','yaml',NULL,''),
|
||||
(9,'sentinel-muyu-gateway','DEFAULT_GROUP','[\r\n {\r\n \"resource\": \"muyu-auth\",\r\n \"count\": 500,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"muyu-system\",\r\n \"count\": 1000,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"muyu-gen\",\r\n \"count\": 200,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"muyu-job\",\r\n \"count\": 300,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n }\r\n]','9f3a3069261598f74220bc47958ec252','2020-11-20 00:00:00','2020-11-20 00:00:00',NULL,'0:0:0:0:0:0:0:1','','','限流策略','null','null','json',NULL,'');
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue