Files
tiesheng-springboot/springboot-web/src/main/java/com/tiesheng/web/service/TieshengWebConfigurer.java
曾文豪 2cf88cefa7
All checks were successful
/ local-deploy (push) Successful in 20s
publish 2.0.17
2024-12-08 12:00:48 +08:00

78 lines
1.6 KiB
Java

package com.tiesheng.web.service;
import cn.hutool.log.LogFactory;
import com.tiesheng.login.service.TsLoginConfigurer;
import com.tiesheng.util.exception.ApiRespEnum;
import com.tiesheng.util.pojos.ApiResp;
import com.tiesheng.web.pojos.dao.CoreConfigSystem;
import com.tiesheng.web.pojos.dto.config.ConfigSystemDTO;
import org.springframework.web.multipart.MultipartFile;
/**
* 核心配置
*
* @author hao
*/
public interface TieshengWebConfigurer {
/**
* 添加其他异常处理
*
* @param e 异常
*/
default ApiResp<String> addExceptionHandler(Exception e) {
ApiResp<String> apiResp = ApiResp.respCust(ApiRespEnum.ServerError);
apiResp.setException(e);
LogFactory.get().info(apiResp.getException());
return apiResp;
}
/**
* 添加文件校验
*/
default void uploadFileCheck(String fileExt) {
}
/**
* 自定义文件上传
*
* @return
*/
default String uploadFileCustomize(MultipartFile file) {
return "";
}
/**
* 上传文件后处理文件
*
* @param uploadPath
* @return
*/
default String uploadFileDeal(String uploadPath) {
return uploadPath;
}
/**
* 系统配置验证
* 如果不符合规则,可以抛出异常
*/
default void configSystemCheck(ConfigSystemDTO dto) {
}
///////////////////////////////////////////////////////////////////////////
// 登录配置
///////////////////////////////////////////////////////////////////////////
/**
* 登录配置
*
* @return
*/
TsLoginConfigurer configureLogin();
}