fix
This commit is contained in:
@@ -102,6 +102,15 @@ public class DifyClient {
|
|||||||
public String getFilename() {
|
public String getFilename() {
|
||||||
return request.getFileName();
|
return request.getFileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @Override
|
||||||
|
public String getDescription() {
|
||||||
|
try {
|
||||||
|
return HttpURLConnection.guessContentTypeFromStream(request.getInputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
};
|
};
|
||||||
|
|
||||||
body.add("file", fileResource);
|
body.add("file", fileResource);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.senmesh.security.access.provider.impl;
|
package com.senmesh.security.access.provider.impl;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -45,7 +46,7 @@ public class UrlFilterConfigAttribueProvider implements FilterConfigAttributePro
|
|||||||
AlitaResult<List<UrlPermissionDTO>> result =
|
AlitaResult<List<UrlPermissionDTO>> result =
|
||||||
iPermissionSecurityService.listUrl(permissionQueryDTO);
|
iPermissionSecurityService.listUrl(permissionQueryDTO);
|
||||||
Assert.isTrue(result.getSuccess(), "资源权限获取失败");
|
Assert.isTrue(result.getSuccess(), "资源权限获取失败");
|
||||||
return result.getData().stream().filter(p -> StringUtils.isNotBlank(p.getLink())
|
Map<String, Collection<ConfigAttribute>> map = result.getData().stream().filter(p -> StringUtils.isNotBlank(p.getLink())
|
||||||
&& UrlTypeEnum.INTERFACE.getType().toString().equals(p.getResourceType()))
|
&& UrlTypeEnum.INTERFACE.getType().toString().equals(p.getResourceType()))
|
||||||
.collect(Collectors.toMap(UrlPermissionDTO::getLink, v -> {
|
.collect(Collectors.toMap(UrlPermissionDTO::getLink, v -> {
|
||||||
Collection<ConfigAttribute> values = new HashSet<ConfigAttribute>();
|
Collection<ConfigAttribute> values = new HashSet<ConfigAttribute>();
|
||||||
@@ -55,6 +56,7 @@ public class UrlFilterConfigAttribueProvider implements FilterConfigAttributePro
|
|||||||
v1.addAll(v2);
|
v1.addAll(v2);
|
||||||
return v1;
|
return v1;
|
||||||
}));
|
}));
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,13 @@ public class UserFileController {
|
|||||||
return AlitaResult.success(true);
|
return AlitaResult.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/modify_status")
|
||||||
|
@ApiOperation("修改状态")
|
||||||
|
public AlitaResult<Boolean> modifyStatus(@Validated @RequestBody UserFileModifyStatusDTO modifyStatusDTO) {
|
||||||
|
userFileService.modifyStatus(modifyStatusDTO);
|
||||||
|
return AlitaResult.success(true);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/find")
|
@GetMapping("/find")
|
||||||
@ApiOperation("查询")
|
@ApiOperation("查询")
|
||||||
public AlitaResult<UserFileDTO> find(UserFileQueryDTO queryDTO) {
|
public AlitaResult<UserFileDTO> find(UserFileQueryDTO queryDTO) {
|
||||||
@@ -86,11 +93,20 @@ public class UserFileController {
|
|||||||
return AlitaResult.success(queryDTO.getPageResult());
|
return AlitaResult.success(queryDTO.getPageResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page_super")
|
||||||
|
@ApiOperation("分页查询(超级管理员)")
|
||||||
|
public AlitaResult<Page<UserFileDTO>> pageSuper(UserFileQueryDTO queryDTO) {
|
||||||
|
userFileService.page(queryDTO);
|
||||||
|
return AlitaResult.success(queryDTO.getPageResult());
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/statistics/category")
|
@GetMapping("/statistics/category")
|
||||||
@ApiOperation("按文件种类统计")
|
@ApiOperation("按文件种类统计")
|
||||||
public AlitaResult<List<UserFileStatisticsDTO>> statisticsByCategory(UserFileQueryDTO queryDTO) {
|
public AlitaResult<List<UserFileStatisticsDTO>> statisticsByCategory(UserFileQueryDTO queryDTO) {
|
||||||
queryDTO.setUserId(UserContextHolder.getExistLoginUserId());
|
queryDTO.setUserId(UserContextHolder.getExistLoginUserId());
|
||||||
return AlitaResult.success(userFileService.statisticsByCategory(queryDTO));
|
return AlitaResult.success(userFileService.statisticsByCategory(queryDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,5 +63,11 @@ public class UserFileDTO extends BaseDTO {
|
|||||||
|
|
||||||
@ApiModelProperty("文件种类")
|
@ApiModelProperty("文件种类")
|
||||||
private String fileCategory;
|
private String fileCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("最高风险等级:1重度/2中度/3轻度")
|
||||||
|
private String maxRiskLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty("风险详情JSON")
|
||||||
|
private String riskJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户文件查询DTO
|
* 用户文件查询DTO
|
||||||
*/
|
*/
|
||||||
@@ -50,6 +52,9 @@ public class UserFileQueryDTO extends PageQueryDTO<UserFileDTO> {
|
|||||||
@ApiModelProperty("文件状态:1正常2失效11解析中12待审核13传输中")
|
@ApiModelProperty("文件状态:1正常2失效11解析中12待审核13传输中")
|
||||||
private String fileStatus;
|
private String fileStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件状态(多值查询)")
|
||||||
|
private Set<String> fileStatusIn;
|
||||||
|
|
||||||
@ApiModelProperty("路径(模糊查询,用于查询某个文件夹下的所有子文件)")
|
@ApiModelProperty("路径(模糊查询,用于查询某个文件夹下的所有子文件)")
|
||||||
private String pathLike;
|
private String pathLike;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<mapper namespace="com.senmesh.sfile.dao.UserFileMapper">
|
<mapper namespace="com.senmesh.sfile.dao.UserFileMapper">
|
||||||
|
|
||||||
<select id="list" resultType="com.senmesh.sfile.dto.UserFileDTO">
|
<select id="list" resultType="com.senmesh.sfile.dto.UserFileDTO">
|
||||||
SELECT t.*, fr.file_size, fc.file_category
|
SELECT t.*, fr.file_size, fc.file_category, fk.max_risk_level, fk.risk_json
|
||||||
<include refid="queryFromSql"></include>
|
<include refid="queryFromSql"></include>
|
||||||
ORDER BY t.id DESC
|
ORDER BY t.id DESC
|
||||||
</select>
|
</select>
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
FROM x_user_file t
|
FROM x_user_file t
|
||||||
LEFT JOIN xs_file_record fr ON t.file_code = fr.file_code AND fr.deleted = FALSE
|
LEFT JOIN xs_file_record fr ON t.file_code = fr.file_code AND fr.deleted = FALSE
|
||||||
LEFT JOIN x_file_category fc ON fr.file_suffix = fc.file_suffix AND fc.deleted = FALSE
|
LEFT JOIN x_file_category fc ON fr.file_suffix = fc.file_suffix AND fc.deleted = FALSE
|
||||||
|
LEFT JOIN x_file_risk fk ON t.file_code = fk.file_code AND fk.deleted = FALSE
|
||||||
WHERE t.deleted = FALSE
|
WHERE t.deleted = FALSE
|
||||||
<if test='param.id != null'>
|
<if test='param.id != null'>
|
||||||
AND t.id = #{param.id}
|
AND t.id = #{param.id}
|
||||||
@@ -62,6 +63,12 @@
|
|||||||
<if test='param.fileStatus != null and param.fileStatus.trim() != ""'>
|
<if test='param.fileStatus != null and param.fileStatus.trim() != ""'>
|
||||||
AND t.file_status = #{param.fileStatus}
|
AND t.file_status = #{param.fileStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<if test='param.fileStatusIn != null and !param.fileStatusIn.isEmpty()'>
|
||||||
|
AND t.file_status IN
|
||||||
|
<foreach collection="param.fileStatusIn" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test='param.pathLike != null and param.pathLike.trim() != ""'>
|
<if test='param.pathLike != null and param.pathLike.trim() != ""'>
|
||||||
<bind name="pathLike" value="'%' + param.pathLike + '%'" />
|
<bind name="pathLike" value="'%' + param.pathLike + '%'" />
|
||||||
AND t.path like #{pathLike}
|
AND t.path like #{pathLike}
|
||||||
|
|||||||
@@ -2,10 +2,14 @@ package com.senmesh.sfile.service.impl;
|
|||||||
|
|
||||||
import com.senmesh.common.AlitaResult;
|
import com.senmesh.common.AlitaResult;
|
||||||
import com.senmesh.common.constant.CommonConstants;
|
import com.senmesh.common.constant.CommonConstants;
|
||||||
|
import com.senmesh.common.exception.BusinessException;
|
||||||
import com.senmesh.common.util.JsonUtils;
|
import com.senmesh.common.util.JsonUtils;
|
||||||
import com.senmesh.common.util.ListUtil;
|
import com.senmesh.common.util.ListUtil;
|
||||||
import com.senmesh.common.util.UserContextHolder;
|
import com.senmesh.common.util.UserContextHolder;
|
||||||
|
import com.senmesh.component.file.entity.FileRecord;
|
||||||
|
import com.senmesh.component.file.service.FileRecordService;
|
||||||
import com.senmesh.component.file.service.FileService;
|
import com.senmesh.component.file.service.FileService;
|
||||||
|
import com.senmesh.component.file.util.FileStorageUtils;
|
||||||
import com.senmesh.config.dto.ConfigDTO;
|
import com.senmesh.config.dto.ConfigDTO;
|
||||||
import com.senmesh.config.dto.ConfigOperatorDTO;
|
import com.senmesh.config.dto.ConfigOperatorDTO;
|
||||||
import com.senmesh.config.entity.Config;
|
import com.senmesh.config.entity.Config;
|
||||||
@@ -26,6 +30,7 @@ import com.senmesh.sfile.dto.FileRiskQueryDTO;
|
|||||||
import com.senmesh.sfile.entity.FileRisk;
|
import com.senmesh.sfile.entity.FileRisk;
|
||||||
import com.senmesh.sfile.service.FileRiskService;
|
import com.senmesh.sfile.service.FileRiskService;
|
||||||
import com.senmesh.usercenter.constants.OrgConstants;
|
import com.senmesh.usercenter.constants.OrgConstants;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -73,6 +78,9 @@ public class FileRiskServiceImpl implements FileRiskService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FileService fileService;
|
private FileService fileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FileRecordService fileRecordService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文件风险锁DTO
|
* 获取文件风险锁DTO
|
||||||
*
|
*
|
||||||
@@ -143,7 +151,7 @@ public class FileRiskServiceImpl implements FileRiskService {
|
|||||||
// 1.1 记录不存在,创建新记录
|
// 1.1 记录不存在,创建新记录
|
||||||
log.info("文件风险不存在,创建新记录,fileCode: {}", fileCode);
|
log.info("文件风险不存在,创建新记录,fileCode: {}", fileCode);
|
||||||
FileRiskCreateDTO createDTO = FileRiskCreateDTO.builder()
|
FileRiskCreateDTO createDTO = FileRiskCreateDTO.builder()
|
||||||
// .fileCode("aa.png")
|
.fileCode(fileCode)
|
||||||
.build();
|
.build();
|
||||||
fileRiskDTO = this.create(createDTO);
|
fileRiskDTO = this.create(createDTO);
|
||||||
}
|
}
|
||||||
@@ -168,7 +176,7 @@ public class FileRiskServiceImpl implements FileRiskService {
|
|||||||
inputs.put("srwj",
|
inputs.put("srwj",
|
||||||
Collections.singletonList(
|
Collections.singletonList(
|
||||||
DifyChatRequest.DifyFileInfo.builder()
|
DifyChatRequest.DifyFileInfo.builder()
|
||||||
.type("image")
|
.type("document")
|
||||||
.uploadFileId(uploadResponse.getId())
|
.uploadFileId(uploadResponse.getId())
|
||||||
.build()
|
.build()
|
||||||
));
|
));
|
||||||
@@ -235,33 +243,38 @@ public class FileRiskServiceImpl implements FileRiskService {
|
|||||||
*/
|
*/
|
||||||
private DifyFileUploadResponse uploadFileToDify(FileRiskDTO fileRiskDTO, String fileCode, String apiKey) {
|
private DifyFileUploadResponse uploadFileToDify(FileRiskDTO fileRiskDTO, String fileCode, String apiKey) {
|
||||||
// 1. 获取文件流
|
// 1. 获取文件流
|
||||||
InputStream fileStream = fileService.getFile(fileCode);
|
FileRecord fileRecord = fileRecordService.find(FileRecord.builder().fileCode(fileCode).build());
|
||||||
Assert.notNull(fileStream, "获取文件流失败,fileCode: " + fileCode);
|
try(InputStream fileStream = FileStorageUtils.get().download(fileRecord.getFilePath())){
|
||||||
|
Assert.notNull(fileStream, "获取文件流失败,fileCode: " + fileCode);
|
||||||
|
|
||||||
// 2. 上传文件到 Dify
|
// 2. 上传文件到 Dify
|
||||||
DifyFileUploadRequest uploadRequest = DifyFileUploadRequest.builder()
|
DifyFileUploadRequest uploadRequest = DifyFileUploadRequest.builder()
|
||||||
.inputStream(fileStream)
|
.inputStream(fileStream)
|
||||||
.fileName(fileCode)
|
.fileName(fileRecord.getFileName())
|
||||||
.user(DIFY_USER_ID)
|
.user(DIFY_USER_ID)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
AlitaResult<DifyFileUploadResponse> uploadResult = DifyClient.uploadFile(apiKey, uploadRequest);
|
AlitaResult<DifyFileUploadResponse> uploadResult = DifyClient.uploadFile(apiKey, uploadRequest);
|
||||||
Assert.isTrue(uploadResult.getSuccess() ,
|
Assert.isTrue(uploadResult.getSuccess() ,
|
||||||
"上传文件到 Dify 失败,fileCode: " + fileCode + ", error: " + uploadResult.getMsg());
|
"上传文件到 Dify 失败,fileCode: " + fileCode + ", error: " + uploadResult.getMsg());
|
||||||
|
|
||||||
DifyFileUploadResponse uploadResponse = uploadResult.getData();
|
DifyFileUploadResponse uploadResponse = uploadResult.getData();
|
||||||
String difyFileJson = JsonUtils.toJsonString(uploadResponse);
|
String difyFileJson = JsonUtils.toJsonString(uploadResponse);
|
||||||
// 3. 更新 difyFileJson 字段
|
// 3. 更新 difyFileJson 字段
|
||||||
FileRisk updateFileRisk = FileRisk.builder()
|
FileRisk updateFileRisk = FileRisk.builder()
|
||||||
.id(fileRiskDTO.getId())
|
.id(fileRiskDTO.getId())
|
||||||
.difyFileJson(difyFileJson)
|
.difyFileJson(difyFileJson)
|
||||||
.build();
|
.build();
|
||||||
fileRiskMapper.updateEntitySelective(updateFileRisk);
|
fileRiskMapper.updateEntitySelective(updateFileRisk);
|
||||||
|
|
||||||
// 更新 DTO
|
// 更新 DTO
|
||||||
fileRiskDTO.setDifyFileJson(difyFileJson);
|
fileRiskDTO.setDifyFileJson(difyFileJson);
|
||||||
|
|
||||||
|
return uploadResponse;
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException(e);
|
||||||
|
}
|
||||||
|
|
||||||
return uploadResponse;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -272,7 +285,8 @@ public class FileRiskServiceImpl implements FileRiskService {
|
|||||||
*/
|
*/
|
||||||
private String parseMaxRiskLevel(DifyChatResponse chatResponse) {
|
private String parseMaxRiskLevel(DifyChatResponse chatResponse) {
|
||||||
Map<String, Object> resultMap = JsonUtils.toMap(chatResponse.getAnswer());
|
Map<String, Object> resultMap = JsonUtils.toMap(chatResponse.getAnswer());
|
||||||
return String.valueOf(resultMap.get("max_risk_level"));
|
Object level = resultMap.get("max_risk_level");
|
||||||
|
return level == null ? null : String.valueOf(resultMap.get("max_risk_level"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
import lombok.Builder.Default;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -28,8 +29,9 @@ public class OrgCreateDTO extends BaseOperateDTO{
|
|||||||
private static final long serialVersionUID = 7745034806528023290L;
|
private static final long serialVersionUID = 7745034806528023290L;
|
||||||
|
|
||||||
@ApiModelProperty("机构类型")
|
@ApiModelProperty("机构类型")
|
||||||
@NotEmpty(message = "机构类型不能为空")
|
// @NotEmpty(message = "机构类型不能为空")
|
||||||
private String type;
|
@Default
|
||||||
|
private String type = "2";
|
||||||
@ApiModelProperty("机构名称")
|
@ApiModelProperty("机构名称")
|
||||||
@NotBlank(message = "机构名称不能为空")
|
@NotBlank(message = "机构名称不能为空")
|
||||||
private String orgName;
|
private String orgName;
|
||||||
@@ -37,12 +39,12 @@ public class OrgCreateDTO extends BaseOperateDTO{
|
|||||||
@Expression(type = ValidProviderEnum.PHONE, message = "管理员手机号格式不正确")
|
@Expression(type = ValidProviderEnum.PHONE, message = "管理员手机号格式不正确")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@NotBlank(message = "管理员姓名不能为空")
|
// @NotBlank(message = "管理员姓名不能为空")
|
||||||
@ApiModelProperty("管理员姓名")
|
@ApiModelProperty("管理员姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@ApiModelProperty("唯一社会信用代码")
|
@ApiModelProperty("唯一社会信用代码")
|
||||||
@Expression(type = ValidProviderEnum.CREDIT_CODE, message = "统一社会信用代码格式错误")
|
// @Expression(type = ValidProviderEnum.CREDIT_CODE, message = "统一社会信用代码格式错误")
|
||||||
private String creditCode;
|
private String creditCode;
|
||||||
@ApiModelProperty("企业所在地")
|
@ApiModelProperty("企业所在地")
|
||||||
// @NotBlank(message = "企业所在地不能为空")
|
// @NotBlank(message = "企业所在地不能为空")
|
||||||
@@ -64,7 +66,7 @@ public class OrgCreateDTO extends BaseOperateDTO{
|
|||||||
/**
|
/**
|
||||||
* 注册地址
|
* 注册地址
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "企业注册地址不能为空")
|
// @NotBlank(message = "企业注册地址不能为空")
|
||||||
private String registeredAddress;
|
private String registeredAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +87,7 @@ public class OrgCreateDTO extends BaseOperateDTO{
|
|||||||
/**
|
/**
|
||||||
* 企业所在地 地点全称
|
* 企业所在地 地点全称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "企业经营地址不能为空")
|
// @NotBlank(message = "企业经营地址不能为空")
|
||||||
private String addressName;
|
private String addressName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class OrgServiceImpl implements OrgService {
|
|||||||
|
|
||||||
Integer orgType = Integer.valueOf(orgCreateDTO.getType());
|
Integer orgType = Integer.valueOf(orgCreateDTO.getType());
|
||||||
// 分配权限包
|
// 分配权限包
|
||||||
permissionOrganizationService.saveOrgByType(orgId, orgType);
|
// permissionOrganizationService.saveOrgByType(orgId, orgType);
|
||||||
// orgrelation上下级
|
// orgrelation上下级
|
||||||
orgRelationService.create(OrgRelationCreateDTO.builder().orgId(orgId).orgType(orgType)
|
orgRelationService.create(OrgRelationCreateDTO.builder().orgId(orgId).orgType(orgType)
|
||||||
.platformCode(EnvironmentUtils.getSystemCode()).parentId(orgCreateDTO.getParentId()).build());
|
.platformCode(EnvironmentUtils.getSystemCode()).parentId(orgCreateDTO.getParentId()).build());
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.apache.ibatis.annotations.Select;
|
|||||||
*/
|
*/
|
||||||
public interface UserExtensionMapper extends MyMapper<UserExtension> {
|
public interface UserExtensionMapper extends MyMapper<UserExtension> {
|
||||||
|
|
||||||
@Select("select * from uc_user_extension where deleted = 0 and user_id = #{userId}")
|
@Select("select * from uc_user_extension where deleted = false and user_id = #{userId}")
|
||||||
UserExtensionDTO getByUserId(@Param("userId") Long userId);
|
UserExtensionDTO getByUserId(@Param("userId") Long userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,13 +51,8 @@ public class UserUtils {
|
|||||||
public static void setInitUserNameAndPasswordToCreateUser(User user, Boolean administrator) {
|
public static void setInitUserNameAndPasswordToCreateUser(User user, Boolean administrator) {
|
||||||
//创建用户的时候就给手机号绑定状态改为已绑定
|
//创建用户的时候就给手机号绑定状态改为已绑定
|
||||||
user.setPhoneBinding(true);
|
user.setPhoneBinding(true);
|
||||||
if (Boolean.TRUE.equals(administrator)) {
|
user.setUsername("ou"+user.getPhone());
|
||||||
user.setUsername("lgsc"+user.getPhone());
|
user.setPassword(PasswordUtils.encode("ou123567"));
|
||||||
user.setPassword(PasswordUtils.encode("lgsc123567"));
|
|
||||||
}else {
|
|
||||||
user.setUsername("ou"+user.getPhone());
|
|
||||||
user.setPassword(PasswordUtils.encode("ou123567"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String dealNickname(String nickname, String phone) {
|
public static String dealNickname(String nickname, String phone) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||||
com.senmesh.common.CommonConfiguration,\
|
com.senmesh.common.CommonConfiguration,\
|
||||||
|
com.senmesh.codegenerator.config.CodeConfiguration,\
|
||||||
com.senmesh.frame.redis.config.RedisCacheConfig,\
|
com.senmesh.frame.redis.config.RedisCacheConfig,\
|
||||||
com.senmesh.frame.redis.redisson.RedissonConfig
|
com.senmesh.frame.redis.redisson.RedissonConfig
|
||||||
@@ -58,10 +58,8 @@ file.transfer.unpack-risk-check=false
|
|||||||
|
|
||||||
#发号器
|
#发号器
|
||||||
#机器id:根据ip自己定义
|
#机器id:根据ip自己定义
|
||||||
code.snowflake.workid.192.168.71.5=23
|
code.snowflake.workid.192.168.71.4=1
|
||||||
code.snowflake.workid.192.168.1.47=24
|
|
||||||
code.snowflake.workid.121.37.2.171=1
|
|
||||||
code.snowflake.workid.139.159.237.199=2
|
|
||||||
|
|
||||||
|
|
||||||
##redis配置
|
##redis配置
|
||||||
@@ -116,7 +114,7 @@ sms.phoneSms=
|
|||||||
|
|
||||||
|
|
||||||
#dify配置
|
#dify配置
|
||||||
dify.enable=false
|
dify.enable=true
|
||||||
dify.host=http://114.242.42.23:8501
|
dify.host=http://114.242.42.23:8501
|
||||||
# 规则生成 API Key
|
# 规则生成 API Key
|
||||||
dify.risk.rule.api-key=app-agFkKV5EsAEZfCC6wGSDraak
|
dify.risk.rule.api-key=app-agFkKV5EsAEZfCC6wGSDraak
|
||||||
|
|||||||
Reference in New Issue
Block a user