mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-05 10:13:51 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64ebe2bfdb | ||
|
|
69ea81b020 | ||
|
|
cb39dedfd5 | ||
|
|
b27b004edc | ||
|
|
b3b20bc029 | ||
|
|
b350918501 | ||
|
|
69fa9088f5 | ||
|
|
dab0afdb59 | ||
|
|
17a3e1fd86 | ||
|
|
053d562157 |
@@ -1,9 +1,11 @@
|
||||
package net.lab1024.sa.admin.module.business.goods.domain.form;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum;
|
||||
import net.lab1024.sa.base.common.domain.PageParam;
|
||||
import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;
|
||||
import net.lab1024.sa.base.common.swagger.SchemaEnum;
|
||||
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
@@ -32,6 +34,7 @@ public class GoodsQueryForm extends PageParam {
|
||||
private Integer goodsStatus;
|
||||
|
||||
@Schema(description = "产地")
|
||||
@JsonDeserialize(using = DictValueVoDeserializer.class)
|
||||
private String place;
|
||||
|
||||
@Schema(description = "上架状态")
|
||||
|
||||
@@ -52,7 +52,6 @@ public class NoticeEmployeeService {
|
||||
public ResponseDTO<PageResult<NoticeEmployeeVO>> queryList(Long requestEmployeeId, NoticeEmployeeQueryForm noticeEmployeeQueryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(noticeEmployeeQueryForm);
|
||||
|
||||
//获取请求人的 部门及其子部门
|
||||
List<Long> employeeDepartmentIdList = Lists.newArrayList();
|
||||
EmployeeEntity employeeEntity = employeeService.getById(requestEmployeeId);
|
||||
// 如果不是管理员 则获取请求人的 部门及其子部门
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
* @Date 2021-12-09 22:57:49
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@RestController
|
||||
@Tag(name = AdminSwaggerTagConst.System.SYSTEM_EMPLOYEE)
|
||||
@@ -110,7 +110,7 @@ public class EmployeeController {
|
||||
@Operation(summary = "重置员工密码 @author 卓大")
|
||||
@GetMapping("/employee/update/password/reset/{employeeId}")
|
||||
@SaCheckPermission("system:employee:password:reset")
|
||||
public ResponseDTO<String> resetPassword(@PathVariable Integer employeeId) {
|
||||
public ResponseDTO<String> resetPassword(@PathVariable Long employeeId) {
|
||||
return employeeService.resetPassword(employeeId);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
/**
|
||||
* 员工重置密码
|
||||
*/
|
||||
Integer updatePassword(@Param("employeeId") Integer employeeId, @Param("password") String password);
|
||||
Integer updatePassword(@Param("employeeId") Long employeeId, @Param("password") String password);
|
||||
|
||||
}
|
||||
@@ -47,8 +47,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class EmployeeService {
|
||||
|
||||
private static final String PASSWORD_SALT_FORMAT = "smart_%s_admin_$^&*";
|
||||
|
||||
@Resource
|
||||
private EmployeeDao employeeDao;
|
||||
|
||||
@@ -364,7 +362,7 @@ public class EmployeeService {
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
public ResponseDTO<String> resetPassword(Integer employeeId) {
|
||||
public ResponseDTO<String> resetPassword(Long employeeId) {
|
||||
String password = securityPasswordService.randomPassword();
|
||||
employeeDao.updatePassword(employeeId, SecurityPasswordService.getEncryptPwd(password));
|
||||
return ResponseDTO.ok(password);
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
* @Date 2022-04-08 21:53:04
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Service
|
||||
public class RoleEmployeeManager extends ServiceImpl<RoleEmployeeDao, RoleEmployeeEntity> {
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @Date 2023/10/17 19:07:27
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>,Since 2012
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>,Since 2012
|
||||
*/
|
||||
|
||||
@RestController
|
||||
|
||||
@@ -95,25 +95,25 @@
|
||||
left join t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
|
||||
<where>
|
||||
<if test="!administratorFlag">
|
||||
(
|
||||
(
|
||||
t_notice.notice_id in
|
||||
(select t_notice_visible_range.notice_id
|
||||
from t_notice_visible_range
|
||||
where
|
||||
( t_notice_visible_range.data_type = #{departmentDataType}
|
||||
<if test="requestEmployeeDepartmentIdList != null and requestEmployeeDepartmentIdList.size > 0">
|
||||
and
|
||||
t_notice_visible_range.data_id
|
||||
in
|
||||
<foreach collection="requestEmployeeDepartmentIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id = #{requestEmployeeId} )
|
||||
<if test="requestEmployeeDepartmentIdList != null and requestEmployeeDepartmentIdList.size > 0">
|
||||
and
|
||||
t_notice_visible_range.data_id
|
||||
in
|
||||
<foreach collection="requestEmployeeDepartmentIdList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id = #{requestEmployeeId} )
|
||||
)
|
||||
or t_notice.all_visible_flag = true
|
||||
)
|
||||
)
|
||||
</if>
|
||||
|
||||
and t_notice.deleted_flag = #{deletedFlag}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# 项目配置: 名称、日志目录
|
||||
project:
|
||||
name: sa-admin
|
||||
log-directory: /home/project/smartadmin/sit/log
|
||||
log-directory: /home/project/smartadmin/test/log
|
||||
|
||||
# 项目端口和url根路径
|
||||
server:
|
||||
|
||||
@@ -14,15 +14,24 @@ import java.io.IOException;
|
||||
* @Date 2020-06-02 22:55:07
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
public class LongJsonSerializer extends JsonSerializer<Long> {
|
||||
|
||||
public static final LongJsonSerializer INSTANCE = new LongJsonSerializer();
|
||||
|
||||
@Override
|
||||
public void serialize(Long value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
||||
String text = (value == null ? null : String.valueOf(value));
|
||||
if (text != null) {
|
||||
jsonGenerator.writeString(text);
|
||||
public void serialize(Long value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
||||
if (null == value) {
|
||||
gen.writeNull();
|
||||
return;
|
||||
}
|
||||
// js中最大安全整数16位 Number.MAX_SAFE_INTEGER
|
||||
String longStr = String.valueOf(value);
|
||||
if (longStr.length() > 16) {
|
||||
gen.writeString(longStr);
|
||||
} else {
|
||||
gen.writeNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
@@ -17,6 +18,7 @@ import org.springframework.web.filter.CorsFilter;
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Configuration
|
||||
@Conditional(SystemEnvironmentConfig.class)
|
||||
public class CorsFilterConfig {
|
||||
|
||||
@Value("${access-control-allow-origin}")
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import net.lab1024.sa.base.common.json.serializer.LongJsonSerializer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -17,16 +18,16 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeParseException;
|
||||
|
||||
/**
|
||||
* java8 localDate 时间类格式化配置
|
||||
* Json 序列化配置
|
||||
*
|
||||
* @Author 1024创新实验室-主任: 卓大
|
||||
* @Date 2017-11-28 15:21:10
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Configuration
|
||||
public class DateConfig {
|
||||
public class JsonConfig {
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer customizer() {
|
||||
@@ -35,6 +36,7 @@ public class DateConfig {
|
||||
builder.deserializers(new LocalDateTimeDeserializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()));
|
||||
builder.serializers(new LocalDateSerializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter()));
|
||||
builder.serializers(new LocalDateTimeSerializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()));
|
||||
builder.serializerByType(Long.class, LongJsonSerializer.INSTANCE);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,10 +31,9 @@ import java.util.Optional;
|
||||
/**
|
||||
* springdoc-openapi 配置
|
||||
* nginx配置前缀时如果需要访问【/swagger-ui/index.html】需添加额外nginx配置
|
||||
* location /v3/api-docs/ {
|
||||
* proxy_pass http://127.0.0.1:11024/v3/api-docs/;
|
||||
* location /v3/api-docs/ {
|
||||
* proxy_pass http://127.0.0.1:1024/v3/api-docs/;
|
||||
* }
|
||||
*
|
||||
* @Author 1024创新实验室-主任: 卓大
|
||||
* @Date 2020-03-25 22:54:46
|
||||
* @Wechat zhuoda1024
|
||||
@@ -48,7 +47,7 @@ public class SwaggerConfig {
|
||||
/**
|
||||
* 用于解决/swagger-ui/index.html页面ServersUrl 测试环境部署错误问题
|
||||
*/
|
||||
@Value("${springdoc.swagger-ui.server-base-url:''}")
|
||||
@Value("${springdoc.swagger-ui.server-base-url}")
|
||||
private String serverBaseUrl;
|
||||
|
||||
public static final String[] SWAGGER_WHITELIST = {
|
||||
@@ -59,20 +58,20 @@ public class SwaggerConfig {
|
||||
"/v3/api-docs",
|
||||
"/v3/api-docs/**",
|
||||
"/doc.html",
|
||||
};
|
||||
};
|
||||
|
||||
@Bean
|
||||
public OpenAPI api() {
|
||||
return new OpenAPI()
|
||||
.components(components())
|
||||
.info(new Info()
|
||||
.title("SmartAdmin 3.X 接口文档")
|
||||
.contact(new Contact().name("1024创新实验室").email("lab1024@163.com").url("https://1024lab.net"))
|
||||
.version("v3.X")
|
||||
.description("<font color=\"#DC143C\">**以「高质量代码」为核心,「简洁、高效、安全」**</font>基于 SpringBoot + Sa-Token + Mybatis-Plus 和 Vue3 + Vite5 + Ant Design (同时支持JavaScript和TypeScript双版本) 的快速开发平台。" +
|
||||
"<br/><font color=\"#DC143C\">**国内首个满足《网络安全》、《数据安全》、三级等保**</font>, 支持登录限制、支持国产接口加解密等安全、支持数据加解密等一系列安全体系的开源项目。" +
|
||||
"<br/><font color=\"#DC143C\">**我们开源一套漂亮的代码和一套整洁的代码规范**</font>,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,保持谦逊,保持学习,热爱代码,更热爱生活!")
|
||||
)
|
||||
.title("SmartAdmin 3.X 接口文档")
|
||||
.contact(new Contact().name("1024创新实验室").email("lab1024@163.com").url("https://1024lab.net"))
|
||||
.version("v3.X")
|
||||
.description("<font color=\"#DC143C\">**以「高质量代码」为核心,「简洁、高效、安全」**</font>基于 SpringBoot + Sa-Token + Mybatis-Plus 和 Vue3 + Vite5 + Ant Design (同时支持JavaScript和TypeScript双版本) 的快速开发平台。" +
|
||||
"<br/><font color=\"#DC143C\">**国内首个满足《网络安全》、《数据安全》、三级等保**</font>, 支持登录限制、支持国产接口加解密等安全、支持数据加解密等一系列安全体系的开源项目。" +
|
||||
"<br/><font color=\"#DC143C\">**我们开源一套漂亮的代码和一套整洁的代码规范**</font>,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,保持谦逊,保持学习,热爱代码,更热爱生活!")
|
||||
)
|
||||
.addSecurityItem(new SecurityRequirement().addList(RequestHeaderConst.TOKEN));
|
||||
}
|
||||
|
||||
@@ -84,27 +83,26 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi businessApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("业务接口")
|
||||
.pathsToMatch("/**")
|
||||
.pathsToExclude(SwaggerTagConst.Support.URL_PREFIX + "/**")
|
||||
.addOperationCustomizer(new SmartOperationCustomizer())
|
||||
.build();
|
||||
.group("业务接口")
|
||||
.pathsToMatch("/**")
|
||||
.pathsToExclude(SwaggerTagConst.Support.URL_PREFIX + "/**")
|
||||
.addOperationCustomizer(new SmartOperationCustomizer())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi supportApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("支撑接口(Support)")
|
||||
.pathsToMatch(SwaggerTagConst.Support.URL_PREFIX + "/**")
|
||||
.addOperationCustomizer(new SmartOperationCustomizer())
|
||||
.build();
|
||||
.group("支撑接口(Support)")
|
||||
.pathsToMatch(SwaggerTagConst.Support.URL_PREFIX + "/**")
|
||||
.addOperationCustomizer(new SmartOperationCustomizer())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 以下代码可以用于设置 /swagger-ui/index.html 的serverBaseUrl
|
||||
* 如果使用knife4j则不需要
|
||||
*
|
||||
* @param openAPI
|
||||
* @param securityParser
|
||||
* @param springDocConfigProperties
|
||||
@@ -132,6 +130,6 @@ public class SwaggerConfig {
|
||||
}
|
||||
});
|
||||
return new OpenAPIService(openAPI, securityParser, springDocConfigProperties,
|
||||
propertyResolverUtils, openApiBuilderCustomizers, Optional.of(list), javadocProvider);
|
||||
propertyResolverUtils, openApiBuilderCustomizers, Optional.of(list), javadocProvider);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.lab1024.sa.base.config;
|
||||
|
||||
import cn.dev33.satoken.config.SaTokenConfig;
|
||||
import net.lab1024.sa.base.module.support.securityprotect.service.Level3ProtectConfigService;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
*
|
||||
* 三级等保配置初始化后最低活跃频率全局配置
|
||||
*
|
||||
* @Author 1024创新实验室-创始人兼主任:卓大
|
||||
* @Date 2024/11/24
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a> ,Since 2012
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
public class TokenConfig {
|
||||
|
||||
@Resource
|
||||
private Level3ProtectConfigService level3ProtectConfigService;
|
||||
|
||||
// 此配置会覆盖 sa-base.yaml 中的配置
|
||||
@Resource
|
||||
public void configSaToken(SaTokenConfig config) {
|
||||
|
||||
config.setActiveTimeout(level3ProtectConfigService.getLoginActiveTimeoutSeconds());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import java.util.Set;
|
||||
* @Date 2022-05-30 21:22:12
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Configuration
|
||||
@Slf4j
|
||||
|
||||
@@ -67,14 +67,14 @@ public class WebServerListener implements ApplicationListener<WebServerInitializ
|
||||
String swaggerUrl = URLUtil.normalize(String.format("http://localhost:%d%s/swagger-ui/index.html", port, contextPath), false, true);
|
||||
String knife4jUrl = URLUtil.normalize(String.format("http://localhost:%d%s/doc.html", port, contextPath), false, true);
|
||||
log.warn("\n{}\n" +
|
||||
"\t当前启动环境:\t{} , {}" +
|
||||
"\n\t返回码初始化:\t完成{}个返回码初始化" +
|
||||
"\n\t服务本机地址:\t{}" +
|
||||
"\n\t服务外网地址:\t{}" +
|
||||
"\n\tSwagger地址:\t{}" +
|
||||
"\n\tknife4j地址:\t{}" +
|
||||
"\n-------------------------------------------------------------------------------------\n",
|
||||
title, profile, environmentEnum.getDesc(), codeCount, localhostUrl, externalUrl, swaggerUrl, knife4jUrl);
|
||||
"\t当前启动环境:\t{} , {}" +
|
||||
"\n\t返回码初始化:\t完成{}个返回码初始化" +
|
||||
"\n\t服务本机地址:\t{}" +
|
||||
"\n\t服务外网地址:\t{}" +
|
||||
"\n\tSwagger地址:\t{}" +
|
||||
"\n\tknife4j地址:\t{}" +
|
||||
"\n-------------------------------------------------------------------------------------\n",
|
||||
title, profile, environmentEnum.getDesc(), codeCount, localhostUrl, externalUrl, swaggerUrl, knife4jUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.lab1024.sa.base.module.support.apiencrypt.advice;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
@@ -33,6 +35,9 @@ public class EncryptResponseAdvice implements ResponseBodyAdvice<ResponseDTO> {
|
||||
@Resource
|
||||
private ApiEncryptService apiEncryptService;
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Override
|
||||
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
|
||||
return returnType.hasMethodAnnotation(ApiEncrypt.class) || returnType.getContainingClass().isAnnotationPresent(ApiEncrypt.class);
|
||||
@@ -44,7 +49,12 @@ public class EncryptResponseAdvice implements ResponseBodyAdvice<ResponseDTO> {
|
||||
return body;
|
||||
}
|
||||
|
||||
String encrypt = apiEncryptService.encrypt(JSON.toJSONString(body.getData()));
|
||||
String encrypt = null;
|
||||
try {
|
||||
encrypt = apiEncryptService.encrypt(objectMapper.writeValueAsString(body.getData()));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
body.setData(encrypt);
|
||||
body.setDataType(DataTypeEnum.ENCRYPT.getValue());
|
||||
return body;
|
||||
|
||||
@@ -52,14 +52,6 @@ public class ApiEncryptServiceSmImpl implements ApiEncryptService {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String content = "zkm1024";
|
||||
String en = new ApiEncryptServiceSmImpl().encrypt(content);
|
||||
System.out.println(en);
|
||||
String ori = new ApiEncryptServiceSmImpl().decrypt(en);
|
||||
System.out.println(ori);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String decrypt(String data) {
|
||||
|
||||
@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2022-06-30 22:15:38
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
|
||||
@Service
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2022/9/29 17:20:41
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
public abstract class CodeGenerateBaseVariableService {
|
||||
|
||||
|
||||
@@ -96,12 +96,11 @@ public class AddFormVariableService extends CodeGenerateBaseVariableService {
|
||||
if (Boolean.TRUE.equals(field.getRequiredFlag())) {
|
||||
String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull";
|
||||
finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")");
|
||||
packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;"
|
||||
: "import javax.validation.constraints.NotNull;");
|
||||
packageList.add("String".equals(codeField.getJavaType()) ? "import jakarta.validation.constraints.NotBlank;"
|
||||
: "import jakarta.validation.constraints.NotNull;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//字典
|
||||
if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)");
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.*;
|
||||
* @Date 2022/9/29 17:20:41
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
|
||||
public class MapperVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2022/9/29 17:20:41
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
|
||||
public class QueryFormVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
@@ -111,7 +111,7 @@ public class UpdateFormVariableService extends CodeGenerateBaseVariableService {
|
||||
if (Boolean.TRUE.equals(field.getRequiredFlag())) {
|
||||
String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull";
|
||||
finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")");
|
||||
packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;" : "import javax.validation.constraints.NotNull;");
|
||||
packageList.add("String".equals(codeField.getJavaType()) ? "import jakarta.validation.constraints.NotBlank;" : "import jakarta.validation.constraints.NotNull;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2022/9/29 17:20:41
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
|
||||
public class VOVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
@@ -172,7 +172,7 @@ public class DictService {
|
||||
* @return
|
||||
*/
|
||||
public List<DictKeyVO> queryAllKey() {
|
||||
return SmartBeanUtil.copyList(dictKeyDao.selectList(null), DictKeyVO.class);
|
||||
return SmartBeanUtil.copyList(dictKeyDao.selectByDeletedFlag(false), DictKeyVO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2019年10月11日 15:34:47
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Service
|
||||
public class FileService {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Level3ProtectConfigService {
|
||||
/**
|
||||
* 最低活跃时间(单位:秒),超过此时间没有操作系统就会被冻结,默认-1 代表不限制,永不冻结; 默认 30分钟
|
||||
*/
|
||||
private int loginActiveTimeoutSeconds = 1800;
|
||||
private int loginActiveTimeoutSeconds = -1;
|
||||
|
||||
/**
|
||||
* 密码复杂度 是否开启,默认:开启
|
||||
|
||||
@@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
|
||||
/**
|
||||
* 更新删除状态
|
||||
*/
|
||||
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag);
|
||||
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);
|
||||
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("deletedFlag")boolean deletedFlag);
|
||||
|
||||
#end
|
||||
#end
|
||||
|
||||
@@ -40,7 +40,7 @@ spring:
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
username: lab1024@163.com
|
||||
password: 1
|
||||
password: LAB1024LAB
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
|
||||
@@ -40,7 +40,7 @@ spring:
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
username: lab1024@163.com
|
||||
password: 1
|
||||
password: LAB1024LAB
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
|
||||
@@ -118,9 +118,6 @@ http:
|
||||
write-timeout: 50000
|
||||
keep-alive: 300000
|
||||
|
||||
# 跨域配置
|
||||
access-control-allow-origin: 'https://preview.smartadmin.vip'
|
||||
|
||||
# 心跳配置
|
||||
heart-beat:
|
||||
interval-seconds: 60
|
||||
|
||||
@@ -40,7 +40,7 @@ spring:
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
username: lab1024@163.com
|
||||
password: 1
|
||||
password: LAB1024LAB
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
|
||||
1
smart-admin-api-java8-springboot2/README.md
Normal file
1
smart-admin-api-java8-springboot2/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# Smart Admin API
|
||||
@@ -86,7 +86,7 @@ public class AdminInterceptor implements HandlerInterceptor {
|
||||
Method method = ((HandlerMethod) handler).getMethod();
|
||||
NoNeedLogin noNeedLogin = ((HandlerMethod) handler).getMethodAnnotation(NoNeedLogin.class);
|
||||
if (noNeedLogin != null) {
|
||||
checkActiveTimeout(requestEmployee,debugNumberTokenFlag);
|
||||
checkActiveTimeout(requestEmployee, debugNumberTokenFlag);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class AdminInterceptor implements HandlerInterceptor {
|
||||
}
|
||||
|
||||
// 检测token 活跃频率
|
||||
checkActiveTimeout(requestEmployee,debugNumberTokenFlag);
|
||||
checkActiveTimeout(requestEmployee, debugNumberTokenFlag);
|
||||
|
||||
|
||||
// --------------- 第三步: 校验 权限 ---------------
|
||||
@@ -107,8 +107,8 @@ public class AdminInterceptor implements HandlerInterceptor {
|
||||
}
|
||||
|
||||
// 如果是超级管理员的话,不需要校验权限
|
||||
if(requestEmployee.getAdministratorFlag()){
|
||||
return true;
|
||||
if (requestEmployee.getAdministratorFlag()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
SaStrategy.instance.checkMethodAnnotation.accept(method);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user