refactor: 移除冗余类,优化DTO和查询条件注解

pull/872/head
Jie Zheng 2025-01-15 18:14:14 +08:00
parent 4061a07850
commit 311396f86c
68 changed files with 371 additions and 356 deletions

View File

@ -1,5 +1,7 @@
package me.zhengjie.base;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -15,14 +17,21 @@ import java.sql.Timestamp;
@Setter
public class BaseDTO implements Serializable {
@ApiModelProperty(value = "创建人")
private String createBy;
@ApiModelProperty(value = "修改人")
private String updateBy;
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime;
@ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp updateTime;
@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.base;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@ -54,12 +55,14 @@ public class BaseEntity implements Serializable {
@CreationTimestamp
@Column(name = "create_time", updatable = false)
@ApiModelProperty(value = "创建时间", hidden = true)
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime;
@UpdateTimestamp
@Column(name = "update_time")
@ApiModelProperty(value = "更新时间", hidden = true)
@ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp updateTime;
/* 分组校验 */

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.config;
package me.zhengjie.config.webConfig;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
@ -23,7 +23,7 @@ import java.io.File;
/**
* @date 2018-12-28
* @author https://blog.csdn.net/llibin1024530411/article/details/79474953
* @author <a href="https://blog.csdn.net/llibin1024530411/article/details/79474953">...</a>
*/
@Configuration
public class MultipartConfig {

View File

@ -1,98 +0,0 @@
/*
* Copyright 2019-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.exception;
/**
*
*
* @author: liaojinlong
* @date: 2020/6/10 18:06
*/
public class BadConfigurationException extends RuntimeException {
/**
* Constructs a new runtime exception with {@code null} as its
* detail message. The cause is not initialized, and may subsequently be
* initialized by a call to {@link #initCause}.
*/
public BadConfigurationException() {
super();
}
/**
* Constructs a new runtime exception with the specified detail message.
* The cause is not initialized, and may subsequently be initialized by a
* call to {@link #initCause}.
*
* @param message the detail message. The detail message is saved for
* later retrieval by the {@link #getMessage()} method.
*/
public BadConfigurationException(String message) {
super(message);
}
/**
* Constructs a new runtime exception with the specified detail message and
* cause. <p>Note that the detail message associated with
* {@code cause} is <i>not</i> automatically incorporated in
* this runtime exception's detail message.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
* @since 1.4
*/
public BadConfigurationException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructs a new runtime exception with the specified cause and a
* detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
* {@code cause}). This constructor is useful for runtime exceptions
* that are little more than wrappers for other throwables.
*
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
* @since 1.4
*/
public BadConfigurationException(Throwable cause) {
super(cause);
}
/**
* Constructs a new runtime exception with the specified detail
* message, cause, suppression enabled or disabled, and writable
* stack trace enabled or disabled.
*
* @param message the detail message.
* @param cause the cause. (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @param enableSuppression whether or not suppression is enabled
* or disabled
* @param writableStackTrace whether or not the stack trace should
* be writable
* @since 1.7
*/
protected BadConfigurationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@ -15,6 +15,8 @@
*/
package me.zhengjie.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -29,20 +31,19 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class TableInfo {
/** 表名称 */
@ApiModelProperty(value = "表名称")
private Object tableName;
/** 创建日期 */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期yyyy-MM-dd HH:mm:ss")
private Object createTime;
/** 数据库引擎 */
@ApiModelProperty(value = "数据库引擎")
private Object engine;
/** 编码集 */
@ApiModelProperty(value = "编码集")
private Object coding;
/** 备注 */
@ApiModelProperty(value = "备注")
private Object remark;
}

View File

@ -20,7 +20,6 @@ import me.zhengjie.domain.ColumnInfo;
import me.zhengjie.domain.vo.TableInfo;
import me.zhengjie.utils.PageResult;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

View File

@ -27,6 +27,7 @@ import java.io.Serializable;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
</#if>
import io.swagger.annotations.ApiModelProperty;
/**
* @website https://eladmin.vip
@ -40,7 +41,9 @@ public class ${className}Dto implements Serializable {
<#list columns as column>
<#if column.remark != ''>
/** ${column.remark} */
@ApiModelProperty(value = "${column.remark}")
<#else>
@ApiModelProperty(value = "${column.changeColumnName}")
</#if>
<#if column.columnKey = 'PRI'>
<#if !auto && pkColumnType = 'Long'>

View File

@ -28,6 +28,7 @@ import java.util.List;
<#if queryColumns??>
import me.zhengjie.annotation.Query;
</#if>
import io.swagger.annotations.ApiModelProperty;
/**
* @website https://eladmin.vip

View File

@ -15,6 +15,8 @@
*/
package me.zhengjie.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@ -36,41 +38,44 @@ public class SysLog implements Serializable {
@Id
@Column(name = "log_id")
@ApiModelProperty(value = "ID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/** 操作用户 */
@ApiModelProperty(value = "操作用户")
private String username;
/** 描述 */
@ApiModelProperty(value = "描述")
private String description;
/** 方法名 */
@ApiModelProperty(value = "方法名")
private String method;
/** 参数 */
@ApiModelProperty(value = "参数")
private String params;
/** 日志类型 */
@ApiModelProperty(value = "日志类型")
private String logType;
/** 请求ip */
@ApiModelProperty(value = "请求ip")
private String requestIp;
/** 地址 */
@ApiModelProperty(value = "地址")
private String address;
/** 浏览器 */
@ApiModelProperty(value = "浏览器")
private String browser;
/** 请求耗时 */
@ApiModelProperty(value = "请求耗时")
private Long time;
/** 异常详细 */
@ApiModelProperty(value = "异常详细")
private byte[] exceptionDetail;
/** 创建日期 */
@CreationTimestamp
@ApiModelProperty(value = "创建日期yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime;
public SysLog(String logType, Long time) {

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@ -26,21 +27,30 @@ import java.sql.Timestamp;
@Data
public class SysLogErrorDto implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "用户名")
private String username;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "方法")
private String method;
@ApiModelProperty(value = "参数")
private String params;
@ApiModelProperty(value = "浏览器")
private String browser;
@ApiModelProperty(value = "请求ip")
private String requestIp;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "创建时间")
private Timestamp createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -28,15 +29,19 @@ import java.util.List;
@Data
public class SysLogQueryCriteria {
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "username,description,address,requestIp,method,params")
private String blurry;
@Query
@ApiModelProperty(value = "用户名")
private String username;
@Query
@ApiModelProperty(value = "日志类型")
private String logType;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@ -26,15 +27,21 @@ import java.sql.Timestamp;
@Data
public class SysLogSmallDto implements Serializable {
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "请求IP")
private String requestIp;
@ApiModelProperty(value = "耗时")
private Long time;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "浏览器")
private String browser;
@ApiModelProperty(value = "创建时间")
private Timestamp createTime;
}

View File

@ -17,7 +17,7 @@
*
*/
package me.zhengjie.modules.maint.util;
package me.zhengjie.modules.maint.domain.enums;
import lombok.extern.slf4j.Slf4j;
/**

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -28,44 +29,27 @@ import java.io.Serializable;
@Setter
public class AppDto extends BaseDTO implements Serializable {
/**
*
*/
@ApiModelProperty(value = "ID")
private Long id;
/**
*
*/
@ApiModelProperty(value = "应用名称")
private String name;
/**
*
*/
@ApiModelProperty(value = "端口")
private Integer port;
/**
*
*/
@ApiModelProperty(value = "上传目录")
private String uploadPath;
/**
*
*/
@ApiModelProperty(value = "部署目录")
private String deployPath;
/**
*
*/
@ApiModelProperty(value = "备份目录")
private String backupPath;
/**
*
*/
@ApiModelProperty(value = "启动脚本")
private String startScript;
/**
*
*/
@ApiModelProperty(value = "部署脚本")
private String deployScript;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,12 +28,11 @@ import java.util.List;
@Data
public class AppQueryCriteria{
/**
*
*/
@ApiModelProperty(value = "模糊")
@Query(type = Query.Type.INNER_LIKE)
private String name;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -28,28 +29,18 @@ import java.io.Serializable;
@Setter
public class DatabaseDto extends BaseDTO implements Serializable {
/**
* id
*/
@ApiModelProperty(value = "ID")
private String id;
/**
*
*/
@ApiModelProperty(value = "数据库名称")
private String name;
/**
*
*/
@ApiModelProperty(value = "数据库连接地址")
private String jdbcUrl;
/**
*
*/
@ApiModelProperty(value = "数据库密码")
private String pwd;
/**
*
*/
@ApiModelProperty(value = "用户名")
private String userName;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,18 +28,15 @@ import java.util.List;
@Data
public class DatabaseQueryCriteria{
/**
*
*/
@ApiModelProperty(value = "模糊")
@Query(type = Query.Type.INNER_LIKE)
private String name;
/**
*
*/
@Query
@ApiModelProperty(value = "数据库连接地址")
private String jdbcUrl;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -16,6 +16,7 @@
package me.zhengjie.modules.maint.service.dto;
import cn.hutool.core.collection.CollectionUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -33,23 +34,19 @@ import java.util.stream.Collectors;
@Setter
public class DeployDto extends BaseDTO implements Serializable {
/**
*
*/
@ApiModelProperty(value = "ID")
private String id;
@ApiModelProperty(value = "应用")
private AppDto app;
/**
*
*/
@ApiModelProperty(value = "服务器")
private Set<ServerDeployDto> deploys;
@ApiModelProperty(value = "服务器名称")
private String servers;
/**
*
*/
@ApiModelProperty(value = "服务状态")
private String status;
public String getServers() {

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@ -26,33 +27,21 @@ import java.sql.Timestamp;
@Data
public class DeployHistoryDto implements Serializable {
/**
*
*/
@ApiModelProperty(value = "ID")
private String id;
/**
*
*/
@ApiModelProperty(value = "应用名称")
private String appName;
/**
* IP
*/
@ApiModelProperty(value = "部署IP")
private String ip;
/**
*
*/
@ApiModelProperty(value = "部署时间")
private Timestamp deployDate;
/**
*
*/
@ApiModelProperty(value = "部署人员")
private String deployUser;
/**
*
*/
@ApiModelProperty(value = "部署编号")
private Long deployId;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,15 +28,15 @@ import java.util.List;
@Data
public class DeployHistoryQueryCriteria{
/**
*
*/
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "appName,ip,deployUser")
private String blurry;
@Query
@ApiModelProperty(value = "部署编号")
private Long deployId;
@ApiModelProperty(value = "部署时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> deployDate;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,12 +28,11 @@ import java.util.List;
@Data
public class DeployQueryCriteria{
/**
*
*/
@ApiModelProperty(value = "应用名称")
@Query(type = Query.Type.INNER_LIKE, propName = "name", joinName = "app")
private String appName;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -29,16 +30,22 @@ import java.util.Objects;
@Setter
public class ServerDeployDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "IP")
private String ip;
@ApiModelProperty(value = "端口")
private Integer port;
@ApiModelProperty(value = "账号")
private String account;
@ApiModelProperty(value = "密码")
private String password;
@Override

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.maint.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,12 +28,11 @@ import java.util.List;
@Data
public class ServerDeployQueryCriteria{
/**
*
*/
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,ip,account")
private String blurry;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -20,15 +20,14 @@ import com.jcraft.jsch.ChannelShell;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import lombok.extern.slf4j.Slf4j;
import java.io.*;
import java.util.Vector;
/**
* shell
*
* @author: ZhangHouYing
* @date: 2019/8/10
* @author ZhangHouYing
* @date 2019/8/10
*/
@Slf4j
public class ExecuteShellUtil {

View File

@ -18,6 +18,7 @@ package me.zhengjie.modules.maint.util;
import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.SCPClient;
import com.google.common.collect.Maps;
import me.zhengjie.utils.StringUtils;
import java.io.IOException;
import java.util.Map;
@ -26,17 +27,20 @@ import java.util.logging.Logger;
/**
* linux
* @author: ZhangHouYing
* @date: 2019-08-10 10:06
* @author ZhangHouYing
* @date 2019-08-10 10:06
*/
public class ScpClientUtil {
static private Map<String,ScpClientUtil> instance = Maps.newHashMap();
private final String ip;
private final int port;
private final String username;
private final String password;
static private final Map<String,ScpClientUtil> instance = Maps.newHashMap();
static synchronized public ScpClientUtil getInstance(String ip, int port, String username, String password) {
if (instance.get(ip) == null) {
instance.put(ip, new ScpClientUtil(ip, port, username, password));
}
instance.computeIfAbsent(ip, i -> new ScpClientUtil(i, port, username, password));
return instance.get(ip);
}
@ -81,7 +85,7 @@ public class ScpClientUtil {
System.err.println("authentication failed");
}
SCPClient client = new SCPClient(conn);
if ((mode == null) || (mode.length() == 0)) {
if (StringUtils.isBlank(mode)) {
mode = "0600";
}
if (remoteFileName == null) {
@ -95,11 +99,4 @@ public class ScpClientUtil {
conn.close();
}
}
private String ip;
private int port;
private String username;
private String password;
}

View File

@ -17,16 +17,19 @@ package me.zhengjie.modules.maint.util;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.util.StringUtils;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.maint.domain.enums.DataTypeEnum;
import me.zhengjie.utils.CloseUtil;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.sql.*;
import java.nio.file.Files;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
/**
@ -113,7 +116,6 @@ public class SqlUtils {
connection.close();
} catch (Exception e) {
log.error(e.getMessage(),e);
log.error("connection close error" + e.getMessage());
}
}
}
@ -126,7 +128,7 @@ public class SqlUtils {
return true;
}
} catch (Exception e) {
log.info("Get connection failed:" + e.getMessage());
log.error("Get connection failed:{}", e.getMessage());
} finally {
releaseConnection(connection);
}
@ -146,27 +148,26 @@ public class SqlUtils {
return "success";
}
/**
* sql
* @param connection /
* @param sqlList /
*/
public static void batchExecute(Connection connection, List<String> sqlList) {
Statement st = null;
try {
st = connection.createStatement();
try (Statement st = connection.createStatement()) {
for (String sql : sqlList) {
// 去除末尾的分号
if (sql.endsWith(";")) {
sql = sql.substring(0, sql.length() - 1);
}
// 检查 SQL 语句是否为空
if (!sql.trim().isEmpty()) {
st.addBatch(sql);
}
}
st.executeBatch();
} catch (SQLException throwables) {
throwables.printStackTrace();
} finally {
CloseUtil.close(st);
} catch (SQLException e) {
log.error("SQL脚本批量执行发生异常: {},错误代码: {}", e.getMessage(), e.getErrorCode());
}
}
@ -174,29 +175,31 @@ public class SqlUtils {
* sql
* @param sqlFile /
* @return /
* @throws Exception e
*/
private static List<String> readSqlList(File sqlFile) throws Exception {
List<String> sqlList = Lists.newArrayList();
private static List<String> readSqlList(File sqlFile) {
List<String> sqlList = new ArrayList<>();
StringBuilder sb = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(sqlFile), StandardCharsets.UTF_8))) {
String tmp;
while ((tmp = reader.readLine()) != null) {
log.info("line:{}", tmp);
if (tmp.endsWith(";")) {
sb.append(tmp);
sqlList.add(sb.toString());
sb.delete(0, sb.length());
} else {
sb.append(tmp);
}
}
if (!"".endsWith(sb.toString().trim())) {
sqlList.add(sb.toString());
}
}
try (BufferedReader reader = Files.newBufferedReader(sqlFile.toPath(), StandardCharsets.UTF_8)) {
String line;
while ((line = reader.readLine()) != null) {
log.info("line: {}", line);
sb.append(line.trim());
if (line.trim().endsWith(";")) {
sqlList.add(sb.toString());
// 清空 StringBuilder
sb.setLength(0);
} else {
// 在行之间加一个空格
sb.append(" ");
}
}
if (sb.length() > 0) {
sqlList.add(sb.toString().trim());
}
} catch (Exception e) {
log.error("读取SQL文件时发生异常: {}", e.getMessage());
}
return sqlList;
}
@ -228,5 +231,4 @@ public class SqlUtils {
}
return jdbcUrl;
}
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.quartz.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,12 +28,15 @@ import java.util.List;
@Data
public class JobQueryCriteria {
@ApiModelProperty(value = "任务名称")
@Query(type = Query.Type.INNER_LIKE)
private String jobName;
@Query
@ApiModelProperty(value = "是否成功")
private Boolean isSuccess;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -29,7 +29,6 @@ import me.zhengjie.modules.quartz.utils.QuartzManage;
import me.zhengjie.utils.*;
import org.quartz.CronExpression;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
@ -129,7 +128,6 @@ public class QuartzJobServiceImpl implements QuartzJobService {
}
}
@Async
@Override
@Transactional(rollbackFor = Exception.class)
public void executionSubJob(String[] tasks) throws InterruptedException {

View File

@ -32,7 +32,7 @@ public class TestTask {
}
public void run1(String str){
log.info("run1 执行成功,参数为: {}" + str);
log.info("run1 执行成功,参数为: {}", str);
}
public void run2(){

View File

@ -32,7 +32,6 @@ import me.zhengjie.utils.ThrowableUtil;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.*;
@ -43,13 +42,14 @@ import java.util.concurrent.*;
* @author /
* @date 2019-01-07
*/
@Async
public class ExecutionJob extends QuartzJobBean {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
// 此处仅供参考,可根据任务执行情况自定义线程池参数
private final ThreadPoolTaskExecutor executor = SpringBeanHolder.getBean("elAsync");
private final ThreadPoolTaskExecutor executor = SpringBeanHolder.getBean("taskAsync");
@Override
public void executeInternal(JobExecutionContext context) {
@ -81,7 +81,7 @@ public class ExecutionJob extends QuartzJobBean {
}
// 任务状态
log.setIsSuccess(true);
logger.info("任务执行成功,任务名称:" + quartzJob.getJobName() + ", 执行时间:" + times + "毫秒");
logger.info("任务执行成功,任务名称:{}, 执行时间:{}毫秒", quartzJob.getJobName(), times);
// 判断是否存在子任务
if(StringUtils.isNotBlank(quartzJob.getSubTask())){
String[] tasks = quartzJob.getSubTask().split("[,]");
@ -92,7 +92,7 @@ public class ExecutionJob extends QuartzJobBean {
if(StringUtils.isNotBlank(uuid)) {
redisUtils.set(uuid, false);
}
logger.error("任务执行失败,任务名称:" + quartzJob.getJobName());
logger.error("任务执行失败,任务名称:{}", quartzJob.getJobName());
long times = System.currentTimeMillis() - startTime;
log.setTime(times);
// 任务状态 0成功 1失败
@ -100,8 +100,8 @@ public class ExecutionJob extends QuartzJobBean {
log.setExceptionDetail(ThrowableUtil.getStackTrace(e));
// 任务如果失败了则暂停
if(quartzJob.getPauseAfterFailure() != null && quartzJob.getPauseAfterFailure()){
quartzJob.setIsPause(false);
//更新状态
quartzJob.setIsPause(false);
quartzJobService.updateIsPause(quartzJob);
}
if(quartzJob.getEmail() != null){

View File

@ -18,8 +18,8 @@ package me.zhengjie.modules.security.config.enums;
/**
*
*
* @author: liaojinlong
* @date: 2020/6/10 17:40
* @author liaojinlong
* @date 2020/6/10 17:40
*/
public enum LoginCodeEnum {
@ -39,5 +39,8 @@ public enum LoginCodeEnum {
*
*/
GIF,
/**
*
*/
SPEC
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.security.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
@ -28,12 +29,16 @@ import javax.validation.constraints.NotBlank;
public class AuthUserDto {
@NotBlank
@ApiModelProperty(value = "用户名")
private String username;
@NotBlank
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "验证码")
private String code;
@ApiModelProperty(value = "验证码的key")
private String uuid = "";
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.security.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -30,5 +31,6 @@ import org.springframework.security.core.GrantedAuthority;
@AllArgsConstructor
public class AuthorityDto implements GrantedAuthority {
@ApiModelProperty(value = "角色名")
private String authority;
}

View File

@ -34,10 +34,13 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class JwtUserDto implements UserDetails {
@ApiModelProperty(value = "用户")
private final UserLoginDto user;
@ApiModelProperty(value = "数据权限")
private final List<Long> dataScopes;
@ApiModelProperty(value = "角色权限")
private final List<AuthorityDto> authorities;
@Setter

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.security.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -29,45 +30,27 @@ import java.util.Date;
@NoArgsConstructor
public class OnlineUserDto {
/**
*
*/
@ApiModelProperty(value = "用户名")
private String userName;
/**
*
*/
@ApiModelProperty(value = "昵称")
private String nickName;
/**
*
*/
@ApiModelProperty(value = "岗位")
private String dept;
/**
*
*/
@ApiModelProperty(value = "浏览器")
private String browser;
/**
* IP
*/
@ApiModelProperty(value = "IP")
private String ip;
/**
*
*/
@ApiModelProperty(value = "地址")
private String address;
/**
* token
*/
@ApiModelProperty(value = "token")
private String key;
/**
*
*/
@ApiModelProperty(value = "登录时间")
private Date loginTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
@ -27,9 +28,12 @@ import java.io.Serializable;
@AllArgsConstructor
public class MenuMetaVo implements Serializable {
@ApiModelProperty(value = "菜单标题")
private String title;
@ApiModelProperty(value = "菜单图标")
private String icon;
@ApiModelProperty(value = "缓存")
private Boolean noCache;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ -27,19 +28,27 @@ import java.util.List;
@Data
public class MenuVo implements Serializable {
@ApiModelProperty(value = "菜单名称")
private String name;
@ApiModelProperty(value = "路径")
private String path;
@ApiModelProperty(value = "隐藏状态")
private Boolean hidden;
@ApiModelProperty(value = "重定向")
private String redirect;
@ApiModelProperty(value = "组件")
private String component;
@ApiModelProperty(value = "总是显示")
private Boolean alwaysShow;
@ApiModelProperty(value = "元数据")
private MenuMetaVo meta;
@ApiModelProperty(value = "子路由")
private List<MenuVo> children;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -25,7 +26,9 @@ import lombok.Data;
@Data
public class UserPassVo {
@ApiModelProperty(value = "旧密码")
private String oldPass;
@ApiModelProperty(value = "新密码")
private String newPass;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -30,28 +31,38 @@ import java.util.Objects;
@Setter
public class DeptDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "排序")
private Integer deptSort;
@ApiModelProperty(value = "子部门")
private List<DeptDto> children;
@ApiModelProperty(value = "上级部门")
private Long pid;
@ApiModelProperty(value = "子部门数量", hidden = true)
private Integer subCount;
@ApiModelProperty(value = "是否有子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否为叶子")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "部门全名")
public String getLabel() {
return name;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.DataPermission;
import me.zhengjie.annotation.Query;
@ -29,18 +30,23 @@ import java.util.List;
@DataPermission(fieldName = "id")
public class DeptQueryCriteria{
@ApiModelProperty(value = "名称")
@Query(type = Query.Type.INNER_LIKE)
private String name;
@Query
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@Query
@ApiModelProperty(value = "上级部门")
private Long pid;
@ApiModelProperty(value = "PID空查询", hidden = true)
@Query(type = Query.Type.IS_NULL, propName = "pid")
private Boolean pidIsNull;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ -25,7 +26,9 @@ import java.io.Serializable;
@Data
public class DeptSmallDto implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "名称")
private String name;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -28,13 +29,18 @@ import java.io.Serializable;
@Setter
public class DictDetailDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "字典ID")
private DictSmallDto dict;
@ApiModelProperty(value = "字典标签")
private String label;
@ApiModelProperty(value = "字典值")
private String value;
@ApiModelProperty(value = "排序")
private Integer dictSort;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@ -25,9 +26,11 @@ import me.zhengjie.annotation.Query;
@Data
public class DictDetailQueryCriteria {
@ApiModelProperty(value = "字典标签")
@Query(type = Query.Type.INNER_LIKE)
private String label;
@ApiModelProperty(value = "字典名称")
@Query(propName = "name",joinName = "dict")
private String dictName;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -29,11 +30,15 @@ import java.util.List;
@Setter
public class DictDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "字典详情")
private List<DictDetailDto> dictDetails;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "描述")
private String description;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@ -25,6 +26,7 @@ import me.zhengjie.annotation.Query;
@Data
public class DictQueryCriteria {
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,description")
private String blurry;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@ -27,5 +28,6 @@ import java.io.Serializable;
@Setter
public class DictSmallDto implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@ -31,12 +32,16 @@ import java.io.Serializable;
@NoArgsConstructor
public class JobDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "岗位排序")
private Integer jobSort;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
public JobDto(String name, Boolean enabled) {

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.zhengjie.annotation.Query;
@ -29,12 +30,15 @@ import java.util.List;
@NoArgsConstructor
public class JobQueryCriteria {
@ApiModelProperty(value = "岗位名称")
@Query(type = Query.Type.INNER_LIKE)
private String name;
@Query
@ApiModelProperty(value = "岗位状态")
private Boolean enabled;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@ -27,7 +28,9 @@ import java.io.Serializable;
@NoArgsConstructor
public class JobSmallDto implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "名称")
private String name;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -30,44 +31,62 @@ import java.util.Objects;
@Setter
public class MenuDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "子节点")
private List<MenuDto> children;
@ApiModelProperty(value = "类型")
private Integer type;
@ApiModelProperty(value = "权限")
private String permission;
@ApiModelProperty(value = "菜单标题")
private String title;
@ApiModelProperty(value = "排序")
private Integer menuSort;
@ApiModelProperty(value = "路径")
private String path;
@ApiModelProperty(value = "组件")
private String component;
@ApiModelProperty(value = "PID")
private Long pid;
@ApiModelProperty(value = "子节点数目")
private Integer subCount;
@ApiModelProperty(value = "是否为Iframe")
private Boolean iFrame;
@ApiModelProperty(value = "是否缓存")
private Boolean cache;
@ApiModelProperty(value = "是否隐藏")
private Boolean hidden;
@ApiModelProperty(value = "组件名称")
private String componentName;
@ApiModelProperty(value = "图标")
private String icon;
@ApiModelProperty(value = "是否存在子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
@ApiModelProperty(value = "是否叶子节点")
public Boolean getLeaf() {
return subCount <= 0;
}
@ApiModelProperty(value = "标题")
public String getLabel() {
return title;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@ -27,15 +28,19 @@ import java.util.List;
@Data
public class MenuQueryCriteria {
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "title,component,permission")
private String blurry;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
@ApiModelProperty(value = "PID空查询", hidden = true)
@Query(type = Query.Type.IS_NULL, propName = "pid")
private Boolean pidIsNull;
@Query
@ApiModelProperty(value = "PID")
private Long pid;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -30,18 +31,25 @@ import java.util.Set;
@Setter
public class RoleDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "菜单")
private Set<MenuDto> menus;
@ApiModelProperty(value = "部门")
private Set<DeptDto> depts;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "数据权限")
private String dataScope;
@ApiModelProperty(value = "级别")
private Integer level;
@ApiModelProperty(value = "描述")
private String description;
@Override

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@ -28,9 +29,11 @@ import java.util.List;
@Data
public class RoleQueryCriteria {
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,description")
private String blurry;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ -25,11 +26,15 @@ import java.io.Serializable;
@Data
public class RoleSmallDto implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "级别")
private Integer level;
@ApiModelProperty(value = "数据权限")
private String dataScope;
}

View File

@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service.dto;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -31,37 +32,53 @@ import java.util.Set;
@Setter
public class UserDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "角色")
private Set<RoleSmallDto> roles;
@ApiModelProperty(value = "岗位")
private Set<JobSmallDto> jobs;
@ApiModelProperty(value = "部门")
private DeptSmallDto dept;
@ApiModelProperty(value = "部门ID")
private Long deptId;
@ApiModelProperty(value = "用户名")
private String username;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "电话")
private String phone;
@ApiModelProperty(value = "性别")
private String gender;
@ApiModelProperty(value = "头像")
private String avatarName;
@ApiModelProperty(value = "头像路径")
private String avatarPath;
@ApiModelProperty(value = "密码")
@JSONField(serialize = false)
private String password;
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "管理员")
@JSONField(serialize = false)
private Boolean isAdmin = false;
@ApiModelProperty(value = "密码重置时间")
private Date pwdResetTime;
}

View File

@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service.dto;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
/**
* @author Zheng Jie
@ -24,8 +25,10 @@ import com.alibaba.fastjson.annotation.JSONField;
**/
public class UserLoginDto extends UserDto {
@ApiModelProperty(value = "密码")
@JSONField(serialize = false)
private String password;
@ApiModelProperty(value = "是否为管理员")
private Boolean isAdmin;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.io.Serializable;
@ -31,19 +32,25 @@ import java.util.Set;
public class UserQueryCriteria implements Serializable {
@Query
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "部门ID集合")
@Query(propName = "id", type = Query.Type.IN, joinName = "dept")
private Set<Long> deptIds = new HashSet<>();
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "email,username,nickName")
private String blurry;
@Query
@ApiModelProperty(value = "是否启用")
private Boolean enabled;
@ApiModelProperty(value = "部门ID")
private Long deptId;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.service.DataService;
@ -82,7 +83,7 @@ public class DataServiceImpl implements DataService {
for (Dept dept : depts) {
deptIds.add(dept.getId());
List<Dept> deptChildren = deptService.findByPid(dept.getId());
if (deptChildren != null && deptChildren.size() != 0) {
if (CollUtil.isNotEmpty(deptChildren)) {
deptIds.addAll(deptService.getDeptChildren(deptChildren));
}
}

View File

@ -17,6 +17,7 @@ package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.date.BetweenFormatter.Level;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.system.service.MonitorService;
import me.zhengjie.utils.ElConstant;
import me.zhengjie.utils.FileUtil;
@ -37,6 +38,7 @@ import java.util.*;
* @author Zheng Jie
* @date 2020-05-02
*/
@Slf4j
@Service
public class MonitorServiceImpl implements MonitorService {
@ -61,7 +63,7 @@ public class MonitorServiceImpl implements MonitorService {
resultMap.put("disk", getDiskInfo(os));
resultMap.put("time", DateUtil.format(new Date(), "HH:mm:ss"));
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
return resultMap;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -32,13 +33,15 @@ import java.util.List;
@NoArgsConstructor
public class EmailVo {
/** 收件人,支持多个收件人 */
@NotEmpty
@ApiModelProperty(value = "收件人")
private List<String> tos;
@NotBlank
@ApiModelProperty(value = "主题")
private String subject;
@NotBlank
@ApiModelProperty(value = "内容")
private String content;
}

View File

@ -29,35 +29,30 @@ import java.sql.Timestamp;
@Data
public class TradeVo {
/** (必填)商品描述 */
@NotBlank
@ApiModelProperty(value = "商品描述")
private String body;
/** (必填)商品名称 */
@NotBlank
@ApiModelProperty(value = "商品名称")
private String subject;
/** (必填)商户订单号,应该由后台生成 */
@ApiModelProperty(hidden = true)
@ApiModelProperty(value = "商户订单号", hidden = true)
private String outTradeNo;
/** (必填)第三方订单号 */
@ApiModelProperty(hidden = true)
@ApiModelProperty(value = "第三方订单号", hidden = true)
private String tradeNo;
/** (必填)价格 */
@NotBlank
@ApiModelProperty(value = "价格")
private String totalAmount;
/** 订单状态,已支付,未支付,作废 */
@ApiModelProperty(hidden = true)
@ApiModelProperty(value = "订单状态,已支付,未支付,作废", hidden = true)
private String state;
/** 创建时间,存入数据库时需要 */
@ApiModelProperty(hidden = true)
@ApiModelProperty(value = "创建时间", hidden = true)
private Timestamp createTime;
/** 作废时间,存入数据库时需要 */
@ApiModelProperty(hidden = true)
@ApiModelProperty(value = "作废时间", hidden = true)
private Date cancelTime;
}

View File

@ -28,7 +28,7 @@ public interface QiNiuConfigRepository extends JpaRepository<QiniuConfig,Long> {
/**
*
* @param type
* @param type /
*/
@Modifying
@Query(value = "update QiniuConfig set type = ?1")

View File

@ -57,7 +57,7 @@ public interface LocalStorageService {
*
* @param name
* @param file
* @return
* @return /
*/
LocalStorage create(String name, MultipartFile file);

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@ -28,15 +29,21 @@ import java.io.Serializable;
@Setter
public class LocalStorageDto extends BaseDTO implements Serializable {
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "真实文件名")
private String realName;
@ApiModelProperty(value = "文件名")
private String name;
@ApiModelProperty(value = "后缀")
private String suffix;
@ApiModelProperty(value = "文件类型")
private String type;
@ApiModelProperty(value = "文件大小")
private String size;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.sql.Timestamp;
import java.util.List;
@ -28,9 +29,11 @@ import me.zhengjie.annotation.Query;
@Data
public class LocalStorageQueryCriteria{
@ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,suffix,type,createBy,size")
private String blurry;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -1,40 +0,0 @@
/*
* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.zhengjie.service.dto;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
import java.util.List;
/**
* sm.ms
*
* @author Zheng Jie
* @date 2019-6-4 09:52:09
*/
@Data
public class PictureQueryCriteria{
@Query(type = Query.Type.INNER_LIKE)
private String filename;
@Query(type = Query.Type.INNER_LIKE)
private String username;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}

View File

@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@ -28,9 +29,11 @@ import java.util.List;
@Data
public class QiniuQueryCriteria{
@ApiModelProperty(value = "名称查询")
@Query(type = Query.Type.INNER_LIKE)
private String key;
@ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}