English Translation phase 1

pull/882/head
vamsikrishnagv 2025-05-25 08:48:09 -07:00
parent 55911bdc40
commit 7cc4fb427b
44 changed files with 373 additions and 374 deletions

View File

@ -11,10 +11,10 @@
</properties> </properties>
<artifactId>eladmin-common</artifactId> <artifactId>eladmin-common</artifactId>
<name>公共模块</name> <name>Common Module</name>
<dependencies> <dependencies>
<!--工具包--> <!-- Toolkit -->
<dependency> <dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>

View File

@ -28,60 +28,60 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface Query { public @interface Query {
// Dong ZhaoYang 2017/8/7 基本对象的属性名 // Dong ZhaoYang 2017/8/7 Property name of the basic object
String propName() default ""; String propName() default "";
// Dong ZhaoYang 2017/8/7 查询方式 // Dong ZhaoYang 2017/8/7 Query type
Type type() default Type.EQUAL; Type type() default Type.EQUAL;
/** /**
* Userdept * Property name for join query, e.g., dept in User class
*/ */
String joinName() default ""; String joinName() default "";
/** /**
* * Default left join
*/ */
Join join() default Join.LEFT; Join join() default Join.LEFT;
/** /**
* String, @Query(blurry = "email,username") * Multi-field fuzzy search, only supports String type fields, separated by commas, e.g., @Query(blurry = "email,username")
*/ */
String blurry() default ""; String blurry() default "";
enum Type { enum Type {
// jie 2019/6/4 相等 // jie 2019/6/4 Equal
EQUAL EQUAL
// Dong ZhaoYang 2017/8/7 大于等于 // Dong ZhaoYang 2017/8/7 Greater than or equal to
, GREATER_THAN , GREATER_THAN
// Dong ZhaoYang 2017/8/7 小于等于 // Dong ZhaoYang 2017/8/7 Less than or equal to
, LESS_THAN , LESS_THAN
// Dong ZhaoYang 2017/8/7 中模糊查询 // Dong ZhaoYang 2017/8/7 Inner fuzzy query
, INNER_LIKE , INNER_LIKE
// Dong ZhaoYang 2017/8/7 左模糊查询 // Dong ZhaoYang 2017/8/7 Left fuzzy query
, LEFT_LIKE , LEFT_LIKE
// Dong ZhaoYang 2017/8/7 右模糊查询 // Dong ZhaoYang 2017/8/7 Right fuzzy query
, RIGHT_LIKE , RIGHT_LIKE
// Dong ZhaoYang 2017/8/7 小于 // Dong ZhaoYang 2017/8/7 Less than
, LESS_THAN_NQ , LESS_THAN_NQ
// jie 2019/6/4 包含 // jie 2019/6/4 Contains
, IN , IN
// 不包含 // Not contains
, NOT_IN , NOT_IN
// 不等于 // Not equal
,NOT_EQUAL ,NOT_EQUAL
// between // between
,BETWEEN ,BETWEEN
// 不为空 // Not null
,NOT_NULL ,NOT_NULL
// 为空 // Is null
,IS_NULL, ,IS_NULL,
// Aborn Jiang 2022/06/01, 对应SQL: SELECT * FROM table WHERE FIND_IN_SET('querytag', table.tags); // Aborn Jiang 2022/06/01, Corresponds to SQL: SELECT * FROM table WHERE FIND_IN_SET('querytag', table.tags);
FIND_IN_SET FIND_IN_SET
} }
/** /**
* @author Zheng Jie * @author Zheng Jie
* 使sql * Suitable for simple join queries. For complex cases, please customize this annotation or use SQL queries.
*/ */
enum Join { enum Join {
/** jie 2019-6-4 13:18:30 */ /** jie 2019-6-4 13:18:30 */
@ -89,4 +89,3 @@ public @interface Query {
} }
} }

View File

@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
/** /**
* Annotation for mapping HTTP {@code PATCH} requests onto specific handler * Annotation for mapping HTTP {@code PATCH} requests onto specific handler
* methods. * methods.
* * 访 PatchMapping * * Supports anonymous access PatchMapping
* *
* @author liaojinlong * @author liaojinlong
* @see AnonymousGetMapping * @see AnonymousGetMapping

View File

@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
/** /**
* Annotation for mapping HTTP {@code PUT} requests onto specific handler * Annotation for mapping HTTP {@code PUT} requests onto specific handler
* methods. * methods.
* * 访 PutMapping * * Supports anonymous access PutMapping
* *
* @author liaojinlong * @author liaojinlong
* @see AnonymousGetMapping * @see AnonymousGetMapping

View File

@ -75,15 +75,15 @@ public class LimitAspect {
RedisScript<Long> redisScript = new DefaultRedisScript<>(luaScript, Long.class); RedisScript<Long> redisScript = new DefaultRedisScript<>(luaScript, Long.class);
Long count = redisTemplate.execute(redisScript, keys, limit.count(), limit.period()); Long count = redisTemplate.execute(redisScript, keys, limit.count(), limit.period());
if (ObjUtil.isNotNull(count) && count.intValue() <= limit.count()) { if (ObjUtil.isNotNull(count) && count.intValue() <= limit.count()) {
logger.info("第{}次访问key为 {},描述为 [{}] 的接口", count, keys, limit.name()); logger.info("The {}th access to the key {}, description [{}] interface", count, keys, limit.name());
return joinPoint.proceed(); return joinPoint.proceed();
} else { } else {
throw new BadRequestException("访问次数受限制"); throw new BadRequestException("Access count is restricted");
} }
} }
/** /**
* * Rate limiting script
*/ */
private String buildLuaScript() { private String buildLuaScript() {
return "local c" + return "local c" +

View File

@ -11,23 +11,23 @@ import java.sql.Timestamp;
/** /**
* @author Zheng Jie * @author Zheng Jie
* @date 2019102420:48:53 * @date 2019-10-24 20:48:53
*/ */
@Getter @Getter
@Setter @Setter
public class BaseDTO implements Serializable { public class BaseDTO implements Serializable {
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "Creator")
private String createBy; private String createBy;
@ApiModelProperty(value = "修改人") @ApiModelProperty(value = "Updater")
private String updateBy; private String updateBy;
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true) @ApiModelProperty(value = "Creation Time: yyyy-MM-dd HH:mm:ss", hidden = true)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @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) @ApiModelProperty(value = "Update Time: yyyy-MM-dd HH:mm:ss", hidden = true)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp updateTime; private Timestamp updateTime;

View File

@ -24,28 +24,28 @@ import java.util.List;
public interface BaseMapper<D, E> { public interface BaseMapper<D, E> {
/** /**
* DTOEntity * DTO to Entity
* @param dto / * @param dto /
* @return / * @return /
*/ */
E toEntity(D dto); E toEntity(D dto);
/** /**
* EntityDTO * Entity to DTO
* @param entity / * @param entity /
* @return / * @return /
*/ */
D toDto(E entity); D toDto(E entity);
/** /**
* DTOEntity * DTO List to Entity List
* @param dtoList / * @param dtoList /
* @return / * @return /
*/ */
List <E> toEntity(List<D> dtoList); List <E> toEntity(List<D> dtoList);
/** /**
* EntityDTO * Entity List to DTO List
* @param entityList / * @param entityList /
* @return / * @return /
*/ */

View File

@ -21,7 +21,7 @@ import org.springframework.stereotype.Component;
import java.util.Optional; import java.util.Optional;
/** /**
* @description : * @description : Set audit
* @author : Dong ZhaoYang * @author : Dong ZhaoYang
* @date : 2019/10/28 * @date : 2019/10/28
*/ */
@ -29,17 +29,17 @@ import java.util.Optional;
public class AuditorConfig implements AuditorAware<String> { public class AuditorConfig implements AuditorAware<String> {
/** /**
* * Return operator identification information
* *
* @return / * @return /
*/ */
@Override @Override
public Optional<String> getCurrentAuditor() { public Optional<String> getCurrentAuditor() {
try { try {
// 这里应根据实际业务情况获取具体信息 // Here you should obtain specific information according to actual business situation
return Optional.of(SecurityUtils.getCurrentUsername()); return Optional.of(SecurityUtils.getCurrentUsername());
}catch (Exception ignored){} }catch (Exception ignored){}
// 用户定时任务或者无Token调用的情况 // For scheduled tasks or cases where Token is not used
return Optional.of("System"); return Optional.of("System");
} }
} }

View File

@ -29,23 +29,23 @@ import java.io.IOException;
public class RemoveDruidAdConfig { public class RemoveDruidAdConfig {
/** /**
* : removeDruidAdFilterRegistrationBean * Method name: removeDruidAdFilterRegistrationBean
* 广 * Method description: Remove the advertisement at the bottom of the page
* @param properties com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties * @param properties com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties
* @return org.springframework.boot.web.servlet.FilterRegistrationBean * @return org.springframework.boot.web.servlet.FilterRegistrationBean
*/ */
@Bean @Bean
public FilterRegistrationBean removeDruidAdFilterRegistrationBean(DruidStatProperties properties) { public FilterRegistrationBean removeDruidAdFilterRegistrationBean(DruidStatProperties properties) {
// 获取web监控页面的参数 // Get the parameters of the web monitoring page
DruidStatProperties.StatViewServlet config = properties.getStatViewServlet(); DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
// 提取common.js的配置路径 // Extract the configuration path of common.js
String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*"; String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
String commonJsPattern = pattern.replaceAll("\\*", "js/common.js"); String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
final String filePath = "support/http/resources/js/common.js"; final String filePath = "support/http/resources/js/common.js";
//创建filter进行过滤 // Create filter for filtering
Filter filter = new Filter() { Filter filter = new Filter() {
@Override @Override
public void init(FilterConfig filterConfig) throws ServletException {} public void init(FilterConfig filterConfig) throws ServletException {}
@ -55,9 +55,9 @@ public class RemoveDruidAdConfig {
HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response; HttpServletResponse httpResponse = (HttpServletResponse) response;
if (httpRequest.getRequestURI().endsWith("js/common.js")) { if (httpRequest.getRequestURI().endsWith("js/common.js")) {
// 获取common.js // Get common.js
String text = Utils.readFromResource(filePath); String text = Utils.readFromResource(filePath);
// 正则替换banner, 除去底部的广告信息 // Use regex to replace banner, remove advertisement information at the bottom
text = text.replaceAll("<a.*?druid_banner\"></a><br/>", ""); text = text.replaceAll("<a.*?druid_banner\"></a><br/>", "");
text = text.replaceAll("powered by.*?shrek.wang</a>", ""); text = text.replaceAll("powered by.*?shrek.wang</a>", "");
httpResponse.setContentType("application/javascript"); httpResponse.setContentType("application/javascript");

View File

@ -23,7 +23,7 @@ import javax.crypto.spec.IvParameterSpec;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
/** /**
* * Encryption
* @author Zheng Jie * @author Zheng Jie
* @date 2018-11-23 * @date 2018-11-23
*/ */
@ -41,7 +41,7 @@ public class EncryptUtils {
} }
/** /**
* * Symmetric encryption
*/ */
public static String desEncrypt(String source) throws Exception { public static String desEncrypt(String source) throws Exception {
Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
@ -53,7 +53,7 @@ public class EncryptUtils {
} }
/** /**
* * Symmetric decryption
*/ */
public static String desDecrypt(String source) throws Exception { public static String desDecrypt(String source) throws Exception {
Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
@ -83,7 +83,7 @@ public class EncryptUtils {
private static byte[] hex2byte(byte[] b) { private static byte[] hex2byte(byte[] b) {
int size = 2; int size = 2;
if ((b.length % size) != 0) { if ((b.length % size) != 0) {
throw new IllegalArgumentException("长度不是偶数"); throw new IllegalArgumentException("Length is not even");
} }
byte[] b2 = new byte[b.length / 2]; byte[] b2 = new byte[b.length / 2];
for (int n = 0; n < b.length; n += size) { for (int n = 0; n < b.length; n += size) {

View File

@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class EncryptUtilsTest { public class EncryptUtilsTest {
/** /**
* * Symmetric encryption
*/ */
@Test @Test
public void testDesEncrypt() { public void testDesEncrypt() {
@ -20,7 +20,7 @@ public class EncryptUtilsTest {
} }
/** /**
* * Symmetric decryption
*/ */
@Test @Test
public void testDesDecrypt() { public void testDesDecrypt() {

View File

@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>eladmin-generator</artifactId> <artifactId>eladmin-generator</artifactId>
<name>代码生成模块</name> <name>Code Generation Module</name>
<properties> <properties>
<configuration.version>1.10</configuration.version> <configuration.version>1.10</configuration.version>
@ -21,7 +21,7 @@
<version>2.7</version> <version>2.7</version>
</dependency> </dependency>
<!--模板引擎--> <!-- Template Engine -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId> <artifactId>spring-boot-starter-freemarker</artifactId>

View File

@ -24,7 +24,7 @@ import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
/** /**
* * Column Data Information
* @author Zheng Jie * @author Zheng Jie
* @date 2019-01-02 * @date 2019-01-02
*/ */
@ -41,43 +41,43 @@ public class ColumnInfo implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
@ApiModelProperty(value = "表名") @ApiModelProperty(value = "Table Name")
private String tableName; private String tableName;
@ApiModelProperty(value = "数据库字段名称") @ApiModelProperty(value = "Database Column Name")
private String columnName; private String columnName;
@ApiModelProperty(value = "数据库字段类型") @ApiModelProperty(value = "Database Column Type")
private String columnType; private String columnType;
@ApiModelProperty(value = "数据库字段键类型") @ApiModelProperty(value = "Database Column Key Type")
private String keyType; private String keyType;
@ApiModelProperty(value = "字段额外的参数") @ApiModelProperty(value = "Extra Parameters for Column")
private String extra; private String extra;
@ApiModelProperty(value = "数据库字段描述") @ApiModelProperty(value = "Database Column Description")
private String remark; private String remark;
@ApiModelProperty(value = "是否必填") @ApiModelProperty(value = "Required")
private Boolean notNull; private Boolean notNull;
@ApiModelProperty(value = "是否在列表显示") @ApiModelProperty(value = "Show in List")
private Boolean listShow; private Boolean listShow;
@ApiModelProperty(value = "是否表单显示") @ApiModelProperty(value = "Show in Form")
private Boolean formShow; private Boolean formShow;
@ApiModelProperty(value = "表单类型") @ApiModelProperty(value = "Form Type")
private String formType; private String formType;
@ApiModelProperty(value = "查询 1:模糊 2精确") @ApiModelProperty(value = "Query Type 1:Fuzzy 2:Exact")
private String queryType; private String queryType;
@ApiModelProperty(value = "字典名称") @ApiModelProperty(value = "Dictionary Name")
private String dictName; private String dictName;
@ApiModelProperty(value = "日期注解") @ApiModelProperty(value = "Date Annotation")
private String dateAnnotation; private String dateAnnotation;
public ColumnInfo(String tableName, String columnName, Boolean notNull, String columnType, String remark, String keyType, String extra) { public ColumnInfo(String tableName, String columnName, Boolean notNull, String columnType, String remark, String keyType, String extra) {

View File

@ -24,7 +24,7 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
* * Code Generation Configuration
* @author Zheng Jie * @author Zheng Jie
* @date 2019-01-03 * @date 2019-01-03
*/ */
@ -46,33 +46,33 @@ public class GenConfig implements Serializable {
private Long id; private Long id;
@NotBlank @NotBlank
@ApiModelProperty(value = "表名") @ApiModelProperty(value = "Table Name")
private String tableName; private String tableName;
@ApiModelProperty(value = "接口名称") @ApiModelProperty(value = "API Alias")
private String apiAlias; private String apiAlias;
@NotBlank @NotBlank
@ApiModelProperty(value = "包路径") @ApiModelProperty(value = "Package Path")
private String pack; private String pack;
@NotBlank @NotBlank
@ApiModelProperty(value = "模块名") @ApiModelProperty(value = "Module Name")
private String moduleName; private String moduleName;
@NotBlank @NotBlank
@ApiModelProperty(value = "前端文件路径") @ApiModelProperty(value = "Frontend File Path")
private String path; private String path;
@ApiModelProperty(value = "前端文件路径") @ApiModelProperty(value = "Frontend API Path")
private String apiPath; private String apiPath;
@ApiModelProperty(value = "作者") @ApiModelProperty(value = "Author")
private String author; private String author;
@ApiModelProperty(value = "表前缀") @ApiModelProperty(value = "Table Prefix")
private String prefix; private String prefix;
@ApiModelProperty(value = "是否覆盖") @ApiModelProperty(value = "Overwrite")
private Boolean cover = false; private Boolean cover = false;
} }

View File

@ -32,19 +32,19 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/genConfig") @RequestMapping("/api/genConfig")
@Api(tags = "系统:代码生成器配置管理") @Api(tags = "System: Code Generator Configuration Management")
public class GenConfigController { public class GenConfigController {
private final GenConfigService genConfigService; private final GenConfigService genConfigService;
@ApiOperation("查询") @ApiOperation("Query")
@GetMapping(value = "/{tableName}") @GetMapping(value = "/{tableName}")
public ResponseEntity<GenConfig> queryGenConfig(@PathVariable String tableName){ public ResponseEntity<GenConfig> queryGenConfig(@PathVariable String tableName){
return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK); return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK);
} }
@PutMapping @PutMapping
@ApiOperation("修改") @ApiOperation("Update")
public ResponseEntity<Object> updateGenConfig(@Validated @RequestBody GenConfig genConfig){ public ResponseEntity<Object> updateGenConfig(@Validated @RequestBody GenConfig genConfig){
return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK); return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK);
} }

View File

@ -24,17 +24,17 @@ import me.zhengjie.domain.GenConfig;
public interface GenConfigService { public interface GenConfigService {
/** /**
* * Query table configuration
* @param tableName * @param tableName Table name
* @return * @return Table configuration
*/ */
GenConfig find(String tableName); GenConfig find(String tableName);
/** /**
* * Update table configuration
* @param tableName * @param tableName Table name
* @param genConfig * @param genConfig Table configuration
* @return * @return Table configuration
*/ */
GenConfig update(String tableName, GenConfig genConfig); GenConfig update(String tableName, GenConfig genConfig);
} }

View File

@ -31,66 +31,66 @@ import java.util.List;
public interface GeneratorService { public interface GeneratorService {
/** /**
* * Query database metadata
* @param name * @param name Table name
* @param startEnd * @param startEnd Pagination parameters
* @return / * @return /
*/ */
PageResult<TableInfo> getTables(String name, int[] startEnd); PageResult<TableInfo> getTables(String name, int[] startEnd);
/** /**
* * Get table metadata
* @param name * @param name Table name
* @return / * @return /
*/ */
List<ColumnInfo> getColumns(String name); List<ColumnInfo> getColumns(String name);
/** /**
* * Synchronize table data
* @param columnInfos / * @param columnInfos
* @param columnInfoList / * @param columnInfoList
*/ */
void sync(List<ColumnInfo> columnInfos, List<ColumnInfo> columnInfoList); void sync(List<ColumnInfo> columnInfos, List<ColumnInfo> columnInfoList);
/** /**
* * Save data
* @param columnInfos / * @param columnInfos
*/ */
void save(List<ColumnInfo> columnInfos); void save(List<ColumnInfo> columnInfos);
/** /**
* table * Get all tables
* @return / * @return /
*/ */
Object getTables(); Object getTables();
/** /**
* * Code generation
* @param genConfig * @param genConfig Configuration information
* @param columns * @param columns Field information
*/ */
void generator(GenConfig genConfig, List<ColumnInfo> columns); void generator(GenConfig genConfig, List<ColumnInfo> columns);
/** /**
* * Preview
* @param genConfig * @param genConfig Configuration information
* @param columns * @param columns Field information
* @return / * @return /
*/ */
ResponseEntity<Object> preview(GenConfig genConfig, List<ColumnInfo> columns); ResponseEntity<Object> preview(GenConfig genConfig, List<ColumnInfo> columns);
/** /**
* * Download as package
* @param genConfig * @param genConfig Configuration information
* @param columns * @param columns Field information
* @param request / * @param request
* @param response / * @param response
*/ */
void download(GenConfig genConfig, List<ColumnInfo> columns, HttpServletRequest request, HttpServletResponse response); void download(GenConfig genConfig, List<ColumnInfo> columns, HttpServletRequest request, HttpServletResponse response);
/** /**
* * Query database table field data
* @param table / * @param table
* @return / * @return /
*/ */
List<ColumnInfo> query(String table); List<ColumnInfo> query(String table);

View File

@ -20,7 +20,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* sqljava * Convert SQL fields to Java
* *
* @author Zheng Jie * @author Zheng Jie
* @date 2019-01-03 * @date 2019-01-03
@ -29,9 +29,9 @@ public class ColUtil {
private static final Logger log = LoggerFactory.getLogger(ColUtil.class); private static final Logger log = LoggerFactory.getLogger(ColUtil.class);
/** /**
* mysqljava * Convert MySQL data type to Java data type
* *
* @param type * @param type Database column type
* @return String * @return String
*/ */
static String cloToJava(String type) { static String cloToJava(String type) {
@ -41,7 +41,7 @@ public class ColUtil {
} }
/** /**
* * Get configuration information
*/ */
public static PropertiesConfiguration getConfig() { public static PropertiesConfiguration getConfig() {
try { try {

View File

@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>eladmin-logging</artifactId> <artifactId>eladmin-logging</artifactId>
<name>日志模块</name> <name>Logging Module</name>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -49,15 +49,15 @@ public class LogAspect {
} }
/** /**
* * Configure pointcut
*/ */
@Pointcut("@annotation(me.zhengjie.annotation.Log)") @Pointcut("@annotation(me.zhengjie.annotation.Log)")
public void logPointcut() { public void logPointcut() {
// 该方法无方法体,主要为了让同类中其他方法使用此切入点 // This method has no method body. It mainly allows other methods in the same class to use this pointcut.
} }
/** /**
* ,使logPointcut() * Configure around advice, used on the pointcut registered on method logPointcut()
* *
* @param joinPoint join point for advice * @param joinPoint join point for advice
*/ */
@ -74,7 +74,7 @@ public class LogAspect {
} }
/** /**
* * Configure exception advice
* *
* @param joinPoint join point for advice * @param joinPoint join point for advice
* @param e exception * @param e exception
@ -89,7 +89,7 @@ public class LogAspect {
} }
/** /**
* * Get the current username
* @return / * @return /
*/ */
public String getUsername() { public String getUsername() {

View File

@ -42,39 +42,39 @@ public class SysLog implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
@ApiModelProperty(value = "操作用户") @ApiModelProperty(value = "Operator User")
private String username; private String username;
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "Description")
private String description; private String description;
@ApiModelProperty(value = "方法名") @ApiModelProperty(value = "Method Name")
private String method; private String method;
@ApiModelProperty(value = "参数") @ApiModelProperty(value = "Parameters")
private String params; private String params;
@ApiModelProperty(value = "日志类型") @ApiModelProperty(value = "Log Type")
private String logType; private String logType;
@ApiModelProperty(value = "请求ip") @ApiModelProperty(value = "Request IP")
private String requestIp; private String requestIp;
@ApiModelProperty(value = "地址") @ApiModelProperty(value = "Address")
private String address; private String address;
@ApiModelProperty(value = "浏览器") @ApiModelProperty(value = "Browser")
private String browser; private String browser;
@ApiModelProperty(value = "请求耗时") @ApiModelProperty(value = "Request Duration")
private Long time; private Long time;
@ApiModelProperty(value = "异常详细") @ApiModelProperty(value = "Exception Details")
private byte[] exceptionDetail; private byte[] exceptionDetail;
/** 创建日期 */ /** Creation Date */
@CreationTimestamp @CreationTimestamp
@ApiModelProperty(value = "创建日期:yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "Creation Date: yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime; private Timestamp createTime;

View File

@ -30,8 +30,8 @@ import org.springframework.stereotype.Repository;
public interface LogRepository extends JpaRepository<SysLog,Long>, JpaSpecificationExecutor<SysLog> { public interface LogRepository extends JpaRepository<SysLog,Long>, JpaSpecificationExecutor<SysLog> {
/** /**
* * Delete information by log type
* @param logType * @param logType Log type
*/ */
@Modifying @Modifying
@Query(value = "delete from sys_log where log_type = ?1", nativeQuery = true) @Query(value = "delete from sys_log where log_type = ?1", nativeQuery = true)

View File

@ -39,13 +39,13 @@ import java.io.IOException;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/logs") @RequestMapping("/api/logs")
@Api(tags = "系统:日志管理") @Api(tags = "System: Log Management")
public class SysLogController { public class SysLogController {
private final SysLogService sysLogService; private final SysLogService sysLogService;
@Log("导出数据") @Log("Export Data")
@ApiOperation("导出数据") @ApiOperation("Export Data")
@GetMapping(value = "/download") @GetMapping(value = "/download")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public void exportLog(HttpServletResponse response, SysLogQueryCriteria criteria) throws IOException { public void exportLog(HttpServletResponse response, SysLogQueryCriteria criteria) throws IOException {
@ -53,8 +53,8 @@ public class SysLogController {
sysLogService.download(sysLogService.queryAll(criteria), response); sysLogService.download(sysLogService.queryAll(criteria), response);
} }
@Log("导出错误数据") @Log("Export Error Data")
@ApiOperation("导出错误数据") @ApiOperation("Export Error Data")
@GetMapping(value = "/error/download") @GetMapping(value = "/error/download")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public void exportErrorLog(HttpServletResponse response, SysLogQueryCriteria criteria) throws IOException { public void exportErrorLog(HttpServletResponse response, SysLogQueryCriteria criteria) throws IOException {
@ -62,7 +62,7 @@ public class SysLogController {
sysLogService.download(sysLogService.queryAll(criteria), response); sysLogService.download(sysLogService.queryAll(criteria), response);
} }
@GetMapping @GetMapping
@ApiOperation("日志查询") @ApiOperation("Log Query")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public ResponseEntity<Object> queryLog(SysLogQueryCriteria criteria, Pageable pageable){ public ResponseEntity<Object> queryLog(SysLogQueryCriteria criteria, Pageable pageable){
criteria.setLogType("INFO"); criteria.setLogType("INFO");
@ -70,7 +70,7 @@ public class SysLogController {
} }
@GetMapping(value = "/user") @GetMapping(value = "/user")
@ApiOperation("用户日志查询") @ApiOperation("User Log Query")
public ResponseEntity<PageResult<SysLogSmallDto>> queryUserLog(SysLogQueryCriteria criteria, Pageable pageable){ public ResponseEntity<PageResult<SysLogSmallDto>> queryUserLog(SysLogQueryCriteria criteria, Pageable pageable){
criteria.setLogType("INFO"); criteria.setLogType("INFO");
criteria.setUsername(SecurityUtils.getCurrentUsername()); criteria.setUsername(SecurityUtils.getCurrentUsername());
@ -78,7 +78,7 @@ public class SysLogController {
} }
@GetMapping(value = "/error") @GetMapping(value = "/error")
@ApiOperation("错误日志查询") @ApiOperation("Error Log Query")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public ResponseEntity<Object> queryErrorLog(SysLogQueryCriteria criteria, Pageable pageable){ public ResponseEntity<Object> queryErrorLog(SysLogQueryCriteria criteria, Pageable pageable){
criteria.setLogType("ERROR"); criteria.setLogType("ERROR");
@ -86,14 +86,14 @@ public class SysLogController {
} }
@GetMapping(value = "/error/{id}") @GetMapping(value = "/error/{id}")
@ApiOperation("日志异常详情查询") @ApiOperation("Log Exception Detail Query")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public ResponseEntity<Object> queryErrorLogDetail(@PathVariable Long id){ public ResponseEntity<Object> queryErrorLogDetail(@PathVariable Long id){
return new ResponseEntity<>(sysLogService.findByErrDetail(id), HttpStatus.OK); return new ResponseEntity<>(sysLogService.findByErrDetail(id), HttpStatus.OK);
} }
@DeleteMapping(value = "/del/error") @DeleteMapping(value = "/del/error")
@Log("删除所有ERROR日志") @Log("Delete All ERROR Logs")
@ApiOperation("删除所有ERROR日志") @ApiOperation("Delete All ERROR Logs")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public ResponseEntity<Object> delAllErrorLog(){ public ResponseEntity<Object> delAllErrorLog(){
sysLogService.delAllByError(); sysLogService.delAllByError();
@ -101,8 +101,8 @@ public class SysLogController {
} }
@DeleteMapping(value = "/del/info") @DeleteMapping(value = "/del/info")
@Log("删除所有INFO日志") @Log("Delete All INFO Logs")
@ApiOperation("删除所有INFO日志") @ApiOperation("Delete All INFO Logs")
@PreAuthorize("@el.check()") @PreAuthorize("@el.check()")
public ResponseEntity<Object> delAllInfoLog(){ public ResponseEntity<Object> delAllInfoLog(){
sysLogService.delAllByInfo(); sysLogService.delAllByInfo();

View File

@ -34,61 +34,61 @@ import java.util.List;
public interface SysLogService { public interface SysLogService {
/** /**
* * Paginated query
* @param criteria * @param criteria Query criteria
* @param pageable * @param pageable Pagination parameters
* @return / * @return /
*/ */
Object queryAll(SysLogQueryCriteria criteria, Pageable pageable); Object queryAll(SysLogQueryCriteria criteria, Pageable pageable);
/** /**
* * Query all data
* @param criteria * @param criteria Query criteria
* @return / * @return /
*/ */
List<SysLog> queryAll(SysLogQueryCriteria criteria); List<SysLog> queryAll(SysLogQueryCriteria criteria);
/** /**
* * Query user logs
* @param criteria * @param criteria Query criteria
* @param pageable * @param pageable Pagination parameters
* @return - * @return /
*/ */
PageResult<SysLogSmallDto> queryAllByUser(SysLogQueryCriteria criteria, Pageable pageable); PageResult<SysLogSmallDto> queryAllByUser(SysLogQueryCriteria criteria, Pageable pageable);
/** /**
* * Save log data
* @param username * @param username User
* @param browser * @param browser Browser
* @param ip IP * @param ip Request IP
* @param joinPoint / * @param joinPoint /
* @param sysLog * @param sysLog Log entity
*/ */
@Async @Async
void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, SysLog sysLog); void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, SysLog sysLog);
/** /**
* * Query exception details
* @param id ID * @param id Log ID
* @return Object * @return Object
*/ */
Object findByErrDetail(Long id); Object findByErrDetail(Long id);
/** /**
* * Export logs
* @param sysLogs * @param sysLogs Data to export
* @param response / * @param response /
* @throws IOException / * @throws IOException /
*/ */
void download(List<SysLog> sysLogs, HttpServletResponse response) throws IOException; void download(List<SysLog> sysLogs, HttpServletResponse response) throws IOException;
/** /**
* * Delete all error logs
*/ */
void delAllByError(); void delAllByError();
/** /**
* INFO * Delete all INFO logs
*/ */
void delAllByInfo(); void delAllByInfo();
} }

View File

@ -8,16 +8,16 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>eladmin-system</artifactId> <artifactId>eladmin-system</artifactId>
<name>核心模块</name> <name>Core Module</name>
<properties> <properties>
<jjwt.version>0.11.5</jjwt.version> <jjwt.version>0.11.5</jjwt.version>
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 --> <!-- oshi monitoring requires specifying the jna version, see https://github.com/oshi/oshi/issues/1040 -->
<jna.version>5.8.0</jna.version> <jna.version>5.8.0</jna.version>
</properties> </properties>
<dependencies> <dependencies>
<!-- 代码生成模块 --> <!-- Code Generation Module -->
<dependency> <dependency>
<groupId>me.zhengjie</groupId> <groupId>me.zhengjie</groupId>
<artifactId>eladmin-generator</artifactId> <artifactId>eladmin-generator</artifactId>
@ -30,7 +30,7 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- tools 模块包含了 common 和 logging 模块 --> <!-- The tools module includes the common and logging modules -->
<dependency> <dependency>
<groupId>me.zhengjie</groupId> <groupId>me.zhengjie</groupId>
<artifactId>eladmin-tools</artifactId> <artifactId>eladmin-tools</artifactId>
@ -65,7 +65,7 @@
<version>${jjwt.version}</version> <version>${jjwt.version}</version>
</dependency> </dependency>
<!-- linux的管理 --> <!-- Linux management -->
<dependency> <dependency>
<groupId>ch.ethz.ganymed</groupId> <groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId> <artifactId>ganymed-ssh2</artifactId>
@ -77,7 +77,7 @@
<version>0.1.55</version> <version>0.1.55</version>
</dependency> </dependency>
<!-- 获取系统信息 --> <!-- Obtain system information -->
<dependency> <dependency>
<groupId>com.github.oshi</groupId> <groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId> <artifactId>oshi-core</artifactId>
@ -85,14 +85,14 @@
</dependency> </dependency>
</dependencies> </dependencies>
<!-- 打包 --> <!-- Packaging -->
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<!-- 跳过单元测试 --> <!-- Skip unit tests -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -31,7 +31,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
* -> @EnableJpaAuditing * Enable auditing functionality -> @EnableJpaAuditing
* *
* @author Zheng Jie * @author Zheng Jie
* @date 2018/11/15 9:20:19 * @date 2018/11/15 9:20:19
@ -49,8 +49,8 @@ public class AppRun {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(AppRun.class); SpringApplication springApplication = new SpringApplication(AppRun.class);
// 监控应用的PID启动时可指定PID路径--spring.pid.file=/home/eladmin/app.pid // Monitor the application's PID. You can specify the PID path at startup: --spring.pid.file=/home/eladmin/app.pid
// 或者在 application.yml 添加文件路径,方便 killkill `cat /home/eladmin/app.pid` // Or add the file path in application.yml for easy kill: kill `cat /home/eladmin/app.pid`
springApplication.addListeners(new ApplicationPidFileWriter()); springApplication.addListeners(new ApplicationPidFileWriter());
springApplication.run(args); springApplication.run(args);
log.info("---------------------------------------------"); log.info("---------------------------------------------");
@ -65,7 +65,7 @@ public class AppRun {
} }
/** /**
* 访 * Homepage access prompt
* *
* @return / * @return /
*/ */

View File

@ -39,29 +39,29 @@ import java.util.Set;
* @date 2019-08-24 * @date 2019-08-24
*/ */
@RestController @RestController
@Api(tags = "运维:服务器管理") @Api(tags = "Ops: Server Management")
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/serverDeploy") @RequestMapping("/api/serverDeploy")
public class ServerDeployController { public class ServerDeployController {
private final ServerDeployService serverDeployService; private final ServerDeployService serverDeployService;
@ApiOperation("导出服务器数据") @ApiOperation("Export server data")
@GetMapping(value = "/download") @GetMapping(value = "/download")
@PreAuthorize("@el.check('serverDeploy:list')") @PreAuthorize("@el.check('serverDeploy:list')")
public void exportServerDeploy(HttpServletResponse response, ServerDeployQueryCriteria criteria) throws IOException { public void exportServerDeploy(HttpServletResponse response, ServerDeployQueryCriteria criteria) throws IOException {
serverDeployService.download(serverDeployService.queryAll(criteria), response); serverDeployService.download(serverDeployService.queryAll(criteria), response);
} }
@ApiOperation(value = "查询服务器") @ApiOperation(value = "Query server")
@GetMapping @GetMapping
@PreAuthorize("@el.check('serverDeploy:list')") @PreAuthorize("@el.check('serverDeploy:list')")
public ResponseEntity<PageResult<ServerDeployDto>> queryServerDeploy(ServerDeployQueryCriteria criteria, Pageable pageable){ public ResponseEntity<PageResult<ServerDeployDto>> queryServerDeploy(ServerDeployQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(serverDeployService.queryAll(criteria,pageable),HttpStatus.OK); return new ResponseEntity<>(serverDeployService.queryAll(criteria,pageable),HttpStatus.OK);
} }
@Log("新增服务器") @Log("Add server")
@ApiOperation(value = "新增服务器") @ApiOperation(value = "Add server")
@PostMapping @PostMapping
@PreAuthorize("@el.check('serverDeploy:add')") @PreAuthorize("@el.check('serverDeploy:add')")
public ResponseEntity<Object> createServerDeploy(@Validated @RequestBody ServerDeploy resources){ public ResponseEntity<Object> createServerDeploy(@Validated @RequestBody ServerDeploy resources){
@ -69,8 +69,8 @@ public class ServerDeployController {
return new ResponseEntity<>(HttpStatus.CREATED); return new ResponseEntity<>(HttpStatus.CREATED);
} }
@Log("修改服务器") @Log("Update server")
@ApiOperation(value = "修改服务器") @ApiOperation(value = "Update server")
@PutMapping @PutMapping
@PreAuthorize("@el.check('serverDeploy:edit')") @PreAuthorize("@el.check('serverDeploy:edit')")
public ResponseEntity<Object> updateServerDeploy(@Validated @RequestBody ServerDeploy resources){ public ResponseEntity<Object> updateServerDeploy(@Validated @RequestBody ServerDeploy resources){
@ -78,8 +78,8 @@ public class ServerDeployController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
@Log("删除服务器") @Log("Delete server")
@ApiOperation(value = "删除Server") @ApiOperation(value = "Delete Server")
@DeleteMapping @DeleteMapping
@PreAuthorize("@el.check('serverDeploy:del')") @PreAuthorize("@el.check('serverDeploy:del')")
public ResponseEntity<Object> deleteServerDeploy(@RequestBody Set<Long> ids){ public ResponseEntity<Object> deleteServerDeploy(@RequestBody Set<Long> ids){
@ -87,8 +87,8 @@ public class ServerDeployController {
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@Log("测试连接服务器") @Log("Test server connection")
@ApiOperation(value = "测试连接服务器") @ApiOperation(value = "Test server connection")
@PostMapping("/testConnect") @PostMapping("/testConnect")
@PreAuthorize("@el.check('serverDeploy:add')") @PreAuthorize("@el.check('serverDeploy:add')")
public ResponseEntity<Object> testConnectServerDeploy(@Validated @RequestBody ServerDeploy resources){ public ResponseEntity<Object> testConnectServerDeploy(@Validated @RequestBody ServerDeploy resources){

View File

@ -23,7 +23,7 @@ import org.springframework.stereotype.Component;
/** /**
* @author Zheng Jie * @author Zheng Jie
* @description * @description Process data after program startup
* @date 2025-01-13 * @date 2025-01-13
**/ **/
@Slf4j @Slf4j

View File

@ -1,29 +1,29 @@
server: server:
port: 8000 port: 8000
http2: http2:
# 启用 HTTP/2 支持,提升传输效率 # Enable HTTP/2 support to improve transmission efficiency
enabled: true enabled: true
compression: compression:
# 启用 GZIP 压缩,减少传输数据量 # Enable GZIP compression to reduce data transmission
enabled: true enabled: true
# 需要压缩的 MIME 类型 # MIME types to compress
mime-types: text/html, text/xml, text/plain, application/json mime-types: text/html, text/xml, text/plain, application/json
# 最小压缩响应大小(字节) # Minimum response size for compression (bytes)
spring: spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
# 激活的环境,如果需要 quartz 分布式支持,需要修改 active: dev,quartz # Active environment. If you need quartz distributed support, change active: dev,quartz
active: dev active: dev
data: data:
redis: redis:
repositories: repositories:
enabled: false enabled: false
# pid: # pid:
# file: /自行指定位置/eladmin.pid # file: /specify/location/eladmin.pid
#配置 Jpa # JPA configuration
jpa: jpa:
hibernate: hibernate:
ddl-auto: none ddl-auto: none
@ -33,45 +33,45 @@ spring:
dialect: org.hibernate.dialect.MySQL8Dialect dialect: org.hibernate.dialect.MySQL8Dialect
redis: redis:
#数据库索引 # Database index
database: ${REDIS_DB:0} database: ${REDIS_DB:0}
host: ${REDIS_HOST:127.0.0.1} host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379} port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:} password: ${REDIS_PWD:}
#连接超时时间 # Connection timeout
timeout: 5000 timeout: 5000
# 连接池配置 # Connection pool configuration
lettuce: lettuce:
pool: pool:
# 连接池最大连接数 # Maximum number of connections in the pool
max-active: 30 max-active: 30
# 连接池最大阻塞等待时间(毫秒),负值表示没有限制 # Maximum blocking wait time in the pool (ms), negative means no limit
max-wait: -1 max-wait: -1
# 连接池中的最大空闲连接数 # Maximum idle connections in the pool
max-idle: 20 max-idle: 20
# 连接池中的最小空闲连接数 # Minimum idle connections in the pool
min-idle: 1 min-idle: 1
task: task:
pool: pool:
# 核心线程池大小 # Core thread pool size
core-pool-size: 10 core-pool-size: 10
# 最大线程数 # Maximum number of threads
max-pool-size: 30 max-pool-size: 30
# 活跃时间 # Keep alive time
keep-alive-seconds: 60 keep-alive-seconds: 60
# 队列容量 # Queue capacity
queue-capacity: 50 queue-capacity: 50
#七牛云 # Qiniu Cloud
qiniu: qiniu:
# 文件大小 /M # File size /M
max-size: 15 max-size: 15
#邮箱验证码有效时间/秒 # Email verification code validity time/seconds
code: code:
expiration: 300 expiration: 300
#密码加密传输,前端公钥加密,后端私钥解密 # Password encrypted transmission, frontend public key encryption, backend private key decryption
rsa: rsa:
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A== private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==

View File

@ -1,29 +1,29 @@
# 应用的拦截模块 # Application interception module
modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
# 自定义日志打印 # Custom log printing
logMessageFormat=me.zhengjie.config.CustomP6SpyLogger logMessageFormat=me.zhengjie.config.CustomP6SpyLogger
# 日志输出到控制台 # Log output to console
appender=com.p6spy.engine.spy.appender.Slf4JLogger appender=com.p6spy.engine.spy.appender.Slf4JLogger
# 日期格式 # Date format
dateformat=yyyy-MM-dd HH:mm:ss dateformat=yyyy-MM-dd HH:mm:ss
# 实际驱动可多个 # Multiple actual drivers possible
driverlist=com.mysql.cj.jdbc.Driver driverlist=com.mysql.cj.jdbc.Driver
# 是否开启慢SQL记录 # Enable slow SQL logging
outagedetection=true outagedetection=true
# 慢SQL记录标准 2 秒 # Slow SQL logging standard: 2 seconds
outagedetectioninterval=2 outagedetectioninterval=2
# 是否过滤 Log # Whether to filter Log
filter=true filter=true
# 过滤 Log 时所排除的 sql 关键字,以逗号分隔 # SQL keywords to exclude when filtering Log, separated by commas
exclude=SELECT 1,INSERT INTO sys_log exclude=SELECT 1,INSERT INTO sys_log
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. # Configure Log exceptions, removable result sets include error, info, batch, debug, statement, commit, rollback, result, resultset.
excludecategories=info,debug,result,commit,resultset excludecategories=info,debug,result,commit,resultset

View File

@ -19,8 +19,8 @@
margin-top: 20px; margin-top: 20px;
border: 1px solid #eee;"> border: 1px solid #eee;">
<div style="padding: 10px;padding-bottom: 0px;"> <div style="padding: 10px;padding-bottom: 0px;">
<p style="margin-bottom: 10px;padding-bottom: 0px;">尊敬的用户,您好</p> <p style="margin-bottom: 10px;padding-bottom: 0px;">Dear user, hello</p>
<p style="text-indent: 2em; margin-bottom: 10px;">您正在申请邮箱验证,您的验证码为</p> <p style="text-indent: 2em; margin-bottom: 10px;">You are applying for email verification, your verification code is</p>
<p style="text-align: center; <p style="text-align: center;
font-family: Times New Roman; font-family: Times New Roman;
font-size: 22px; font-size: 22px;
@ -39,7 +39,7 @@
font-size: 12px; font-size: 12px;
padding: 20px 0px; padding: 20px 0px;
font-family: Microsoft YaHei;"> font-family: Microsoft YaHei;">
Copyright &copy;${.now?string("yyyy")} <a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">ELADMIN</a> 后台管理系统 All Rights Reserved. Copyright &copy;${.now?string("yyyy")} <a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">ELADMIN</a> Backend Management System All Rights Reserved.
</div> </div>
</div> </div>

View File

@ -18,15 +18,15 @@
padding: 20px; padding: 20px;
border: 1px solid #eee;"> border: 1px solid #eee;">
<div> <div>
<p style="margin-bottom: 10px;">任务信息:</p> <p style="margin-bottom: 10px;">Task Information:</p>
<table style="border-collapse: collapse;"> <table style="border-collapse: collapse;">
<tr> <tr>
<th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">任务名称</th> <th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Task Name</th>
<th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Bean名称</th> <th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Bean Name</th>
<th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">执行方法</th> <th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Execution Method</th>
<th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">参数内容</th> <th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Parameter Content</th>
<th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Cron表达式</th> <th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Cron Expression</th>
<th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">描述内容</th> <th style="padding: .65em;background: #666;border: 1px solid #777;color: #fff;">Description</th>
</tr> </tr>
<tr> <tr>
<td style="padding: .65em;border: 1px solid#777;">${task.jobName}</td> <td style="padding: .65em;border: 1px solid#777;">${task.jobName}</td>
@ -39,7 +39,7 @@
</table> </table>
</div> </div>
<div> <div>
<p style="margin-bottom: 10px;">异常信息:</p> <p style="margin-bottom: 10px;">Exception Information:</p>
<pre style="position: relative; <pre style="position: relative;
padding: 15px; padding: 15px;
line-height: 20px; line-height: 20px;
@ -60,7 +60,7 @@
font-size: 12px; font-size: 12px;
padding: 20px 0px; padding: 20px 0px;
font-family: Microsoft YaHei;"> font-family: Microsoft YaHei;">
Copyright &copy;${.now?string("yyyy")} <a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">ELADMIN</a> 后台管理系统 All Rights Reserved. Copyright &copy;${.now?string("yyyy")} <a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">ELADMIN</a> Backend Management System All Rights Reserved.
</div> </div>
</div> </div>

View File

@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>eladmin-tools</artifactId> <artifactId>eladmin-tools</artifactId>
<name>工具模块</name> <name>Tools Module</name>
<properties> <properties>
<mail.version>1.4.7</mail.version> <mail.version>1.4.7</mail.version>
@ -17,28 +17,28 @@
</properties> </properties>
<dependencies> <dependencies>
<!-- 同时需要common模块和logging模块只需要引入logging模块即可 --> <!-- If you need both the common module and the logging module at the same time, just import the logging module. -->
<dependency> <dependency>
<groupId>me.zhengjie</groupId> <groupId>me.zhengjie</groupId>
<artifactId>eladmin-logging</artifactId> <artifactId>eladmin-logging</artifactId>
<version>2.7</version> <version>2.7</version>
</dependency> </dependency>
<!--邮件依赖--> <!-- Email dependency -->
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>${mail.version}</version> <version>${mail.version}</version>
</dependency> </dependency>
<!--七牛云存储--> <!-- Qiniu Cloud Storage -->
<dependency> <dependency>
<groupId>com.qiniu</groupId> <groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId> <artifactId>qiniu-java-sdk</artifactId>
<version>${qiniu.version}</version> <version>${qiniu.version}</version>
</dependency> </dependency>
<!--支付宝依赖--> <!-- Alipay dependency -->
<dependency> <dependency>
<groupId>com.alipay.sdk</groupId> <groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId> <artifactId>alipay-sdk-java</artifactId>

View File

@ -40,22 +40,22 @@ public class LocalStorage extends BaseEntity implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id; private Long id;
@ApiModelProperty(value = "真实文件名") @ApiModelProperty(value = "Real file name")
private String realName; private String realName;
@ApiModelProperty(value = "文件名") @ApiModelProperty(value = "File name")
private String name; private String name;
@ApiModelProperty(value = "后缀") @ApiModelProperty(value = "Suffix")
private String suffix; private String suffix;
@ApiModelProperty(value = "路径") @ApiModelProperty(value = "Path")
private String path; private String path;
@ApiModelProperty(value = "类型") @ApiModelProperty(value = "Type")
private String type; private String type;
@ApiModelProperty(value = "大小") @ApiModelProperty(value = "Size")
private String size; private String size;
public LocalStorage(String realName,String name, String suffix, String path, String type, String size) { public LocalStorage(String realName,String name, String suffix, String path, String type, String size) {

View File

@ -22,7 +22,7 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
* * Qiniu Cloud Object Storage Configuration Class
* @author Zheng Jie * @author Zheng Jie
* @date 2018-12-31 * @date 2018-12-31
*/ */
@ -37,33 +37,33 @@ public class QiniuConfig implements Serializable {
private Long id; private Long id;
@NotBlank @NotBlank
@ApiModelProperty(value = "accessKey") @ApiModelProperty(value = "Access Key")
private String accessKey; private String accessKey;
@NotBlank @NotBlank
@ApiModelProperty(value = "secretKey") @ApiModelProperty(value = "Secret Key")
private String secretKey; private String secretKey;
@NotBlank @NotBlank
@ApiModelProperty(value = "存储空间名称作为唯一的 Bucket 识别符") @ApiModelProperty(value = "Storage space name used as the unique Bucket identifier")
private String bucket; private String bucket;
/** /**
* Zone * Zone represents the correspondence between data center and region
* Zone.zone0() * East China Zone.zone0()
* Zone.zone1() * North China Zone.zone1()
* Zone.zone2() * South China Zone.zone2()
* Zone.zoneNa0() * North America Zone.zoneNa0()
* Zone.zoneAs0() * Southeast Asia Zone.zoneAs0()
*/ */
@NotBlank @NotBlank
@ApiModelProperty(value = "Zone表示与机房的对应关系") @ApiModelProperty(value = "Zone represents the correspondence between data center and region")
private String zone; private String zone;
@NotBlank @NotBlank
@ApiModelProperty(value = "外链域名,可自定义,需在七牛云绑定") @ApiModelProperty(value = "External domain, customizable, needs to be bound in Qiniu Cloud")
private String host; private String host;
@ApiModelProperty(value = "空间类型:公开/私有") @ApiModelProperty(value = "Space type: public/private")
private String type = "公开"; private String type = "public";
} }

View File

@ -23,7 +23,7 @@ import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
/** /**
* * Storage result after successful upload
* @author Zheng Jie * @author Zheng Jie
* @date 2018-12-31 * @date 2018-12-31
*/ */
@ -39,26 +39,26 @@ public class QiniuContent implements Serializable {
private Long id; private Long id;
@Column(name = "name") @Column(name = "name")
@ApiModelProperty(value = "文件名") @ApiModelProperty(value = "File name")
private String key; private String key;
@ApiModelProperty(value = "空间名") @ApiModelProperty(value = "Bucket name")
private String bucket; private String bucket;
@ApiModelProperty(value = "大小") @ApiModelProperty(value = "Size")
private String size; private String size;
@ApiModelProperty(value = "文件地址") @ApiModelProperty(value = "File address")
private String url; private String url;
@ApiModelProperty(value = "文件类型") @ApiModelProperty(value = "File type")
private String suffix; private String suffix;
@ApiModelProperty(value = "空间类型:公开/私有") @ApiModelProperty(value = "Space type: public/private")
private String type = "公开"; private String type = "public";
@UpdateTimestamp @UpdateTimestamp
@ApiModelProperty(value = "创建或更新时间") @ApiModelProperty(value = "Creation or update time")
@Column(name = "update_time") @Column(name = "update_time")
private Timestamp updateTime; private Timestamp updateTime;
} }

View File

@ -28,14 +28,14 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
* * Send Email
* @author * @author Zheng Jie
* @date 2018/09/28 6:55:53 * @date 2018/09/28 6:55:53
*/ */
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("api/email") @RequestMapping("api/email")
@Api(tags = "工具:邮件管理") @Api(tags = "Tools: Email Management")
public class EmailController { public class EmailController {
private final EmailService emailService; private final EmailService emailService;
@ -45,17 +45,17 @@ public class EmailController {
return new ResponseEntity<>(emailService.find(),HttpStatus.OK); return new ResponseEntity<>(emailService.find(),HttpStatus.OK);
} }
@Log("配置邮件") @Log("Configure email")
@PutMapping @PutMapping
@ApiOperation("配置邮件") @ApiOperation("Configure email")
public ResponseEntity<Object> updateEmailConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception { public ResponseEntity<Object> updateEmailConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception {
emailService.config(emailConfig,emailService.find()); emailService.config(emailConfig,emailService.find());
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }
@Log("发送邮件") @Log("Send email")
@PostMapping @PostMapping
@ApiOperation("发送邮件") @ApiOperation("Send email")
public ResponseEntity<Object> sendEmail(@Validated @RequestBody EmailVo emailVo){ public ResponseEntity<Object> sendEmail(@Validated @RequestBody EmailVo emailVo){
emailService.send(emailVo,emailService.find()); emailService.send(emailVo,emailService.find());
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);

View File

@ -41,20 +41,20 @@ import java.io.IOException;
*/ */
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "工具:本地存储管理") @Api(tags = "Tools: Local Storage Management")
@RequestMapping("/api/localStorage") @RequestMapping("/api/localStorage")
public class LocalStorageController { public class LocalStorageController {
private final LocalStorageService localStorageService; private final LocalStorageService localStorageService;
@GetMapping @GetMapping
@ApiOperation("查询文件") @ApiOperation("Query files")
@PreAuthorize("@el.check('storage:list')") @PreAuthorize("@el.check('storage:list')")
public ResponseEntity<PageResult<LocalStorageDto>> queryFile(LocalStorageQueryCriteria criteria, Pageable pageable){ public ResponseEntity<PageResult<LocalStorageDto>> queryFile(LocalStorageQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(localStorageService.queryAll(criteria,pageable),HttpStatus.OK); return new ResponseEntity<>(localStorageService.queryAll(criteria,pageable),HttpStatus.OK);
} }
@ApiOperation("导出数据") @ApiOperation("Export data")
@GetMapping(value = "/download") @GetMapping(value = "/download")
@PreAuthorize("@el.check('storage:list')") @PreAuthorize("@el.check('storage:list')")
public void exportFile(HttpServletResponse response, LocalStorageQueryCriteria criteria) throws IOException { public void exportFile(HttpServletResponse response, LocalStorageQueryCriteria criteria) throws IOException {
@ -62,37 +62,37 @@ public class LocalStorageController {
} }
@PostMapping @PostMapping
@ApiOperation("上传文件") @ApiOperation("Upload file")
@PreAuthorize("@el.check('storage:add')") @PreAuthorize("@el.check('storage:add')")
public ResponseEntity<Object> createFile(@RequestParam String name, @RequestParam("file") MultipartFile file){ public ResponseEntity<Object> createFile(@RequestParam String name, @RequestParam("file") MultipartFile file){
localStorageService.create(name, file); localStorageService.create(name, file);
return new ResponseEntity<>(HttpStatus.CREATED); return new ResponseEntity<>(HttpStatus.CREATED);
} }
@ApiOperation("上传图片") @ApiOperation("Upload image")
@PostMapping("/pictures") @PostMapping("/pictures")
public ResponseEntity<LocalStorage> uploadPicture(@RequestParam MultipartFile file){ public ResponseEntity<LocalStorage> uploadPicture(@RequestParam MultipartFile file){
// 判断文件是否为图片 // Determine whether the file is an image
String suffix = FileUtil.getExtensionName(file.getOriginalFilename()); String suffix = FileUtil.getExtensionName(file.getOriginalFilename());
if(!FileUtil.IMAGE.equals(FileUtil.getFileType(suffix))){ if(!FileUtil.IMAGE.equals(FileUtil.getFileType(suffix))){
throw new BadRequestException("只能上传图片"); throw new BadRequestException("Only images can be uploaded");
} }
LocalStorage localStorage = localStorageService.create(null, file); LocalStorage localStorage = localStorageService.create(null, file);
return new ResponseEntity<>(localStorage, HttpStatus.OK); return new ResponseEntity<>(localStorage, HttpStatus.OK);
} }
@PutMapping @PutMapping
@Log("修改文件") @Log("Update file")
@ApiOperation("修改文件") @ApiOperation("Update file")
@PreAuthorize("@el.check('storage:edit')") @PreAuthorize("@el.check('storage:edit')")
public ResponseEntity<Object> updateFile(@Validated @RequestBody LocalStorage resources){ public ResponseEntity<Object> updateFile(@Validated @RequestBody LocalStorage resources){
localStorageService.update(resources); localStorageService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
@Log("删除文件") @Log("Delete file")
@DeleteMapping @DeleteMapping
@ApiOperation("多选删除") @ApiOperation("Batch delete")
public ResponseEntity<Object> deleteFile(@RequestBody Long[] ids) { public ResponseEntity<Object> deleteFile(@RequestBody Long[] ids) {
localStorageService.deleteAll(ids); localStorageService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);

40
pom.xml
View File

@ -16,7 +16,7 @@
<module>sport</module> <module>sport</module>
</modules> </modules>
<name>ELADMIN 后台管理</name> <name>ELADMIN Admin Backend</name>
<url>https://eladmin.vip</url> <url>https://eladmin.vip</url>
<parent> <parent>
@ -37,7 +37,7 @@
</properties> </properties>
<dependencies> <dependencies>
<!--Spring boot 核心--> <!--Spring boot core-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-data-jpa</artifactId>
@ -49,12 +49,12 @@
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> </dependency>
<!--Spring boot Web容器--> <!--Spring boot Web container-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions> <exclusions>
<!-- 去掉Jackson依赖fastjson --> <!-- Remove Jackson dependency, use fastjson -->
<exclusion> <exclusion>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId> <artifactId>spring-boot-starter-json</artifactId>
@ -62,20 +62,20 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!--Spring boot 测试--> <!--Spring boot test-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!--Spring boot 安全框架--> <!--Spring boot security framework-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId> <artifactId>spring-boot-starter-security</artifactId>
</dependency> </dependency>
<!-- spring boot 缓存 --> <!-- spring boot cache -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId> <artifactId>spring-boot-starter-cache</artifactId>
@ -94,7 +94,7 @@
<version>3.17.1</version> <version>3.17.1</version>
</dependency> </dependency>
<!--spring boot 集成redis所需common-pool2--> <!--spring boot integration with redis requires common-pool2-->
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 --> <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 -->
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
@ -106,20 +106,20 @@
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<!--监控sql日志--> <!--SQL log monitoring-->
<dependency> <dependency>
<groupId>p6spy</groupId> <groupId>p6spy</groupId>
<artifactId>p6spy</artifactId> <artifactId>p6spy</artifactId>
<version>3.9.1</version> <version>3.9.1</version>
</dependency> </dependency>
<!-- Swagger UI 相关 --> <!-- Swagger UI related -->
<dependency> <dependency>
<groupId>com.github.xiaoymin</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.3</version> <version>3.0.3</version>
<exclusions> <exclusions>
<!-- 去掉 swagger-annotations 依赖,避免冲突 --> <!-- Remove swagger-annotations dependency to avoid conflicts -->
<exclusion> <exclusion>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
@ -127,14 +127,14 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- 添加swagger-annotations依赖 --> <!-- Add swagger-annotations dependency -->
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>1.5.22</version> <version>1.5.22</version>
</dependency> </dependency>
<!--Mysql依赖包--> <!--Mysql dependency package-->
<dependency> <dependency>
<groupId>com.mysql</groupId> <groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId> <artifactId>mysql-connector-j</artifactId>
@ -142,28 +142,28 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- druid数据源驱动 --> <!-- druid data source driver -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId> <artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version> <version>${druid.version}</version>
</dependency> </dependency>
<!-- IP地址解析库 --> <!-- IP address parsing library -->
<dependency> <dependency>
<groupId>net.dreamlu</groupId> <groupId>net.dreamlu</groupId>
<artifactId>mica-ip2region</artifactId> <artifactId>mica-ip2region</artifactId>
<version>2.7.18.9</version> <version>2.7.18.9</version>
</dependency> </dependency>
<!--lombok插件--> <!--lombok plugin-->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- excel工具 --> <!-- excel tool -->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
@ -193,7 +193,7 @@
<version>${fastjson2.version}</version> <version>${fastjson2.version}</version>
</dependency> </dependency>
<!-- Java图形验证码 --> <!-- Java graphical captcha -->
<dependency> <dependency>
<groupId>com.github.whvcse</groupId> <groupId>com.github.whvcse</groupId>
<artifactId>easy-captcha</artifactId> <artifactId>easy-captcha</artifactId>
@ -206,7 +206,7 @@
<version>1.13.0</version> <version>1.13.0</version>
</dependency> </dependency>
<!--mapStruct依赖--> <!--mapStruct dependency-->
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId> <artifactId>mapstruct</artifactId>
@ -233,7 +233,7 @@
<build> <build>
<plugins> <plugins>
<!-- 打包时跳过测试 --> <!-- Skip tests during packaging -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -1,64 +1,64 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!--工具栏--> <!-- Toolbar -->
<div class="head-container"> <div class="head-container">
<div v-if="crud.props.searchToggle"> <div v-if="crud.props.searchToggle">
<!-- 搜索 --> <!-- Search -->
<label class="el-form-item-label">名称</label> <label class="el-form-item-label">Name</label>
<el-input v-model="query.name" clearable placeholder="名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.name" clearable placeholder="Name" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<label class="el-form-item-label">创建时间</label> <label class="el-form-item-label">Creation Time</label>
<el-input v-model="query.createTime" clearable placeholder="创建时间" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.createTime" clearable placeholder="Creation Time" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<label class="el-form-item-label">是否启用</label> <label class="el-form-item-label">Enabled</label>
<el-input v-model="query.enabled" clearable placeholder="是否启用" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-input v-model="query.enabled" clearable placeholder="Enabled" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation :crud="crud" /> <rrOperation :crud="crud" />
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!-- If you want to add more buttons to the toolbar, you can use slots. slot = 'left' or 'right' -->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表单组件--> <!-- Form component -->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="id"> <el-form-item label="id">
<el-input v-model="form.id" style="width: 370px;" /> <el-input v-model="form.id" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="Name" prop="name">
<el-input v-model="form.name" style="width: 370px;" /> <el-input v-model="form.name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="描述"> <el-form-item label="Description">
<el-input v-model="form.description" :rows="3" type="textarea" style="width: 370px;" /> <el-input v-model="form.description" :rows="3" type="textarea" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="Creation Time">
<el-date-picker v-model="form.createTime" type="datetime" style="width: 370px;" /> <el-date-picker v-model="form.createTime" type="datetime" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="更新时间"> <el-form-item label="Update Time">
<el-date-picker v-model="form.updateTime" type="datetime" style="width: 370px;" /> <el-date-picker v-model="form.updateTime" type="datetime" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="图标"> <el-form-item label="Icon">
<el-input v-model="form.icon" style="width: 370px;" /> <el-input v-model="form.icon" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="Sort">
<el-input v-model="form.sort" style="width: 370px;" /> <el-input v-model="form.sort" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="是否启用"> <el-form-item label="Enabled">
未设置字典请手动设置 Radio Dictionary not set, please manually set Radio
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU"></el-button> <el-button type="text" @click="crud.cancelCU">Cancel</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU"></el-button> <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">Confirm</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!-- Table rendering -->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="id" label="id" /> <el-table-column prop="id" label="id" />
<el-table-column prop="name" label="名称" /> <el-table-column prop="name" label="Name" />
<el-table-column prop="description" label="描述" /> <el-table-column prop="description" label="Description" />
<el-table-column prop="createTime" label="创建时间" /> <el-table-column prop="createTime" label="Creation Time" />
<el-table-column prop="updateTime" label="更新时间" /> <el-table-column prop="updateTime" label="Update Time" />
<el-table-column prop="icon" label="图标" /> <el-table-column prop="icon" label="Icon" />
<el-table-column prop="sort" label="排序" /> <el-table-column prop="sort" label="Sort" />
<el-table-column prop="enabled" label="是否启用" /> <el-table-column prop="enabled" label="Enabled" />
<el-table-column v-if="checkPer(['admin','sport:edit','sport:del'])" label="操作" width="150px" align="center"> <el-table-column v-if="checkPer(['admin','sport:edit','sport:del'])" label="Operation" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
:data="scope.row" :data="scope.row"
@ -67,7 +67,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!-- Pagination component -->
<pagination /> <pagination />
</div> </div>
</div> </div>
@ -87,7 +87,7 @@ export default {
components: { pagination, crudOperation, rrOperation, udOperation }, components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ title: 'sport', url: 'api/sport', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSport }}) return CRUD({ title: 'Sport', url: 'api/sport', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSport }})
}, },
data() { data() {
return { return {
@ -98,18 +98,18 @@ export default {
}, },
rules: { rules: {
name: [ name: [
{ required: true, message: '名称不能为空', trigger: 'blur' } { required: true, message: 'Name cannot be empty', trigger: 'blur' }
] ]
}, },
queryTypeOptions: [ queryTypeOptions: [
{ key: 'name', display_name: '名称' }, { key: 'name', display_name: 'Name' },
{ key: 'createTime', display_name: '创建时间' }, { key: 'createTime', display_name: 'Creation Time' },
{ key: 'enabled', display_name: '是否启用' } { key: 'enabled', display_name: 'Enabled' }
] ]
} }
}, },
methods: { methods: {
// false // Hook: executed before getting table data, return false to prevent data from being retrieved
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
return true return true
} }

View File

@ -46,45 +46,45 @@ public class Club implements Serializable {
@Column(name = "`name`",nullable = false) @Column(name = "`name`",nullable = false)
@NotBlank @NotBlank
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "Name")
private String name; private String name;
@Column(name = "`description`") @Column(name = "`description`")
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "Description")
private String description; private String description;
@Column(name = "`create_time`") @Column(name = "`create_time`")
@CreationTimestamp @CreationTimestamp
@ApiModelProperty(value = "创建时间", hidden = true) @ApiModelProperty(value = "Creation time", hidden = true)
private Timestamp createTime; private Timestamp createTime;
@Column(name = "`update_time`") @Column(name = "`update_time`")
@UpdateTimestamp @UpdateTimestamp
@ApiModelProperty(value = "更新时间", hidden = true) @ApiModelProperty(value = "Update time", hidden = true)
private Timestamp updateTime; private Timestamp updateTime;
@Column(name = "`icon`") @Column(name = "`icon`")
@ApiModelProperty(value = "图标") @ApiModelProperty(value = "Icon")
private String icon; private String icon;
@Column(name = "`sort`") @Column(name = "`sort`")
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "Sort")
private Integer sort; private Integer sort;
@Column(name = "`enabled`") @Column(name = "`enabled`")
@ApiModelProperty(value = "是否启用") @ApiModelProperty(value = "Enabled")
private Boolean enabled; private Boolean enabled;
@Column(name = "`location`") @Column(name = "`location`")
@ApiModelProperty(value = "位置") @ApiModelProperty(value = "Location")
private String location; private String location;
@Column(name = "`longitude`") @Column(name = "`longitude`")
@ApiModelProperty(value = "经度") @ApiModelProperty(value = "Longitude")
private Double longitude; private Double longitude;
@Column(name = "`latitude`") @Column(name = "`latitude`")
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "Latitude")
private Double latitude; private Double latitude;
public void copy(Club source){ public void copy(Club source){

View File

@ -54,17 +54,17 @@ public class Court implements Serializable {
@Column(name = "`create_time`") @Column(name = "`create_time`")
@CreationTimestamp @CreationTimestamp
@ApiModelProperty(value = "创建时间", hidden = true) @ApiModelProperty(value = "Creation time", hidden = true)
private Timestamp createTime; private Timestamp createTime;
@Column(name = "`update_time`") @Column(name = "`update_time`")
@UpdateTimestamp @UpdateTimestamp
@ApiModelProperty(value = "更新时间", hidden = true) @ApiModelProperty(value = "Update time", hidden = true)
private Timestamp updateTime; private Timestamp updateTime;
@Column(name = "`amount`",nullable = false) @Column(name = "`amount`",nullable = false)
@NotNull @NotNull
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "Amount")
private Integer amount; private Integer amount;
public void copy(Court source){ public void copy(Court source){

View File

@ -47,37 +47,37 @@ public class Player implements Serializable {
@Column(name = "`name`",nullable = false) @Column(name = "`name`",nullable = false)
@NotBlank @NotBlank
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "Name")
private String name; private String name;
@Column(name = "`description`") @Column(name = "`description`")
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "Description")
private String description; private String description;
@Column(name = "`latitude`") @Column(name = "`latitude`")
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "Latitude")
private Double latitude; private Double latitude;
@Column(name = "`longitude`") @Column(name = "`longitude`")
@ApiModelProperty(value = "经度") @ApiModelProperty(value = "Longitude")
private Double longitude; private Double longitude;
@Column(name = "`profile_image`") @Column(name = "`profile_image`")
@ApiModelProperty(value = "图片") @ApiModelProperty(value = "Image")
private String profileImage; private String profileImage;
@Column(name = "`create_time`") @Column(name = "`create_time`")
@CreationTimestamp @CreationTimestamp
@ApiModelProperty(value = "创建时间", hidden = true) @ApiModelProperty(value = "Creation time", hidden = true)
private Timestamp createTime; private Timestamp createTime;
@Column(name = "`update_time`") @Column(name = "`update_time`")
@UpdateTimestamp @UpdateTimestamp
@ApiModelProperty(value = "更新时间", hidden = true) @ApiModelProperty(value = "Update time", hidden = true)
private Timestamp updateTime; private Timestamp updateTime;
@Column(name = "`rate_score`") @Column(name = "`rate_score`")
@ApiModelProperty(value = "评分") @ApiModelProperty(value = "Score")
private Double rateScore; private Double rateScore;
@Column(name = "`user_id`",nullable = false) @Column(name = "`user_id`",nullable = false)

View File

@ -47,33 +47,33 @@ public class Sport implements Serializable {
@Column(name = "`name`",nullable = false) @Column(name = "`name`",nullable = false)
@NotBlank @NotBlank
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "Name")
private String name; private String name;
@Column(name = "`description`") @Column(name = "`description`")
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "Description")
private String description; private String description;
@Column(name = "`create_time`") @Column(name = "`create_time`")
@CreationTimestamp @CreationTimestamp
@ApiModelProperty(value = "创建时间", hidden = true) @ApiModelProperty(value = "Creation time", hidden = true)
private Timestamp createTime; private Timestamp createTime;
@Column(name = "`update_time`") @Column(name = "`update_time`")
@UpdateTimestamp @UpdateTimestamp
@ApiModelProperty(value = "更新时间", hidden = true) @ApiModelProperty(value = "Update time", hidden = true)
private Timestamp updateTime; private Timestamp updateTime;
@Column(name = "`icon`") @Column(name = "`icon`")
@ApiModelProperty(value = "图标") @ApiModelProperty(value = "Icon")
private String icon; private String icon;
@Column(name = "`sort`") @Column(name = "`sort`")
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "Sort")
private Integer sort; private Integer sort;
@Column(name = "`enabled`") @Column(name = "`enabled`")
@ApiModelProperty(value = "是否启用") @ApiModelProperty(value = "Enabled")
private Boolean enabled; private Boolean enabled;
public void copy(Sport source){ public void copy(Sport source){