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; package me.zhengjie.base;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -15,14 +17,21 @@ import java.sql.Timestamp;
@Setter @Setter
public class BaseDTO implements Serializable { public class BaseDTO implements Serializable {
@ApiModelProperty(value = "创建人")
private String createBy; private String createBy;
@ApiModelProperty(value = "修改人")
private String updateBy; 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; 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; private Timestamp updateTime;
@Override @Override
public String toString() { public String toString() {
ToStringBuilder builder = new ToStringBuilder(this); ToStringBuilder builder = new ToStringBuilder(this);

View File

@ -15,6 +15,7 @@
*/ */
package me.zhengjie.base; package me.zhengjie.base;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -54,12 +55,14 @@ public class BaseEntity implements Serializable {
@CreationTimestamp @CreationTimestamp
@Column(name = "create_time", updatable = false) @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; private Timestamp createTime;
@UpdateTimestamp @UpdateTimestamp
@Column(name = "update_time") @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; private Timestamp updateTime;
/* 分组校验 */ /* 分组校验 */

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package me.zhengjie.config; package me.zhengjie.config.webConfig;
import org.springframework.boot.web.servlet.MultipartConfigFactory; import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -23,7 +23,7 @@ import java.io.File;
/** /**
* @date 2018-12-28 * @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 @Configuration
public class MultipartConfig { 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; package me.zhengjie.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -29,20 +31,19 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
public class TableInfo { public class TableInfo {
/** 表名称 */ @ApiModelProperty(value = "表名称")
private Object tableName; 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; private Object createTime;
/** 数据库引擎 */ @ApiModelProperty(value = "数据库引擎")
private Object engine; private Object engine;
/** 编码集 */ @ApiModelProperty(value = "编码集")
private Object coding; private Object coding;
/** 备注 */ @ApiModelProperty(value = "备注")
private Object remark; private Object remark;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,6 +18,7 @@ package me.zhengjie.modules.maint.util;
import ch.ethz.ssh2.Connection; import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.SCPClient; import ch.ethz.ssh2.SCPClient;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import me.zhengjie.utils.StringUtils;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@ -26,17 +27,20 @@ import java.util.logging.Logger;
/** /**
* linux * linux
* @author: ZhangHouYing * @author ZhangHouYing
* @date: 2019-08-10 10:06 * @date 2019-08-10 10:06
*/ */
public class ScpClientUtil { 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) { static synchronized public ScpClientUtil getInstance(String ip, int port, String username, String password) {
if (instance.get(ip) == null) { instance.computeIfAbsent(ip, i -> new ScpClientUtil(i, port, username, password));
instance.put(ip, new ScpClientUtil(ip, port, username, password));
}
return instance.get(ip); return instance.get(ip);
} }
@ -81,7 +85,7 @@ public class ScpClientUtil {
System.err.println("authentication failed"); System.err.println("authentication failed");
} }
SCPClient client = new SCPClient(conn); SCPClient client = new SCPClient(conn);
if ((mode == null) || (mode.length() == 0)) { if (StringUtils.isBlank(mode)) {
mode = "0600"; mode = "0600";
} }
if (remoteFileName == null) { if (remoteFileName == null) {
@ -95,11 +99,4 @@ public class ScpClientUtil {
conn.close(); 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.pool.DruidDataSource;
import com.alibaba.druid.util.StringUtils; import com.alibaba.druid.util.StringUtils;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.maint.domain.enums.DataTypeEnum;
import me.zhengjie.utils.CloseUtil; import me.zhengjie.utils.CloseUtil;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets; 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; import java.util.List;
/** /**
@ -113,7 +116,6 @@ public class SqlUtils {
connection.close(); connection.close();
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
log.error("connection close error" + e.getMessage());
} }
} }
} }
@ -126,7 +128,7 @@ public class SqlUtils {
return true; return true;
} }
} catch (Exception e) { } catch (Exception e) {
log.info("Get connection failed:" + e.getMessage()); log.error("Get connection failed:{}", e.getMessage());
} finally { } finally {
releaseConnection(connection); releaseConnection(connection);
} }
@ -146,27 +148,26 @@ public class SqlUtils {
return "success"; return "success";
} }
/** /**
* sql * sql
* @param connection / * @param connection /
* @param sqlList / * @param sqlList /
*/ */
public static void batchExecute(Connection connection, List<String> sqlList) { public static void batchExecute(Connection connection, List<String> sqlList) {
Statement st = null; try (Statement st = connection.createStatement()) {
try {
st = connection.createStatement();
for (String sql : sqlList) { for (String sql : sqlList) {
// 去除末尾的分号
if (sql.endsWith(";")) { if (sql.endsWith(";")) {
sql = sql.substring(0, sql.length() - 1); sql = sql.substring(0, sql.length() - 1);
} }
// 检查 SQL 语句是否为空
if (!sql.trim().isEmpty()) {
st.addBatch(sql); st.addBatch(sql);
} }
}
st.executeBatch(); st.executeBatch();
} catch (SQLException throwables) { } catch (SQLException e) {
throwables.printStackTrace(); log.error("SQL脚本批量执行发生异常: {},错误代码: {}", e.getMessage(), e.getErrorCode());
} finally {
CloseUtil.close(st);
} }
} }
@ -174,29 +175,31 @@ public class SqlUtils {
* sql * sql
* @param sqlFile / * @param sqlFile /
* @return / * @return /
* @throws Exception e
*/ */
private static List<String> readSqlList(File sqlFile) throws Exception { private static List<String> readSqlList(File sqlFile) {
List<String> sqlList = Lists.newArrayList(); List<String> sqlList = new ArrayList<>();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new InputStreamReader( try (BufferedReader reader = Files.newBufferedReader(sqlFile.toPath(), StandardCharsets.UTF_8)) {
new FileInputStream(sqlFile), StandardCharsets.UTF_8))) { String line;
String tmp; while ((line = reader.readLine()) != null) {
while ((tmp = reader.readLine()) != null) { log.info("line: {}", line);
log.info("line:{}", tmp); sb.append(line.trim());
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());
}
}
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; return sqlList;
} }
@ -228,5 +231,4 @@ public class SqlUtils {
} }
return jdbcUrl; return jdbcUrl;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,6 +15,7 @@
*/ */
package me.zhengjie.modules.system.service.impl; package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.domain.Dept; import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.service.DataService; import me.zhengjie.modules.system.service.DataService;
@ -82,7 +83,7 @@ public class DataServiceImpl implements DataService {
for (Dept dept : depts) { for (Dept dept : depts) {
deptIds.add(dept.getId()); deptIds.add(dept.getId());
List<Dept> deptChildren = deptService.findByPid(dept.getId()); List<Dept> deptChildren = deptService.findByPid(dept.getId());
if (deptChildren != null && deptChildren.size() != 0) { if (CollUtil.isNotEmpty(deptChildren)) {
deptIds.addAll(deptService.getDeptChildren(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.BetweenFormatter.Level;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.system.service.MonitorService; import me.zhengjie.modules.system.service.MonitorService;
import me.zhengjie.utils.ElConstant; import me.zhengjie.utils.ElConstant;
import me.zhengjie.utils.FileUtil; import me.zhengjie.utils.FileUtil;
@ -37,6 +38,7 @@ import java.util.*;
* @author Zheng Jie * @author Zheng Jie
* @date 2020-05-02 * @date 2020-05-02
*/ */
@Slf4j
@Service @Service
public class MonitorServiceImpl implements MonitorService { public class MonitorServiceImpl implements MonitorService {
@ -61,7 +63,7 @@ public class MonitorServiceImpl implements MonitorService {
resultMap.put("disk", getDiskInfo(os)); resultMap.put("disk", getDiskInfo(os));
resultMap.put("time", DateUtil.format(new Date(), "HH:mm:ss")); resultMap.put("time", DateUtil.format(new Date(), "HH:mm:ss"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error(e.getMessage(), e);
} }
return resultMap; return resultMap;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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