Commit 89ca3295 by zhangxingmin

push

parent 566f622f
......@@ -73,6 +73,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/clientUser/clientUserBizIdList",
"/salary/condition/list",
"/salary/detail",
"/coSession/create",
"/coSession/join",
"/coSession/status",
"/notificationTask/send",
"/userSaleExpand/list",
"/relProjectRole/page",
......
......@@ -90,6 +90,7 @@ public enum CommonEnum {
UID_TYPE_TEAM("team","团队信息表"),
UID_TYPE_CO_SESSION("co_session","协同会话表"),
UID_TYPE_RECORDING_TASK("recording_task","录制任务表"),
UID_TYPE_DESENSITIZATION_RULE("co_desensitization_rule","协同-脱敏设置表"),
//作用域枚举
SCOPE_SYS("1","系统级(全局)"),
......
......@@ -7,6 +7,7 @@ public enum ProjectEnum {
CSF_MINI_PROGRAM("project_IbjfmMTYvNEBuh2S","CSF-小程序",""),
CSF_PC("project_nKULQBH1Gw9Ma8YM","CSF-PC",""),
SFP_CLIENT("project_5RlbyC3WQPPR5T88","家办商城小程序",""),
;
//项目表唯一业务ID
......
package com.yd.common.result;
import java.io.Serializable;
public class CommonResult implements Serializable {
private static final long serialVersionUID = 1L;
private Boolean success; //执行是否成功
private String code; //ZHB错误编码
private String message; //ZHB错误信息
private String errorCode; //其他平台错误编码
private String errorMessage; //其他平台错误编码
private String flag;
/**
* 执行是否成功
* @return
*/
public Boolean isSuccess() {
return success;
}
/**
* 执行是否成功
* @param success
*/
public void setSuccess(Boolean success) {
this.success = success;
}
/**
* 获取属性 code
* @return code 最惠比平台对应的错误编码
*/
public String getCode() {
return code;
}
/**
* 属性赋值 code
* @param code 最惠比平台对应的错误编码
*/
public void setCode(String code) {
this.code = code;
}
/**
* 获取属性 message
* @return 最惠比平台对应的错误信息
*/
public String getMessage() {
return message;
}
/**
* 属性赋值 message
* @param message 最惠比平台对应的错误信息
*/
public void setMessage(String message) {
this.message = message;
}
/**
* 获取属性 errorCode
* @return 其他平台对应的错误编码
*/
public String getErrorCode() {
return errorCode;
}
/**
* 属性赋值 errorCode
* @param errorCode 其他平台对应的错误编码
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* 获取属性 errorMessage
* @return 其他平台对应的错误信息
*/
public String getErrorMessage() {
return errorMessage;
}
/**
* 属性赋值 errorMessage
* @param errorMessage 其他平台对应的错误信息
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
public CommonResult() {
super();
}
/**
* @param success 是否执行成功
* @param message 最惠比平台错误信息
*/
public CommonResult(Boolean success, String message) {
super();
this.success = success;
this.message = message;
}
/**
* @param success 是否执行成功
* @param message 最惠比平台错误信息
* @param errorCode 其他平台错误编码
*/
public CommonResult(Boolean success, String message, String errorCode) {
super();
this.success = success;
this.message = message;
this.errorCode = errorCode;
}
/**
* @param success 是否执行成功
* @param message 最惠比平台错误信息
* @param errorCode 其他平台错误编码
* @param errorMessage 其他平台错误信息
*/
public CommonResult(Boolean success, String message, String errorCode, String errorMessage) {
super();
this.success = success;
this.message = message;
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
}
package com.yd.common.result;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/***
* 返回结果封装
*
* @author fan
*
*/
public class JsonResult implements Serializable {
private static final long serialVersionUID = 1L;
private boolean success;
private String message;
private Object data;
public JsonResult(){}
public JsonResult(boolean success, String msg, Object data){
this.success=success;
this.message=msg;
this.data=data;
}
public JsonResult(boolean success, String msg){
this.success=success;
this.message=msg;
this.data=null;
}
private JsonResult(String msg, Object data) {
this.message=msg;
this.success=true;
this.data=data;
}
public Object getData() {
return data;
}
public String getMessage() {
return message;
}
public boolean isSuccess() {
return success;
}
public JsonResult ofSuccess(String msg, Object data) {
return new JsonResult(msg, data) ;
}
public void setData(Object data) {
this.data = data;
}
public void setMessage(String message) {
this.message = message;
}
public void setSuccess(boolean success) {
this.success = success;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addResult(Object responseVO){
Class c = responseVO.getClass();
Method getMethod = null;
try {
Class[] classArr = null;
getMethod = c.getMethod("getCommonResult", classArr);
} catch (NoSuchMethodException | SecurityException e1) {
e1.printStackTrace();
}
CommonResult commonResult = null;
if(getMethod != null){
try {
Object[] objectArr = null;
commonResult = (CommonResult)getMethod.invoke(responseVO, objectArr);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
}
if(commonResult != null){
this.success = commonResult.isSuccess();
this.message = commonResult.getMessage();
}else{
this.success = true;
// this.message = ZHBErrorConfig.getErrorInfo("600001", null, null);
}
// Method setMethod = null;
// try {
// setMethod = c.getMethod("setCommonResult", CommonResult.class);
// } catch (NoSuchMethodException | SecurityException e) {
// e.printStackTrace();
// }
// if(setMethod != null){
// CommonResult args = null;
// try {
// setMethod.invoke(responseVO, args);
// } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
// e.printStackTrace();
// }
// }
}
}
package com.yd.common.utils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
/**
* 基于字节数组的 MultipartFile 实现,用于将内存中的字节数据包装为文件上传对象
*/
public class ByteArrayMultipartFile implements MultipartFile {
private final byte[] content;
private final String name;
private final String originalFilename;
private final String contentType;
/**
* 构造器
*
* @param content 文件字节数组
* @param name 表单字段名(需与 Feign 接口中的 @RequestPart("file") 一致,通常为 "file")
* @param originalFilename 原始文件名(建议包含扩展名,如 "qr.png")
* @param contentType 内容类型(如 "image/png")
*/
public ByteArrayMultipartFile(byte[] content, String name, String originalFilename, String contentType) {
this.content = content;
this.name = name;
this.originalFilename = originalFilename;
this.contentType = contentType;
}
@Override
public String getName() {
return name;
}
@Override
public String getOriginalFilename() {
return originalFilename;
}
@Override
public String getContentType() {
return contentType;
}
@Override
public boolean isEmpty() {
return content == null || content.length == 0;
}
@Override
public long getSize() {
return content.length;
}
@Override
public byte[] getBytes() throws IOException {
return content;
}
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(content);
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
Files.write(dest.toPath(), content);
}
}
\ No newline at end of file
......@@ -27,5 +27,15 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form-spring</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form</artifactId>
<version>3.8.0</version>
</dependency>
</dependencies>
</project>
//package com.yd.feign.config;
//
//import feign.codec.Encoder;
//import feign.form.spring.SpringFormEncoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class FeignMultipartConfig {
//
// @Bean
// public Encoder feignFormEncoder(ObjectFactory<HttpMessageConverters> converters) {
// return new SpringFormEncoder(new SpringEncoder(converters));
// }
//}
\ No newline at end of file
......@@ -121,6 +121,9 @@ public class GatewayJwtAuthFilterConfig {
"/**/relProjectRole/page",
"/**/salary/condition/list",
"/**/salary/detail",
"/**/coSession/create",
"/**/coSession/join",
"/**/coSession/status",
"/**/notificationTask/send",
"/**/userSaleExpand/list",
"/**/api/relProjectRole/menu/list"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment