mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-14 14:43:48 +08:00
2.0的js版本和后端 完成
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
||||
net.lab1024.sa.common.config.PostProcessorConfig
|
||||
19
smart-admin-api/sa-common/src/main/resources/banner.txt
Normal file
19
smart-admin-api/sa-common/src/main/resources/banner.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
${AnsiColor.BRIGHT_GREEN}
|
||||
|
||||
/ ____| | | /\ | | (_)
|
||||
| (___ _ __ ___ __ _ _ __| |_ / \ __| |_ __ ___ _ _ __
|
||||
\___ \| '_ ` _ \ / _` | '__| __| / /\ \ / _` | '_ ` _ \| | '_ \
|
||||
____) | | | | | | (_| | | | |_ / ____ \ (_| | | | | | | | | | |
|
||||
|_____/|_| |_| |_|\__,_|_| \__/_/ \_\__,_|_| |_| |_|_|_| |_|
|
||||
|
||||
保持谦逊 保持学习 !
|
||||
热爱代码 热爱生活 !
|
||||
永远年轻 永远前行 !
|
||||
|
||||
SmartAdmin v2.X ,作者:1024创新实验室 @copyright:【 1024lab 】
|
||||
|
||||
SmartAdmin 文档地址:https://smartadmin.1024lab.net
|
||||
|
||||
1024创新实验室:https://www.1024lab.net
|
||||
|
||||
${AnsiColor.DEFAULT}
|
||||
@@ -0,0 +1,24 @@
|
||||
package ${packageName};
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.lab1024.sa.common.common.enumeration.BaseEnum;
|
||||
|
||||
/**
|
||||
* ${enumDesc}
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ${enumName} implements BaseEnum {
|
||||
|
||||
;
|
||||
|
||||
private final ${enumJavaType} value;
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* ${basic.description} Controller
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Api(tags = "")
|
||||
public class ${name.upperCamel}Controller {
|
||||
|
||||
@Autowired
|
||||
private ${name.upperCamel}Service ${name.lowerCamel}Service;
|
||||
|
||||
@ApiOperation("分页查询 @author ${basic.backendAuthor}")
|
||||
@PostMapping("/${name.lowerCamel}/queryPage")
|
||||
public ResponseDTO<PageResult<${name.upperCamel}VO>> queryPage(@RequestBody @Valid ${name.upperCamel}QueryForm queryForm) {
|
||||
return ResponseDTO.ok(${name.lowerCamel}Service.queryPage(queryForm));
|
||||
}
|
||||
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
@ApiOperation("添加 @author ${basic.backendAuthor}")
|
||||
@PostMapping("/${name.lowerCamel}/add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid ${name.upperCamel}AddForm addForm) {
|
||||
return ${name.lowerCamel}Service.add(addForm);
|
||||
}
|
||||
|
||||
@ApiOperation("更新 @author ${basic.backendAuthor}")
|
||||
@PostMapping("/${name.lowerCamel}/update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid ${name.upperCamel}UpdateForm updateForm) {
|
||||
return ${name.lowerCamel}Service.update(updateForm);
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
@ApiOperation("批量删除 @author ${basic.backendAuthor}")
|
||||
@PostMapping("/${name.lowerCamel}/batchDelete")
|
||||
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<${primaryKeyJavaType}> idList) {
|
||||
return ${name.lowerCamel}Service.batchDelete(idList);
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
@ApiOperation("单个删除 @author ${basic.backendAuthor}")
|
||||
@GetMapping("/${name.lowerCamel}/delete/{${name.lowerCamel}Id}")
|
||||
public ResponseDTO<String> batchDelete(@PathVariable ${primaryKeyJavaType} ${primaryKeyFieldName}) {
|
||||
return ${name.lowerCamel}Service.delete(${name.lowerCamel}Id);
|
||||
}
|
||||
#end
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* ${basic.description} Dao
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Entity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<${name.upperCamel}VO> queryPage(Page page, @Param("queryForm") ${name.upperCamel}QueryForm queryForm);
|
||||
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
### 假删除
|
||||
#if(!${deleteInfo.isPhysicallyDeleted})
|
||||
#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
/**
|
||||
* 更新删除状态
|
||||
*/
|
||||
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag);
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
/**
|
||||
* 批量更新删除状态
|
||||
*/
|
||||
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("${deletedFlag}")boolean deletedFlag);
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package ${basic.javaPackageName}.domain.entity;
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${basic.description} 实体类
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("${tableName}")
|
||||
public class ${name.upperCamel}Entity {
|
||||
#foreach ($field in $fields)
|
||||
|
||||
/**
|
||||
* $field.label
|
||||
*/
|
||||
#if($field.primaryKeyFlag && $field.autoIncreaseFlag)
|
||||
@TableId(type = IdType.AUTO)
|
||||
#end
|
||||
#if($field.primaryKeyFlag && !$field.autoIncreaseFlag)
|
||||
@TableId
|
||||
#end
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${basic.description} 新建表单
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ${name.upperCamel}AddForm {
|
||||
#foreach ($field in $fields)
|
||||
|
||||
#if($field.isEnum)
|
||||
${field.apiModelProperty}
|
||||
${field.checkEnum}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#if(!$field.isEnum)
|
||||
${field.apiModelProperty}$!{field.notEmpty}$!{field.dict}$!{field.file}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package ${packageName};
|
||||
|
||||
import net.lab1024.sa.common.common.domain.PageParam;
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${basic.description} 分页查询表单
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ${name.upperCamel}QueryForm extends PageParam{
|
||||
#foreach ($field in $fields)
|
||||
|
||||
#if($field.isEnum)
|
||||
${field.apiModelProperty}
|
||||
${field.checkEnum}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#if(!$field.isEnum && $field.queryTypeEnum != "DateRange")
|
||||
${field.apiModelProperty}$!{field.dict}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#if(!$field.isEnum && $field.queryTypeEnum == "DateRange")
|
||||
${field.apiModelProperty}
|
||||
private $field.javaType ${field.fieldName}Begin;
|
||||
|
||||
${field.apiModelProperty}
|
||||
private $field.javaType ${field.fieldName}End;
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${basic.description} 更新表单
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ${name.upperCamel}UpdateForm {
|
||||
#foreach ($field in $fields)
|
||||
|
||||
#if($field.isEnum)
|
||||
${field.apiModelProperty}
|
||||
${field.checkEnum}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#if(!$field.isEnum)
|
||||
${field.apiModelProperty}$!{field.notEmpty}$!{field.dict}$!{field.file}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${basic.description} 列表VO
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ${name.upperCamel}VO {
|
||||
|
||||
private $!{primaryKeyJavaType} $!{primaryKeyFieldName};
|
||||
|
||||
#foreach ($field in $fields)
|
||||
|
||||
#if($field.isEnum)
|
||||
${field.apiModelProperty}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#if(!$field.isEnum)
|
||||
${field.apiModelProperty}$!{field.dict}$!{field.file}
|
||||
private $field.javaType $field.fieldName;
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* ${basic.description} Manager
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
@Service
|
||||
public class ${name.upperCamel}Manager extends ServiceImpl<${name.upperCamel}Dao, ${name.upperCamel}Entity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${daoClassName}">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="${basic.javaPackageName}.domain.vo.${name.upperCamel}VO">
|
||||
SELECT
|
||||
*
|
||||
FROM ${tableName}
|
||||
#if($queryFields.size() > 0)
|
||||
<where>
|
||||
#foreach ($queryField in $queryFields)
|
||||
<!--${queryField.label}-->
|
||||
#if(${queryField.queryTypeEnum} == "Like")
|
||||
<if test="queryForm.${queryField.fieldName} != null and queryForm.${queryField.fieldName} != ''">
|
||||
${queryField.likeStr}
|
||||
</if>
|
||||
#end
|
||||
#if(${queryField.queryTypeEnum} == "Equal" || ${queryField.queryTypeEnum} == "Enum" || ${queryField.queryTypeEnum} == "Dict")
|
||||
<if test="queryForm.${queryField.fieldName} != null">
|
||||
AND ${tableName}.${queryField.columnName} = #{queryForm.${queryField.fieldName}}
|
||||
</if>
|
||||
#end
|
||||
#if(${queryField.queryTypeEnum} == "Date")
|
||||
<if test="queryForm.${queryField.fieldName} != null">
|
||||
AND DATE_FORMAT(${tableName}.${queryField.columnName}, '%Y-%m-%d') = #{queryForm.${queryField.fieldName}}
|
||||
</if>
|
||||
#end
|
||||
#if(${queryField.queryTypeEnum} == "DateRange")
|
||||
<if test="queryForm.${queryField.fieldName}Begin != null">
|
||||
AND DATE_FORMAT(${tableName}.${queryField.columnName}, '%Y-%m-%d') >= #{queryForm.${queryField.fieldName}Begin}
|
||||
</if>
|
||||
<if test="queryForm.${queryField.fieldName}End != null">
|
||||
AND DATE_FORMAT(${tableName}.${queryField.columnName}, '%Y-%m-%d') <= #{queryForm.${queryField.fieldName}End}
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
</where>
|
||||
#end
|
||||
</select>
|
||||
|
||||
#if($dao.deletedFieldUpperName != $null)
|
||||
<update id="batchUpdate${dao.deletedFieldUpperName}">
|
||||
update ${mapper.tableName} set ${mapper.deletedColumnName} = #{deletedFlag}
|
||||
where ${mapper.mainKeyColumnName} in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
#end
|
||||
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
### 假删除
|
||||
#if(!${deleteInfo.isPhysicallyDeleted})
|
||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
|
||||
<update id="batchUpdateDeleted">
|
||||
update ${tableName} set deleted_flag = #{deletedFlag}
|
||||
where ${primaryKeyColumnName} in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
|
||||
<update id="updateDeleted">
|
||||
update ${tableName} set deleted_flag = #{deletedFlag}
|
||||
where ${primaryKeyColumnName} = #{${primaryKeyFieldName}}
|
||||
</update>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</mapper>
|
||||
@@ -0,0 +1,108 @@
|
||||
package ${packageName};
|
||||
|
||||
#foreach ($importClass in $importPackageList)
|
||||
$importClass
|
||||
#end
|
||||
import net.lab1024.sa.common.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* ${basic.description} Service
|
||||
*
|
||||
* @Author ${basic.backendAuthor}
|
||||
* @Date ${basic.backendDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class ${name.upperCamel}Service {
|
||||
|
||||
@Autowired
|
||||
private ${name.upperCamel}Dao ${name.lowerCamel}Dao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
public PageResult<${name.upperCamel}VO> queryPage(${name.upperCamel}QueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<${name.upperCamel}VO> list = ${name.lowerCamel}Dao.queryPage(page, queryForm);
|
||||
PageResult<${name.upperCamel}VO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public ResponseDTO<String> add(${name.upperCamel}AddForm addForm) {
|
||||
${name.upperCamel}Entity ${name.lowerCamel}Entity = SmartBeanUtil.copy(addForm, ${name.upperCamel}Entity.class);
|
||||
${name.lowerCamel}Dao.insert(${name.lowerCamel}Entity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param updateForm
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> update(${name.upperCamel}UpdateForm updateForm) {
|
||||
${name.upperCamel}Entity ${name.lowerCamel}Entity = SmartBeanUtil.copy(updateForm, ${name.upperCamel}Entity.class);
|
||||
${name.lowerCamel}Dao.updateById(${name.lowerCamel}Entity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
#if($deleteInfo.deleteEnum == "BATCH" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> batchDelete(List<${primaryKeyJavaType}> idList) {
|
||||
if (CollectionUtils.isEmpty(idList)){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
### 真删除 or 假删除
|
||||
#if(!${deleteInfo.isPhysicallyDeleted})
|
||||
${name.lowerCamel}Dao.batchUpdateDeleted(idList, true);
|
||||
#else
|
||||
${name.lowerCamel}Dao.deleteBatchIds(idList);
|
||||
#end
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
/**
|
||||
* 单个删除
|
||||
*/
|
||||
public ResponseDTO<String> delete(${primaryKeyJavaType} ${primaryKeyFieldName}) {
|
||||
if (null == ${primaryKeyFieldName}){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
### 真删除 or 假删除
|
||||
#if(!${deleteInfo.isPhysicallyDeleted})
|
||||
${name.lowerCamel}Dao.updateDeleted(${primaryKeyFieldName},true);
|
||||
#end
|
||||
#if(${deleteInfo.isPhysicallyDeleted})
|
||||
${name.lowerCamel}Dao.deleteById(${primaryKeyFieldName});
|
||||
#end
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
#end
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* ${basic.description} api 封装
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
|
||||
export const ${name.lowerCamel}Api = {
|
||||
|
||||
/**
|
||||
* 分页查询 @author ${basic.frontAuthor}
|
||||
*/
|
||||
queryPage : (param) => {
|
||||
return postRequest('/${name.lowerCamel}/queryPage', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 增加 @author ${basic.frontAuthor}
|
||||
*/
|
||||
add: (param) => {
|
||||
return postRequest('/${name.lowerCamel}/add', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改 @author ${basic.frontAuthor}
|
||||
*/
|
||||
update: (param) => {
|
||||
return postRequest('/${name.lowerCamel}/update', param);
|
||||
},
|
||||
## ------------------ 详情 ------------------
|
||||
|
||||
#if($deleteInfo.isSupportDetail)
|
||||
/**
|
||||
* 获取详情 @author ${basic.frontAuthor}
|
||||
*/
|
||||
getDetail: (id) => {
|
||||
return getRequest(`/${name.lowerCamel}/getDetail/\${id}`);
|
||||
},
|
||||
#end
|
||||
|
||||
## ------------------ 删除 ------------------
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
#if($deleteInfo.deleteEnum == 'Single')
|
||||
/**
|
||||
* 删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
delete: (id) => {
|
||||
return getRequest(`/${name.lowerCamel}/delete/${id}`);
|
||||
},
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == 'Batch')
|
||||
/**
|
||||
* 批量删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
batchDelete: (idList) => {
|
||||
return postRequest('/${name.lowerCamel}/batchDelete', idList);
|
||||
},
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == 'SingleAndBatch')
|
||||
/**
|
||||
* 删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
delete: (id) => {
|
||||
return getRequest(`/${name.lowerCamel}/delete/${id}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
batchDelete: (idList) => {
|
||||
return postRequest('/${name.lowerCamel}/batchDelete', idList);
|
||||
},
|
||||
#end
|
||||
#end
|
||||
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* ${basic.description} 枚举
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
#foreach ($enum in $enumList)
|
||||
|
||||
/**
|
||||
* $enum.columnComment
|
||||
*/
|
||||
export const $enum.upperUnderscoreEnum = {
|
||||
|
||||
}
|
||||
#end
|
||||
|
||||
export default {
|
||||
#foreach ($enum in $enumList)
|
||||
$enum.upperUnderscoreEnum,
|
||||
#end
|
||||
};
|
||||
@@ -0,0 +1,181 @@
|
||||
<!--
|
||||
* ${basic.description}
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
-->
|
||||
<template>
|
||||
<a-$!{insertAndUpdate.pageType}
|
||||
:title="form.$!{primaryKeyFieldName} ? '编辑' : '添加'"
|
||||
width="$!{insertAndUpdate.width}"
|
||||
:visible="visibleFlag"
|
||||
@close="onClose"
|
||||
:maskClosable="false"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }" >
|
||||
#if($insertAndUpdate.countPerLine > 1)
|
||||
<a-row>
|
||||
#end
|
||||
#foreach ($field in $formFields)
|
||||
#if($insertAndUpdate.countPerLine > 1)
|
||||
#set($span=24 / $!insertAndUpdate.countPerLine )
|
||||
<a-col :span="$!{span}">
|
||||
#end
|
||||
#if($field.frontComponent == "Input")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "InputNumber")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Textarea")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "BooleanSelect")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" keyCode="$!{field.dict}" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DateTime")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Upload")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<FileUpload
|
||||
:defaultFileList="form.$!{field.fieldName}"
|
||||
:folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
|
||||
buttonText="上传 $!{field.label}"
|
||||
listType="text"
|
||||
@change="e => form.$!{field.fieldName} = e"
|
||||
/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#end
|
||||
#if($insertAndUpdate.countPerLine > 1)
|
||||
</a-col>
|
||||
<a-row>
|
||||
#end
|
||||
</a-form>
|
||||
|
||||
<template #footer>
|
||||
<a-space>
|
||||
<a-button @click="onClose">取消</a-button>
|
||||
<a-button type="primary" @click="onSubmit">保存</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-$!{insertAndUpdate.pageType}>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, nextTick } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { $!{name.lowerCamel}Api } from '/@/api/business/$!{name.lowerHyphenCamel}/$!{name.lowerHyphenCamel}-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
#foreach ($import in $frontImportList)
|
||||
$!{import}
|
||||
#end
|
||||
|
||||
// ------------------------ 事件 ------------------------
|
||||
|
||||
const emits = defineEmits(['reloadList']);
|
||||
|
||||
// ------------------------ 显示与隐藏 ------------------------
|
||||
// 是否显示
|
||||
const visibleFlag = ref(false);
|
||||
|
||||
function show(rowData) {
|
||||
Object.assign(form, formDefault);
|
||||
if (rowData && !_.isEmpty(rowData)) {
|
||||
Object.assign(form, rowData);
|
||||
}
|
||||
visibleFlag.value = true;
|
||||
nextTick(() => {
|
||||
formRef.value.clearValidate();
|
||||
});
|
||||
}
|
||||
|
||||
function onClose() {
|
||||
Object.assign(form, formDefault);
|
||||
visibleFlag.value = false;
|
||||
}
|
||||
|
||||
// ------------------------ 表单 ------------------------
|
||||
|
||||
// 组件ref
|
||||
const formRef = ref();
|
||||
|
||||
const formDefault = {
|
||||
$!{primaryKeyFieldName}: undefined,
|
||||
#foreach ($field in $formFields)
|
||||
$!{field.fieldName}: undefined, //$!{field.label}
|
||||
#end
|
||||
};
|
||||
|
||||
let form = reactive({ ...formDefault });
|
||||
|
||||
const rules = {
|
||||
#foreach ($field in $formFields)
|
||||
#if($field.requiredFlag)
|
||||
$!{field.fieldName}: [{ required: true, message: '$!{field.label} 必填' }],
|
||||
#end
|
||||
#end
|
||||
};
|
||||
|
||||
// 点击确定,验证表单
|
||||
async function onSubmit() {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
save();
|
||||
} catch (err) {
|
||||
message.error('参数验证错误,请仔细填写表单数据!');
|
||||
}
|
||||
}
|
||||
|
||||
// 新建、编辑API
|
||||
async function save() {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
if (form.$!{primaryKeyFieldName}) {
|
||||
await $!{name.lowerCamel}Api.update(form);
|
||||
} else {
|
||||
await $!{name.lowerCamel}Api.add(form);
|
||||
}
|
||||
message.success('操作成功');
|
||||
emits('reloadList');
|
||||
onClose();
|
||||
} catch (err) {
|
||||
smartSentry.captureError(err);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,317 @@
|
||||
<!--
|
||||
* ${basic.description}
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
-->
|
||||
<template>
|
||||
<!---------- 查询表单form begin ----------->
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
#foreach ($field in $queryFields)
|
||||
#if($field.queryTypeEnum == "Like")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-input style="width: ${field.width}" v-model:value="queryForm.${field.fieldName}" placeholder="${field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Equal")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-input style="width: ${field.width}" v-model:value="queryForm.${field.fieldName}" placeholder="${field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Dict")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<DictSelect keyCode="$!{field.dict}" placeholder="${field.label}" v-model:value="queryForm.${field.fieldName}" width="${field.width}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Enum")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc(${field.label})" class="smart-query-form-item">
|
||||
<SmartEnumSelect width="${field.width}" v-model:value="queryForm.${field.fieldName}" enumName="$!{field.frontEnumName}" placeholder="$codeGeneratorTool.removeEnumDesc(${field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Date")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="queryForm.$!{field.fieldName}" style="width: ${field.width}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "DateRange")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-range-picker v-model:value="queryForm.$!{field.fieldName}" :ranges="defaultTimeRanges" style="width: ${field.width}" @change="onChange$codeGeneratorTool.lowerCamel2UpperCamel(${field.fieldName})" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#end
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="queryData">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!---------- 查询表单form end ----------->
|
||||
|
||||
<a-card size="small" :bordered="false" :hoverable="true">
|
||||
<!---------- 表格操作行 begin ----------->
|
||||
<a-row class="smart-table-btn-block">
|
||||
<div class="smart-table-operate-block">
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
<a-button @click="showForm" type="primary" size="small">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
#end
|
||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
|
||||
<a-button @click="confirmBatchDelete" type="danger" size="small" :disabled="selectedRowKeyList.length == 0">
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
批量删除
|
||||
</a-button>
|
||||
#end
|
||||
</div>
|
||||
<div class="smart-table-setting-block">
|
||||
<TableOperator v-model="columns" :tableId="null" :refresh="queryData" />
|
||||
</div>
|
||||
</a-row>
|
||||
<!---------- 表格操作行 end ----------->
|
||||
|
||||
<!---------- 表格 begin ----------->
|
||||
<a-table
|
||||
size="small"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="$!{primaryKeyFieldName}"
|
||||
bordered
|
||||
:loading="tableLoading"
|
||||
:pagination="false"
|
||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
#end
|
||||
>
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
<a-button @click="showForm(record)" type="link">编辑</a-button>
|
||||
#end
|
||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Single"||$deleteInfo.deleteEnum == "SingleAndBatch"))
|
||||
<a-button @click="onDelete(record)" danger type="link">删除</a-button>
|
||||
#end
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<!---------- 表格 end ----------->
|
||||
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryData"
|
||||
@showSizeChange="queryData"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<$!{name.upperCamel}Form ref="formRef" @reloadList="queryData"/>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { $!{name.lowerCamel}Api } from '/@/api/business/$!{name.lowerHyphenCamel}/$!{name.lowerHyphenCamel}-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
#foreach ($import in $frontImportList)
|
||||
$!{import}
|
||||
#end
|
||||
// ---------------------------- 表格列 ----------------------------
|
||||
|
||||
const columns = ref([
|
||||
#foreach ($field in $tableFields)
|
||||
#if($field.showFlag)
|
||||
{
|
||||
title: '$!{field.label}',
|
||||
dataIndex: '$!{field.fieldName}',
|
||||
ellipsis: $!{field.ellipsisFlag},
|
||||
#if(${field.width} > 0)
|
||||
width: $!{field.width},
|
||||
#end
|
||||
},
|
||||
#end
|
||||
#end
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate || $insertAndUpdate.isSupportInsertAndUpdate)
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 90,
|
||||
},
|
||||
#end
|
||||
]);
|
||||
|
||||
// ---------------------------- 查询数据表单和方法 ----------------------------
|
||||
|
||||
const queryFormState = {
|
||||
#foreach ($field in $queryFields)
|
||||
#if($field.queryTypeEnum == "DateRange")
|
||||
$!{field.fieldName}: [], //$!{field.label}
|
||||
$!{field.fieldName}Begin: undefined, //$!{field.label} 开始
|
||||
$!{field.fieldName}End: undefined, //$!{field.label} 结束
|
||||
#end
|
||||
#if($field.queryTypeEnum != "DateRange")
|
||||
$!{field.fieldName}: undefined, //$!{field.label}
|
||||
#end
|
||||
#end
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
// 查询表单form
|
||||
const queryForm = reactive({ ...queryFormState });
|
||||
// 表格加载loading
|
||||
const tableLoading = ref(false);
|
||||
// 表格数据
|
||||
const tableData = ref([]);
|
||||
// 总数
|
||||
const total = ref(0);
|
||||
|
||||
// 重置查询条件
|
||||
function resetQuery() {
|
||||
let pageSize = queryForm.pageSize;
|
||||
Object.assign(queryForm, queryFormState);
|
||||
queryForm.pageSize = pageSize;
|
||||
queryData();
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
async function queryData() {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
let queryResult = await $!{name.lowerCamel}Api.queryPage(queryForm);
|
||||
tableData.value = queryResult.data.list;
|
||||
total.value = queryResult.data.total;
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
tableLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
#foreach ($field in $queryFields)
|
||||
#if($field.queryTypeEnum == "DateRange")
|
||||
function onChange$codeGeneratorTool.lowerCamel2UpperCamel(${field.fieldName})(dates, dateStrings){
|
||||
queryForm.$!{field.fieldName}Begin = dateStrings[0];
|
||||
queryForm.$!{field.fieldName}End = dateStrings[1];
|
||||
}
|
||||
|
||||
#end
|
||||
#end
|
||||
|
||||
onMounted(queryData);
|
||||
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
// ---------------------------- 添加/修改 ----------------------------
|
||||
const formRef = ref();
|
||||
|
||||
function showForm(data) {
|
||||
formRef.value.show(data);
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
// ---------------------------- 单个删除 ----------------------------
|
||||
//确认删除
|
||||
function onDelete(data){
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选吗?',
|
||||
okText: '删除',
|
||||
okType: 'danger',
|
||||
onOk() {
|
||||
requestDelete(data);
|
||||
},
|
||||
cancelText: '取消',
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
//请求删除
|
||||
async function requestDelete(data){
|
||||
SmartLoading.show();
|
||||
try {
|
||||
let deleteForm = {
|
||||
goodsIdList: selectedRowKeyList.value,
|
||||
};
|
||||
await $!{name.lowerCamel}Api.delete(data.$!{primaryKeyFieldName});
|
||||
message.success('删除成功');
|
||||
queryData();
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
// ---------------------------- 批量删除 ----------------------------
|
||||
|
||||
// 选择表格行
|
||||
const selectedRowKeyList = ref([]);
|
||||
|
||||
function onSelectChange(selectedRowKeys) {
|
||||
selectedRowKeyList.value = selectedRowKeys;
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
function confirmBatchDelete() {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要批量删除这些数据吗?',
|
||||
okText: '删除',
|
||||
okType: 'danger',
|
||||
onOk() {
|
||||
requestBatchDelete();
|
||||
},
|
||||
cancelText: '取消',
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
//请求批量删除
|
||||
async function requestBatchDelete() {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
await $!{name.lowerCamel}Api.batchDelete(selectedRowKeyList.value);
|
||||
message.success('删除成功');
|
||||
queryData();
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
#end
|
||||
#end
|
||||
</script>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<tools>
|
||||
<toolbox scope="application">
|
||||
<tool key="codeGeneratorTool" class="net.lab1024.sa.common.module.support.codegenerator.util.CodeGeneratorTool"></tool>
|
||||
</toolbox>
|
||||
</tools>
|
||||
129
smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml
Normal file
129
smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml
Normal file
@@ -0,0 +1,129 @@
|
||||
spring:
|
||||
# 数据库连接信息
|
||||
datasource:
|
||||
url: jdbc:p6spy:mysql://127.0.0.1:3307/smart_admin_v2?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: Lab024
|
||||
initial-size: 2
|
||||
min-idle: 2
|
||||
max-active: 10
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
filters: stat
|
||||
druid:
|
||||
username: druid
|
||||
password: 1024
|
||||
login:
|
||||
enabled: true
|
||||
method:
|
||||
pointcut: net.lab1024.sa..*Service.*
|
||||
|
||||
# redis 连接池配置信息
|
||||
redis:
|
||||
database: 1
|
||||
host: 127.0.0.1
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 5
|
||||
min-idle: 1
|
||||
max-idle: 3
|
||||
max-wait: 30000ms
|
||||
port: 6379
|
||||
timeout: 10000ms
|
||||
password:
|
||||
|
||||
# 上传文件大小配置
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
max-request-size: 30MB
|
||||
|
||||
# json序列化相关配置
|
||||
jackson:
|
||||
serialization:
|
||||
write-enums-using-to-string: true
|
||||
write-dates-as-timestamps: false
|
||||
deserialization:
|
||||
read-enums-using-to-string: true
|
||||
fail-on-unknown-properties: false
|
||||
default-property-inclusion: always
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
tomcat:
|
||||
basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)'
|
||||
|
||||
#swagger: 提高swagger 方法名称有重复的日志提示
|
||||
logging:
|
||||
level:
|
||||
springfox:
|
||||
documentation:
|
||||
spring:
|
||||
web:
|
||||
readers:
|
||||
operation:
|
||||
CachingOperationNameGenerator: warn
|
||||
scanners:
|
||||
ApiListingReferenceScanner: warn
|
||||
|
||||
# 文件上传 配置
|
||||
file:
|
||||
storage:
|
||||
mode: cloud
|
||||
local:
|
||||
path: ${localPath:/home}/smart_admin_v2/upload/
|
||||
cloud:
|
||||
region: oss-cn-qingdao
|
||||
endpoint: oss-cn-qingdao.aliyuncs.com
|
||||
bucket-name: common-sit
|
||||
access-key:
|
||||
secret-key:
|
||||
url:
|
||||
expire: 7200000
|
||||
public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
|
||||
# swagger 配置
|
||||
swagger:
|
||||
title: SmartAdmin
|
||||
description: SmartAdmin 2.0
|
||||
version: 2.0
|
||||
host: localhost:${server.port}
|
||||
package: net.lab1024.sa
|
||||
tag-class: net.lab1024.sa.common.constant.SwaggerTagConst
|
||||
team-url: https://www.1024lab.net/
|
||||
|
||||
# RestTemplate 请求配置
|
||||
http:
|
||||
pool:
|
||||
max-total: 20
|
||||
connect-timeout: 50000
|
||||
read-timeout: 50000
|
||||
write-timeout: 50000
|
||||
keep-alive: 300000
|
||||
|
||||
# token相关配置
|
||||
token:
|
||||
key: sa-jwt-key
|
||||
expire-day: 7
|
||||
|
||||
# 跨域配置
|
||||
access-control-allow-origin: '*'
|
||||
|
||||
# 心跳配置
|
||||
heart-beat:
|
||||
interval-seconds: 60
|
||||
|
||||
# 热加载配置
|
||||
reload:
|
||||
interval-seconds: 60
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.changelog.dao.ChangeLogDao">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.common.module.support.changelog.domain.vo.ChangeLogVO">
|
||||
SELECT
|
||||
*
|
||||
FROM t_change_log
|
||||
<where>
|
||||
<!--更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]-->
|
||||
<if test="queryForm.type != null">
|
||||
AND t_change_log.type = #{queryForm.type}
|
||||
</if>
|
||||
<!--关键字-->
|
||||
<if test="queryForm.keyword != null and queryForm.keyword != ''">
|
||||
AND ( INSTR(t_change_log.version,#{queryForm.keyword})
|
||||
OR INSTR(t_change_log.publish_author,#{queryForm.keyword})
|
||||
OR INSTR(t_change_log.content,#{queryForm.keyword})
|
||||
)
|
||||
</if>
|
||||
<!--发布日期-->
|
||||
<if test="queryForm.publicDateBegin != null">
|
||||
AND DATE_FORMAT(t_change_log.public_date, '%Y-%m-%d') >= #{queryForm.publicDateBegin}
|
||||
</if>
|
||||
<if test="queryForm.publicDateEnd != null">
|
||||
AND DATE_FORMAT(t_change_log.public_date, '%Y-%m-%d') <= #{queryForm.publicDateEnd}
|
||||
</if>
|
||||
<!--创建时间-->
|
||||
<if test="queryForm.createTime != null">
|
||||
AND DATE_FORMAT(t_change_log.create_time, '%Y-%m-%d') = #{queryForm.createTime}
|
||||
</if>
|
||||
<!--跳转链接-->
|
||||
<if test="queryForm.link != null">
|
||||
AND t_change_log.link = #{queryForm.link}
|
||||
</if>
|
||||
</where>
|
||||
order by t_change_log.version desc
|
||||
</select>
|
||||
|
||||
<select id="selectByVersion"
|
||||
resultType="net.lab1024.sa.common.module.support.changelog.domain.entity.ChangeLogEntity">
|
||||
select * from t_change_log where `version` = #{version}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.codegenerator.dao.CodeGeneratorDao">
|
||||
|
||||
<select id="countByTableName" resultType="Long">
|
||||
select count(*)
|
||||
from information_schema.tables
|
||||
where table_schema = (select database())
|
||||
and table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<select id="selectTableColumn"
|
||||
resultType="net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableColumnVO">
|
||||
select *
|
||||
from information_schema.columns
|
||||
where table_schema = (select database())
|
||||
and table_name = #{tableName}
|
||||
order by ordinal_position
|
||||
</select>
|
||||
|
||||
<select id="queryTableList"
|
||||
resultType="net.lab1024.sa.common.module.support.codegenerator.domain.vo.TableVO">
|
||||
select
|
||||
tables.table_name,
|
||||
tables.table_comment,
|
||||
tables.create_time,
|
||||
tables.update_time,
|
||||
t_code_generator_config.update_time configTime
|
||||
from information_schema.tables tables
|
||||
left join t_code_generator_config on tables.table_name = t_code_generator_config.table_name
|
||||
where tables.table_schema = (select database())
|
||||
<if test="queryForm.tableNameKeywords != null and queryForm.tableNameKeywords != ''">
|
||||
AND INSTR(tables.table_name,#{queryForm.tableNameKeywords})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.config.ConfigDao">
|
||||
<!-- 分页查询系统配置 -->
|
||||
<select id="queryByPage" resultType="net.lab1024.sa.common.module.support.config.domain.ConfigEntity">
|
||||
SELECT *
|
||||
FROM t_config
|
||||
<where>
|
||||
<if test="query.configKey != null and query.configKey != ''">
|
||||
AND INSTR(config_key,#{query.configKey})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据key查询获取数据 -->
|
||||
<select id="selectByKey" resultType="net.lab1024.sa.common.module.support.config.domain.ConfigEntity">
|
||||
SELECT *
|
||||
FROM t_config
|
||||
WHERE config_key = #{key}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.datatracer.dao.DataTracerDao">
|
||||
|
||||
<select id="selectRecord"
|
||||
resultType="net.lab1024.sa.common.module.support.datatracer.domain.vo.DataTracerVO">
|
||||
select *
|
||||
from t_data_tracer
|
||||
where data_type = #{dataType}
|
||||
and data_id = #{dataId}
|
||||
</select>
|
||||
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.datatracer.domain.vo.DataTracerVO">
|
||||
SELECT * FROM t_data_tracer
|
||||
<where>
|
||||
<if test="query.type != null">
|
||||
AND type = #{query.type}
|
||||
</if>
|
||||
<if test="query.dataId != null">
|
||||
AND data_id = #{query.dataId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords != ''">
|
||||
AND INSTR(content,#{query.keywords})
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
ORDER BY data_tracer_id DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.dict.dao.DictKeyDao">
|
||||
|
||||
<update id="updateDeletedFlagByIdList">
|
||||
update t_dict_key set deleted_flag = #{deletedFlag} where dict_key_id in
|
||||
<foreach collection="dictKeyIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.dict.domain.vo.DictKeyVO">
|
||||
SELECT * FROM t_dict_key
|
||||
<where>
|
||||
<if test="query.searchWord != null and query.searchWord !=''">
|
||||
AND (INSTR(key_code,#{query.searchWord}) or INSTR(key_name,#{query.searchWord}))
|
||||
</if>
|
||||
<if test="query.deletedFlag != null">
|
||||
AND deleted_flag = #{query.deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
ORDER BY dict_key_id DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByCode"
|
||||
resultType="net.lab1024.sa.common.module.support.dict.domain.entity.DictKeyEntity">
|
||||
select * from t_dict_key where key_code = #{keyCode} and deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
<select id="selectByDeletedFlag"
|
||||
resultType="net.lab1024.sa.common.module.support.dict.domain.entity.DictKeyEntity">
|
||||
select * from t_dict_key where deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.dict.dao.DictValueDao">
|
||||
|
||||
<update id="updateDeletedFlagByIdList">
|
||||
update t_dict_value set deleted_flag = #{deletedFlag} where dict_value_id in
|
||||
<foreach collection="dictValueIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.dict.domain.vo.DictValueVO">
|
||||
SELECT * FROM t_dict_value
|
||||
<where>
|
||||
<if test="query.dictKeyId != null">
|
||||
AND dict_key_id = #{query.dictKeyId}
|
||||
</if>
|
||||
<if test="query.searchWord != null and query.searchWord !=''">
|
||||
AND (INSTR(value_code,#{query.searchWord}) or INSTR(value_name,#{query.searchWord}))
|
||||
</if>
|
||||
<if test="query.deletedFlag != null">
|
||||
AND deleted_flag = #{query.deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
ORDER BY sort,dict_value_id DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByCode"
|
||||
resultType="net.lab1024.sa.common.module.support.dict.domain.entity.DictValueEntity">
|
||||
select * from t_dict_value where value_code = #{valueCode} and deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
<select id="selectByDeletedFlag"
|
||||
resultType="net.lab1024.sa.common.module.support.dict.domain.entity.DictValueEntity">
|
||||
select * from t_dict_value where deleted_flag = #{deletedFlag} order by sort;
|
||||
</select>
|
||||
<select id="selectByDeletedFlagAndKeyId"
|
||||
resultType="net.lab1024.sa.common.module.support.dict.domain.entity.DictValueEntity">
|
||||
select * from t_dict_value where dict_key_id = #{dictKeyId} and deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.feedback.dao.FeedbackDao">
|
||||
|
||||
<select id="queryPage" resultType="net.lab1024.sa.common.module.support.feedback.domain.FeedbackVO">
|
||||
select *
|
||||
from t_feedback
|
||||
<where>
|
||||
<if test="query.searchWord != null and query.searchWord != '' ">
|
||||
AND (
|
||||
INSTR(feedback_content,#{query.searchWord})
|
||||
OR INSTR(create_name,#{query.searchWord})
|
||||
)
|
||||
</if>
|
||||
<if test="query.startDate != null">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate != null">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{query.endDate}
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
order by create_time desc
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.file.dao.FileDao">
|
||||
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.common.module.support.file.domain.vo.FileVO">
|
||||
SELECT
|
||||
*
|
||||
FROM t_file
|
||||
<where>
|
||||
<!--文件夹类型-->
|
||||
<if test="queryForm.folderType != null">
|
||||
AND t_file.folder_type = #{queryForm.folderType}
|
||||
</if>
|
||||
<!--文件名词-->
|
||||
<if test="queryForm.fileName != null and queryForm.fileName != ''">
|
||||
AND INSTR(t_file.file_name,#{queryForm.fileName})
|
||||
</if>
|
||||
<!--文件Key-->
|
||||
<if test="queryForm.fileKey != null and queryForm.fileKey != ''">
|
||||
AND INSTR(t_file.file_key,#{queryForm.fileKey})
|
||||
</if>
|
||||
<!--文件类型-->
|
||||
<if test="queryForm.fileType != null">
|
||||
AND t_file.file_type = #{queryForm.fileType}
|
||||
</if>
|
||||
<!--创建人-->
|
||||
<if test="queryForm.creatorName != null and queryForm.creatorName != ''">
|
||||
AND INSTR(t_file.creator_name,#{queryForm.creatorName})
|
||||
</if>
|
||||
<!--创建时间-->
|
||||
<if test="queryForm.createTimeBegin != null">
|
||||
AND DATE_FORMAT(t_file.create_time, '%Y-%m-%d') >= #{queryForm.createTimeBegin}
|
||||
</if>
|
||||
<if test="queryForm.createTimeEnd != null">
|
||||
AND DATE_FORMAT(t_file.create_time, '%Y-%m-%d') <= #{queryForm.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
<if test="queryForm.sortItemList == null or queryForm.sortItemList.size == 0">
|
||||
ORDER BY t_file.create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getByFileKey" resultType="net.lab1024.sa.common.module.support.file.domain.vo.FileVO">
|
||||
SELECT * FROM t_file where file_key = #{fileKey}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.heartbeat.HeartBeatRecordDao">
|
||||
|
||||
|
||||
<update id="updateHeartBeatTimeById">
|
||||
update t_heart_beat_record
|
||||
set heart_beat_time = #{heartBeatTime}
|
||||
<where>
|
||||
heart_beat_record_id = #{id}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordEntity">
|
||||
select * from t_heart_beat_record where project_path = #{projectPath} and server_ip = #{serverIp} and process_no =#{processNo}
|
||||
</select>
|
||||
|
||||
<select id="pageQuery" resultType="net.lab1024.sa.common.module.support.heartbeat.domain.HeartBeatRecordVO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
t_heart_beat_record
|
||||
<where>
|
||||
<if test="query.startDate != null ">
|
||||
AND DATE_FORMAT(heart_beat_time, '%Y-%m-%d') >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate != null ">
|
||||
AND DATE_FORMAT(heart_beat_time, '%Y-%m-%d') <= #{query.endDate}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords != ''">
|
||||
AND (INSTR(project_path,#{query.keywords}) or INSTR(server_ip,#{query.keywords}) or INSTR(process_no,#{query.keywords}))
|
||||
</if>
|
||||
</where>
|
||||
order by heart_beat_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.helpdoc.dao.HelpDocDao">
|
||||
|
||||
|
||||
<!-- ================================== 帮助文档【主表 t_help_doc 】 ================================== -->
|
||||
<select id="queryAllHelpDocList" resultType="net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO">
|
||||
SELECT t_help_doc.*,
|
||||
t_help_doc_catalog.name as helpDocCatalogName
|
||||
FROM t_help_doc
|
||||
left join t_help_doc_catalog on t_help_doc_catalog.help_doc_catalog_id = t_help_doc.help_doc_catalog_id
|
||||
</select>
|
||||
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO">
|
||||
SELECT
|
||||
t_help_doc.* ,
|
||||
t_help_doc_catalog.name as helpDocCatalogName
|
||||
FROM t_help_doc
|
||||
left join t_help_doc_catalog on t_help_doc_catalog.help_doc_catalog_id = t_help_doc.help_doc_catalog_id
|
||||
<where>
|
||||
<if test="query.helpDocCatalogId != null">
|
||||
AND t_help_doc.help_doc_catalog_id = #{query.helpDocCatalogId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords !=''">
|
||||
AND ( INSTR(t_help_doc.title,#{query.keywords})
|
||||
OR INSTR(t_help_doc.author,#{query.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="query.createTimeBegin != null">
|
||||
AND DATE_FORMAT(t_help_doc.create_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.createTimeBegin},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.createTimeEnd != null">
|
||||
AND DATE_FORMAT(t_help_doc.create_time, '%Y-%m-%d') <= DATE_FORMAT(#{query.createTimeEnd},
|
||||
'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
<if test="query.sortItemList == null or query.sortItemList.size == 0">
|
||||
ORDER BY t_help_doc.sort ASC, t_help_doc.create_time DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="updateViewCount">
|
||||
update t_help_doc
|
||||
set page_view_count = page_view_count + #{pageViewCountIncrease},
|
||||
user_view_count = user_view_count + #{userViewCountIncrease}
|
||||
where help_doc_id = #{helpDocId}
|
||||
</update>
|
||||
|
||||
<select id="queryHelpDocByCatalogId"
|
||||
resultType="net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO">
|
||||
select *
|
||||
from t_help_doc
|
||||
where help_doc_catalog_id = #{helpDocCatalogId}
|
||||
</select>
|
||||
|
||||
<select id="queryHelpDocByRelationId"
|
||||
resultType="net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocVO">
|
||||
select t_help_doc.*
|
||||
from t_help_doc_relation
|
||||
left join t_help_doc on t_help_doc.help_doc_id = t_help_doc_relation.help_doc_id
|
||||
where t_help_doc_relation.relation_id = #{relationId}
|
||||
</select>
|
||||
|
||||
<!-- ================================== 关联项目 【子表 关联关系 t_help_doc_relation 】 ================================== -->
|
||||
|
||||
<insert id="insertRelation">
|
||||
insert into t_help_doc_relation
|
||||
(relation_id, relation_name, help_doc_id)
|
||||
values
|
||||
<foreach collection="relationList" separator="," item="item">
|
||||
( #{item.relationId} ,#{item.relationName}, #{helpDocId} )
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteRelation">
|
||||
delete
|
||||
from t_help_doc_relation
|
||||
where help_doc_id = #{helpDocId}
|
||||
</delete>
|
||||
|
||||
<select id="queryRelationByHelpDoc"
|
||||
resultType="net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocRelationVO">
|
||||
select *
|
||||
from t_help_doc_relation
|
||||
where help_doc_id = #{helpDocId}
|
||||
</select>
|
||||
|
||||
<!-- ================================== 查看记录【子表 查看记录 t_help_doc_view_record】 ================================== -->
|
||||
<select id="viewRecordCount" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from t_help_doc_view_record
|
||||
where help_doc_id = #{helpDocId}
|
||||
and user_id = #{userId}
|
||||
</select>
|
||||
<insert id="insertViewRecord">
|
||||
insert into t_help_doc_view_record (help_doc_id, user_id,user_name, first_ip, first_user_agent, page_view_count)
|
||||
values (#{helpDocId}, #{userId},#{userName}, #{ip}, #{userAgent}, #{pageViewCount})
|
||||
</insert>
|
||||
<update id="updateViewRecord">
|
||||
update t_help_doc_view_record
|
||||
set page_view_count = page_view_count + 1,
|
||||
last_ip = #{ip},
|
||||
last_user_agent = #{userAgent}
|
||||
where help_doc_id = #{helpDocId}
|
||||
and user_id = #{userId}
|
||||
</update>
|
||||
<select id="queryViewRecordList"
|
||||
resultType="net.lab1024.sa.common.module.support.helpdoc.domain.vo.HelpDocViewRecordVO">
|
||||
select *
|
||||
from t_help_doc_view_record
|
||||
where
|
||||
help_doc_id = #{queryForm.helpDocId}
|
||||
<if test="queryForm.keywords != null and queryForm.keywords !=''">
|
||||
AND (
|
||||
INSTR(user_name,#{queryForm.keywords})
|
||||
OR INSTR(first_ip,#{queryForm.keywords})
|
||||
OR INSTR(first_user_agent,#{queryForm.keywords})
|
||||
OR INSTR(last_ip,#{queryForm.keywords})
|
||||
OR INSTR(last_user_agent,#{queryForm.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="queryForm.userId != null ">
|
||||
and user_id = #{queryForm.userId}
|
||||
</if>
|
||||
order by update_time desc,create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.loginlog.LoginLogDao">
|
||||
|
||||
<select id="queryByPage" resultType="net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO">
|
||||
select
|
||||
*
|
||||
from t_login_log
|
||||
<where>
|
||||
<if test="query.startDate != null and query.startDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate != null and query.endDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{query.endDate}
|
||||
</if>
|
||||
<if test="query.userName != null and query.userName != ''">
|
||||
AND INSTR(user_name,#{query.userName})
|
||||
</if>
|
||||
<if test="query.ip != null">
|
||||
AND INSTR(login_ip,#{query.ip})
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryLastByUserId" resultType="net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO">
|
||||
select
|
||||
*
|
||||
from t_login_log
|
||||
where
|
||||
user_id = #{userId}
|
||||
and user_type = #{userType}
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.operatelog.OperateLogDao">
|
||||
|
||||
<select id="queryByPage" resultType="net.lab1024.sa.common.module.support.operatelog.domain.OperateLogEntity">
|
||||
select
|
||||
*
|
||||
from t_operate_log
|
||||
<where>
|
||||
<if test="query.startDate != null and query.startDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate != null and query.endDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{query.endDate}
|
||||
</if>
|
||||
<if test="query.userName != null and query.userName != ''">
|
||||
AND INSTR(operate_user_name,#{query.userName})
|
||||
</if>
|
||||
<if test="query.successFlag != null">
|
||||
AND success_flag = #{query.successFlag}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from t_operate_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from t_operate_log where id in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.reload.dao.ReloadItemDao">
|
||||
|
||||
<!-- 查询reload列表 -->
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.reload.domain.ReloadItemVO">
|
||||
SELECT tag,args,identification,update_time,create_time FROM t_reload_item
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.reload.dao.ReloadResultDao">
|
||||
|
||||
<!-- 查询reload列表 -->
|
||||
<select id="query" resultType="net.lab1024.sa.common.module.support.reload.domain.ReloadResultVO">
|
||||
SELECT tag, identification, args, result, exception, create_time FROM t_reload_result where tag = #{tag} order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberDao">
|
||||
|
||||
<update id="updateLastNumberAndTime">
|
||||
update t_serial_number
|
||||
set
|
||||
last_number = #{lastNumber},
|
||||
last_time = #{lastTime}
|
||||
where
|
||||
serial_number_id = #{serialNumberId}
|
||||
|
||||
</update>
|
||||
|
||||
<!-- 查询最后生成记录 -->
|
||||
<select id="selectForUpdate" resultType="net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberEntity">
|
||||
select * from t_serial_number where serial_number_id = #{serialNumberId} for update
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.serialnumber.dao.SerialNumberRecordDao">
|
||||
|
||||
<update id="updateRecord">
|
||||
update t_serial_number_record
|
||||
set last_number = #{lastNumber},
|
||||
count = count + #{count}
|
||||
where
|
||||
serial_number_id = #{serialNumberId}
|
||||
and
|
||||
record_date = #{recordDate}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectRecordIdBySerialNumberIdAndDate" resultType="java.lang.Long">
|
||||
select serial_number_record_id
|
||||
from t_serial_number_record
|
||||
where
|
||||
serial_number_id = #{serialNumberId}
|
||||
and
|
||||
record_date = #{recordDate}
|
||||
</select>
|
||||
|
||||
<select id="query"
|
||||
resultType="net.lab1024.sa.common.module.support.serialnumber.domain.SerialNumberRecordEntity">
|
||||
select * from t_serial_number_record
|
||||
where serial_number_id = #{queryForm.serialNumberId}
|
||||
order by last_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.common.module.support.table.TableColumnDao">
|
||||
<delete id="delete">
|
||||
delete
|
||||
from t_table_column
|
||||
where user_id = #{userId}
|
||||
and table_id = #{tableId}
|
||||
</delete>
|
||||
<select id="selectByUserIdAndTableId"
|
||||
resultType="net.lab1024.sa.common.module.support.table.domain.TableColumnEntity">
|
||||
select *
|
||||
from t_table_column
|
||||
where user_id = #{userId}
|
||||
and table_id = #{tableId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
129
smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml
Normal file
129
smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml
Normal file
@@ -0,0 +1,129 @@
|
||||
spring:
|
||||
# 数据库连接信息
|
||||
datasource:
|
||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2_pre?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: Lab1024
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
max-active: 50
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
filters: stat
|
||||
druid:
|
||||
username: druid
|
||||
password: 1024
|
||||
login:
|
||||
enabled: true
|
||||
method:
|
||||
pointcut: net.lab1024.sa..*Service.*
|
||||
|
||||
# redis 连接池配置信息
|
||||
redis:
|
||||
database: 1
|
||||
host: 127.0.0.1
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 50
|
||||
min-idle: 5
|
||||
max-idle: 5
|
||||
max-wait: 30000ms
|
||||
port: 6379
|
||||
timeout: 10000ms
|
||||
password:
|
||||
|
||||
# 上传文件大小配置
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
max-request-size: 30MB
|
||||
|
||||
# json序列化相关配置
|
||||
jackson:
|
||||
serialization:
|
||||
write-enums-using-to-string: true
|
||||
write-dates-as-timestamps: false
|
||||
deserialization:
|
||||
read-enums-using-to-string: true
|
||||
fail-on-unknown-properties: false
|
||||
default-property-inclusion: always
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
tomcat:
|
||||
basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)'
|
||||
|
||||
#swagger: 提高swagger 方法名称有重复的日志提示
|
||||
logging:
|
||||
level:
|
||||
springfox:
|
||||
documentation:
|
||||
spring:
|
||||
web:
|
||||
readers:
|
||||
operation:
|
||||
CachingOperationNameGenerator: warn
|
||||
scanners:
|
||||
ApiListingReferenceScanner: warn
|
||||
|
||||
# 文件上传 配置
|
||||
file:
|
||||
storage:
|
||||
mode: cloud
|
||||
local:
|
||||
path: ${localPath:/home}/smart_admin_v2/upload/
|
||||
cloud:
|
||||
region: oss-cn-qingdao
|
||||
endpoint: oss-cn-qingdao.aliyuncs.com
|
||||
bucket-name: common-sit
|
||||
access-key:
|
||||
secret-key:
|
||||
url:
|
||||
expire: 7200000
|
||||
public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
|
||||
# swagger 配置
|
||||
swagger:
|
||||
title: SmartAdmin
|
||||
description: SmartAdmin 2.0
|
||||
version: 2.0
|
||||
host: localhost:${server.port}
|
||||
package: net.lab1024.sa
|
||||
tag-class: net.lab1024.sa.common.constant.SwaggerTagConst
|
||||
team-url: https://www.1024lab.net/
|
||||
|
||||
# RestTemplate 请求配置
|
||||
http:
|
||||
pool:
|
||||
max-total: 20
|
||||
connect-timeout: 50000
|
||||
read-timeout: 50000
|
||||
write-timeout: 50000
|
||||
keep-alive: 300000
|
||||
|
||||
# token相关配置
|
||||
token:
|
||||
key: sa-jwt-key
|
||||
expire-day: 7
|
||||
|
||||
# 跨域配置
|
||||
access-control-allow-origin: '*'
|
||||
|
||||
# 心跳配置
|
||||
heart-beat:
|
||||
interval-seconds: 60
|
||||
|
||||
# 热加载配置
|
||||
reload:
|
||||
interval-seconds: 60
|
||||
129
smart-admin-api/sa-common/src/main/resources/prod/sa-common.yaml
Normal file
129
smart-admin-api/sa-common/src/main/resources/prod/sa-common.yaml
Normal file
@@ -0,0 +1,129 @@
|
||||
spring:
|
||||
# 数据库连接信息
|
||||
datasource:
|
||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2_prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: Lab1024
|
||||
initial-size: 10
|
||||
min-idle: 10
|
||||
max-active: 100
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
filters: stat
|
||||
druid:
|
||||
username: druid
|
||||
password: 1024
|
||||
login:
|
||||
enabled: true
|
||||
method:
|
||||
pointcut: net.lab1024.sa..*Service.*
|
||||
|
||||
# redis 连接池配置信息
|
||||
redis:
|
||||
database: 1
|
||||
host: 127.0.0.1
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 100
|
||||
min-idle: 10
|
||||
max-idle: 10
|
||||
max-wait: 30000ms
|
||||
port: 6379
|
||||
timeout: 10000ms
|
||||
password:
|
||||
|
||||
# 上传文件大小配置
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
max-request-size: 30MB
|
||||
|
||||
# json序列化相关配置
|
||||
jackson:
|
||||
serialization:
|
||||
write-enums-using-to-string: true
|
||||
write-dates-as-timestamps: false
|
||||
deserialization:
|
||||
read-enums-using-to-string: true
|
||||
fail-on-unknown-properties: false
|
||||
default-property-inclusion: always
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
tomcat:
|
||||
basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)'
|
||||
|
||||
#swagger: 提高swagger 方法名称有重复的日志提示
|
||||
logging:
|
||||
level:
|
||||
springfox:
|
||||
documentation:
|
||||
spring:
|
||||
web:
|
||||
readers:
|
||||
operation:
|
||||
CachingOperationNameGenerator: warn
|
||||
scanners:
|
||||
ApiListingReferenceScanner: warn
|
||||
|
||||
# 文件上传 配置
|
||||
file:
|
||||
storage:
|
||||
mode: cloud
|
||||
local:
|
||||
path: ${localPath:/home}/smart_admin_v2/upload/
|
||||
cloud:
|
||||
region: oss-cn-qingdao
|
||||
endpoint: oss-cn-qingdao.aliyuncs.com
|
||||
bucket-name: common-sit
|
||||
access-key:
|
||||
secret-key:
|
||||
url:
|
||||
expire: 7200000
|
||||
public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
|
||||
# swagger 配置
|
||||
swagger:
|
||||
title: SmartAdmin
|
||||
description: SmartAdmin 2.0
|
||||
version: 2.0
|
||||
host: localhost:${server.port}
|
||||
package: net.lab1024.sa
|
||||
tag-class: net.lab1024.sa.common.constant.SwaggerTagConst
|
||||
team-url: https://www.1024lab.net/
|
||||
|
||||
# RestTemplate 请求配置
|
||||
http:
|
||||
pool:
|
||||
max-total: 20
|
||||
connect-timeout: 50000
|
||||
read-timeout: 50000
|
||||
write-timeout: 50000
|
||||
keep-alive: 300000
|
||||
|
||||
# token相关配置
|
||||
token:
|
||||
key: sa-jwt-key
|
||||
expire-day: 7
|
||||
|
||||
# 跨域配置
|
||||
access-control-allow-origin: '*'
|
||||
|
||||
# 心跳配置
|
||||
heart-beat:
|
||||
interval-seconds: 60
|
||||
|
||||
# 热加载配置
|
||||
reload:
|
||||
interval-seconds: 60
|
||||
129
smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml
Normal file
129
smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml
Normal file
@@ -0,0 +1,129 @@
|
||||
spring:
|
||||
# 数据库连接信息
|
||||
datasource:
|
||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/smart_admin_v2_test?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: Lab1024
|
||||
initial-size: 2
|
||||
min-idle: 5
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 300000
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
filters: stat
|
||||
druid:
|
||||
username: druid
|
||||
password: 1024
|
||||
login:
|
||||
enabled: true
|
||||
method:
|
||||
pointcut: net.lab1024.sa..*Service.*
|
||||
|
||||
# redis 连接池配置信息
|
||||
redis:
|
||||
database: 1
|
||||
host: 127.0.0.1
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 10
|
||||
min-idle: 1
|
||||
max-idle: 3
|
||||
max-wait: 30000ms
|
||||
port: 6379
|
||||
timeout: 10000ms
|
||||
password:
|
||||
|
||||
# 上传文件大小配置
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
max-request-size: 30MB
|
||||
|
||||
# json序列化相关配置
|
||||
jackson:
|
||||
serialization:
|
||||
write-enums-using-to-string: true
|
||||
write-dates-as-timestamps: false
|
||||
deserialization:
|
||||
read-enums-using-to-string: true
|
||||
fail-on-unknown-properties: false
|
||||
default-property-inclusion: always
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
tomcat:
|
||||
basedir: ${localPath:/home}/logs/smart_admin_v2/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
pattern: '%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)'
|
||||
|
||||
#swagger: 提高swagger 方法名称有重复的日志提示
|
||||
logging:
|
||||
level:
|
||||
springfox:
|
||||
documentation:
|
||||
spring:
|
||||
web:
|
||||
readers:
|
||||
operation:
|
||||
CachingOperationNameGenerator: warn
|
||||
scanners:
|
||||
ApiListingReferenceScanner: warn
|
||||
|
||||
# 文件上传 配置
|
||||
file:
|
||||
storage:
|
||||
mode: cloud
|
||||
local:
|
||||
path: ${localPath:/home}/smart_admin_v2/upload/
|
||||
cloud:
|
||||
region: oss-cn-qingdao
|
||||
endpoint: oss-cn-qingdao.aliyuncs.com
|
||||
bucket-name: common-sit
|
||||
access-key:
|
||||
secret-key:
|
||||
url:
|
||||
expire: 7200000
|
||||
public: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
|
||||
# swagger 配置
|
||||
swagger:
|
||||
title: SmartAdmin
|
||||
description: SmartAdmin 2.0
|
||||
version: 2.0
|
||||
host: localhost:${server.port}
|
||||
package: net.lab1024.sa
|
||||
tag-class: net.lab1024.sa.common.constant.SwaggerTagConst
|
||||
team-url: https://www.1024lab.net/
|
||||
|
||||
# RestTemplate 请求配置
|
||||
http:
|
||||
pool:
|
||||
max-total: 20
|
||||
connect-timeout: 50000
|
||||
read-timeout: 50000
|
||||
write-timeout: 50000
|
||||
keep-alive: 300000
|
||||
|
||||
# token相关配置
|
||||
token:
|
||||
key: sa-jwt-key
|
||||
expire-day: 7
|
||||
|
||||
# 跨域配置
|
||||
access-control-allow-origin: '*'
|
||||
|
||||
# 心跳配置
|
||||
heart-beat:
|
||||
interval-seconds: 60
|
||||
|
||||
# 热加载配置
|
||||
reload:
|
||||
interval-seconds: 60
|
||||
Reference in New Issue
Block a user