feat:web模块包名调整
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package com.tiesheng.web.service;
|
||||
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.tiesheng.web.pojos.RequestUserInfo;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.web.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.exception.ApiRespEnum;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* WEB配置
|
||||
*
|
||||
* @author hao
|
||||
*/
|
||||
public interface TieshengWebConfigurer {
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前用户的姓名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
RequestUserInfo getCurrentUserName(TokenBean userId);
|
||||
|
||||
|
||||
/**
|
||||
* 添加其他异常处理
|
||||
*
|
||||
* @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(CoreConfigSystem configSystem) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录逻辑
|
||||
*
|
||||
* @param platformUnique
|
||||
* @return
|
||||
*/
|
||||
TokenBean login(CorePlatformUnique platformUnique);
|
||||
|
||||
/**
|
||||
* 登录重定向
|
||||
*
|
||||
* @param bean
|
||||
* @param extra
|
||||
* @param response
|
||||
*/
|
||||
void redirect(TokenBean bean, String to, String extra, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 签名错误的时候
|
||||
*/
|
||||
default void onSignError(HttpServletResponse response) {
|
||||
ServletKit.write(response, "404", "text");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user