feat(search): 实现文件搜索功能并调整文件列表检索
- 新增文件搜索接口,支持用户根据文件名或内容进行搜索。 - 调整文件列表检索逻辑,支持分页及文件名模糊查询。 - 重构文件控制器和用户文件服务,提取公共代码,提高可维护性。 - 修正多处代码格式,提升代码可读性与规范性。 fix(share): 修复分享功能中的过期时间检查问题 -现在分享文件时正确检查过期时间,-1表示不过期。 - 修复批量移动文件时的潜在路径问题。 feat(user): 增加修改密码功能及用户登录逻辑调整 -增加修改密码接口,用户可修改个人密码。 - 简化用户登录逻辑,若用户不存在
This commit is contained in:
parent
f15c0a3524
commit
f4fda113b9
@ -10,15 +10,21 @@ import java.util.List;
|
||||
|
||||
public interface IUserFileService extends IService<UserFile> {
|
||||
List<UserFile> selectUserFileByNameAndPath(String fileName, String filePath, String userId);
|
||||
|
||||
List<UserFile> selectSameUserFile(String fileName, String filePath, String extendName, String userId);
|
||||
|
||||
IPage<FileListVO> userFileList(String userId, String filePath, Long beginCount, Long pageCount);
|
||||
IPage<FileListVO> userFileList(Integer sysFlag, String userId, String filePath, Long beginCount, Long pageCount,String fileName);
|
||||
|
||||
void updateFilepathByUserFileId(String userFileId, String newfilePath, String userId);
|
||||
|
||||
void userFileCopy(String userId, String userFileId, String newfilePath);
|
||||
|
||||
IPage<FileListVO> getFileByFileType(Integer fileTypeId, Long currentPage, Long pageCount, String userId);
|
||||
IPage<FileListVO> getFileByFileType(Integer sysFlag, Integer fileTypeId, Long currentPage, Long pageCount, String userId,String fileName);
|
||||
|
||||
List<UserFile> selectUserFileListByPath(String filePath, String userId);
|
||||
|
||||
List<UserFile> selectFilePathTreeByUserId(String userId);
|
||||
|
||||
void deleteUserFile(String userFileId, String sessionUserId);
|
||||
|
||||
List<UserFile> selectUserFileByLikeRightFilePath(@Param("filePath") String filePath, @Param("userId") String userId);
|
||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qiwenshare.common.result.RestResult;
|
||||
import com.qiwenshare.file.domain.user.Role;
|
||||
import com.qiwenshare.file.domain.user.UserBean;
|
||||
import com.qiwenshare.file.dto.user.EditPassWordDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -22,16 +23,20 @@ public interface IUserService extends IService<UserBean> {
|
||||
RestResult<String> registerUser(UserBean userBean);
|
||||
|
||||
|
||||
|
||||
UserBean findUserInfoByTelephone(String telephone);
|
||||
|
||||
List<Role> selectRoleListByUserId(String userId);
|
||||
|
||||
String getSaltByTelephone(String telephone);
|
||||
|
||||
UserBean selectUserByTelephoneAndPassword(String username, String password);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
RestResult<String> editPassword(EditPassWordDTO dto);
|
||||
|
||||
}
|
||||
|
@ -97,12 +97,13 @@ public class CommonFileController {
|
||||
@Parameter(description = "用户id", required = true) Long commonFileId,
|
||||
@Parameter(description = "文件路径", required = true) String filePath,
|
||||
@Parameter(description = "当前页", required = true) long currentPage,
|
||||
@Parameter(description = "页面数量", required = true) long pageCount){
|
||||
@Parameter(description = "页面数量", required = true) long pageCount,
|
||||
@Parameter(description = "是否文件管理员", required = false) Integer sysFlag) {
|
||||
|
||||
CommonFile commonFile = commonFileService.getById(commonFileId);
|
||||
UserFile userFile = userFileService.getById(commonFile.getUserFileId());
|
||||
QiwenFile qiwenFile = new QiwenFile(userFile.getFilePath(), filePath, true);
|
||||
IPage<FileListVO> fileList = userFileService.userFileList(userFile.getUserId(), qiwenFile.getPath(), currentPage, pageCount);
|
||||
IPage<FileListVO> fileList = userFileService.userFileList(sysFlag, userFile.getUserId(), qiwenFile.getPath(), currentPage, pageCount, null);
|
||||
|
||||
return RestResult.success().data(fileList);
|
||||
|
||||
|
@ -1,13 +1,7 @@
|
||||
package com.qiwenshare.file.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||
import co.elastic.clients.elasticsearch.core.search.HighlighterEncoder;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -21,7 +15,6 @@ import com.qiwenshare.file.api.IFileService;
|
||||
import com.qiwenshare.file.api.IUserFileService;
|
||||
import com.qiwenshare.file.component.AsyncTaskComp;
|
||||
import com.qiwenshare.file.component.FileDealComp;
|
||||
import com.qiwenshare.file.config.es.FileSearch;
|
||||
import com.qiwenshare.file.domain.FileBean;
|
||||
import com.qiwenshare.file.domain.UserFile;
|
||||
import com.qiwenshare.file.dto.file.*;
|
||||
@ -38,8 +31,6 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -56,8 +47,6 @@ import java.util.*;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Tag(name = "file", description = "该接口为文件接口,主要用来做一些文件的基本操作,如创建目录,删除,移动,复制等。")
|
||||
@RestController
|
||||
@ -186,57 +175,57 @@ public class FileController {
|
||||
int currentPage = (int) searchFileDTO.getCurrentPage() - 1;
|
||||
int pageCount = (int) (searchFileDTO.getPageCount() == 0 ? 10 : searchFileDTO.getPageCount());
|
||||
|
||||
SearchResponse<FileSearch> search = null;
|
||||
try {
|
||||
search = elasticsearchClient.search(s -> s
|
||||
.index("filesearch")
|
||||
.query(_1 -> _1
|
||||
.bool(_2 -> _2
|
||||
.must(_3 -> _3
|
||||
.bool(_4 -> _4
|
||||
.should(_5 -> _5
|
||||
.match(_6 -> _6
|
||||
.field("fileName")
|
||||
.query(searchFileDTO.getFileName())))
|
||||
.should(_5 -> _5
|
||||
.wildcard(_6 -> _6
|
||||
.field("fileName")
|
||||
.wildcard("*" + searchFileDTO.getFileName() + "*")))
|
||||
.should(_5 -> _5
|
||||
.match(_6 -> _6
|
||||
.field("content")
|
||||
.query(searchFileDTO.getFileName())))
|
||||
.should(_5 -> _5
|
||||
.wildcard(_6 -> _6
|
||||
.field("content")
|
||||
.wildcard("*" + searchFileDTO.getFileName() + "*")))
|
||||
))
|
||||
.must(_3 -> _3
|
||||
.term(_4 -> _4
|
||||
.field("userId")
|
||||
.value(sessionUserBean.getUserId())))
|
||||
))
|
||||
.from(currentPage)
|
||||
.size(pageCount)
|
||||
.highlight(h -> h
|
||||
.fields("fileName", f -> f.type("plain")
|
||||
.preTags("<span class='keyword'>").postTags("</span>"))
|
||||
.encoder(HighlighterEncoder.Html))
|
||||
,
|
||||
FileSearch.class);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<SearchFileVO> searchFileVOList = new ArrayList<>();
|
||||
for (Hit<FileSearch> hit : search.hits().hits()) {
|
||||
SearchFileVO searchFileVO = new SearchFileVO();
|
||||
BeanUtil.copyProperties(hit.source(), searchFileVO);
|
||||
searchFileVO.setHighLight(hit.highlight());
|
||||
searchFileVOList.add(searchFileVO);
|
||||
asyncTaskComp.checkESUserFileId(searchFileVO.getUserFileId());
|
||||
}
|
||||
return RestResult.success().dataList(searchFileVOList, searchFileVOList.size());
|
||||
// SearchResponse<FileSearch> search = null;
|
||||
// try {
|
||||
// search = elasticsearchClient.search(s -> s
|
||||
// .index("filesearch")
|
||||
// .query(_1 -> _1
|
||||
// .bool(_2 -> _2
|
||||
// .must(_3 -> _3
|
||||
// .bool(_4 -> _4
|
||||
// .should(_5 -> _5
|
||||
// .match(_6 -> _6
|
||||
// .field("fileName")
|
||||
// .query(searchFileDTO.getFileName())))
|
||||
// .should(_5 -> _5
|
||||
// .wildcard(_6 -> _6
|
||||
// .field("fileName")
|
||||
// .wildcard("*" + searchFileDTO.getFileName() + "*")))
|
||||
// .should(_5 -> _5
|
||||
// .match(_6 -> _6
|
||||
// .field("content")
|
||||
// .query(searchFileDTO.getFileName())))
|
||||
// .should(_5 -> _5
|
||||
// .wildcard(_6 -> _6
|
||||
// .field("content")
|
||||
// .wildcard("*" + searchFileDTO.getFileName() + "*")))
|
||||
// ))
|
||||
// .must(_3 -> _3
|
||||
// .term(_4 -> _4
|
||||
// .field("userId")
|
||||
// .value(sessionUserBean.getUserId())))
|
||||
// ))
|
||||
// .from(currentPage)
|
||||
// .size(pageCount)
|
||||
// .highlight(h -> h
|
||||
// .fields("fileName", f -> f.type("plain")
|
||||
// .preTags("<span class='keyword'>").postTags("</span>"))
|
||||
// .encoder(HighlighterEncoder.Html))
|
||||
// ,
|
||||
// FileSearch.class);
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// List<SearchFileVO> searchFileVOList = new ArrayList<>();
|
||||
// for (Hit<FileSearch> hit : search.hits().hits()) {
|
||||
// SearchFileVO searchFileVO = new SearchFileVO();
|
||||
// BeanUtil.copyProperties(hit.source(), searchFileVO);
|
||||
// searchFileVO.setHighLight(hit.highlight());
|
||||
// searchFileVOList.add(searchFileVO);
|
||||
// asyncTaskComp.checkESUserFileId(searchFileVO.getUserFileId());
|
||||
// }
|
||||
return RestResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ -279,13 +268,15 @@ public class FileController {
|
||||
public RestResult<FileListVO> getFileList(
|
||||
@Parameter(description = "文件类型", required = true) String fileType,
|
||||
@Parameter(description = "文件路径", required = true) String filePath,
|
||||
@Parameter(description = "文件名称", required = false) String fileName,
|
||||
@Parameter(description = "当前页", required = true) long currentPage,
|
||||
@Parameter(description = "页面数量", required = true) long pageCount){
|
||||
@Parameter(description = "页面数量", required = true) long pageCount,
|
||||
@Parameter(description = "是否文件管理员", required = false) Integer sysFlag) {
|
||||
if ("0".equals(fileType)) {
|
||||
IPage<FileListVO> fileList = userFileService.userFileList(null, filePath, currentPage, pageCount);
|
||||
IPage<FileListVO> fileList = userFileService.userFileList(sysFlag, null, filePath, currentPage, pageCount, fileName);
|
||||
return RestResult.success().dataList(fileList.getRecords(), fileList.getTotal());
|
||||
} else {
|
||||
IPage<FileListVO> fileList = userFileService.getFileByFileType(Integer.valueOf(fileType), currentPage, pageCount, SessionUtil.getSession().getUserId());
|
||||
IPage<FileListVO> fileList = userFileService.getFileByFileType(sysFlag, Integer.valueOf(fileType), currentPage, pageCount, SessionUtil.getSession().getUserId(), fileName);
|
||||
return RestResult.success().dataList(fileList.getRecords(), fileList.getTotal());
|
||||
}
|
||||
}
|
||||
@ -514,6 +505,4 @@ public class FileController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.qiwenshare.file.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
@ -140,7 +141,6 @@ public class ShareController {
|
||||
List<ShareFile> shareFileList = shareFileService.list(new QueryWrapper<ShareFile>().lambda().eq(ShareFile::getShareBatchNum, saveShareFileDTO.getShareBatchNum()).likeRight(ShareFile::getShareFilePath, QiwenFile.formatPath(shareFile.getShareFilePath() + "/" + fileName)));
|
||||
|
||||
|
||||
|
||||
for (ShareFile shareFile1 : shareFileList) {
|
||||
UserFile userFile1 = userFileService.getById(shareFile1.getUserFileId());
|
||||
userFile1.setUserFileId(IdUtil.getSnowflakeNextIdStr());
|
||||
@ -227,6 +227,10 @@ public class ShareController {
|
||||
return RestResult.fail().message("文件不存在!");
|
||||
}
|
||||
String endTime = share.getEndTime();
|
||||
// -- 如果过期时间为-1则不过期
|
||||
if ("999999".equals(endTime)) {
|
||||
return RestResult.success();
|
||||
}
|
||||
Date endTimeDate = null;
|
||||
try {
|
||||
endTimeDate = DateUtil.getDateByFormatString(endTime, "yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -13,6 +13,7 @@ import com.qiwenshare.file.api.IUserService;
|
||||
import com.qiwenshare.file.component.JwtComp;
|
||||
import com.qiwenshare.file.domain.UserLoginInfo;
|
||||
import com.qiwenshare.file.domain.user.UserBean;
|
||||
import com.qiwenshare.file.dto.user.EditPassWordDTO;
|
||||
import com.qiwenshare.file.dto.user.RegisterDTO;
|
||||
import com.qiwenshare.file.vo.user.UserLoginVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -59,19 +60,35 @@ public class UserController {
|
||||
return restResult;
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "修改密码", description = "修改密码", tags = {"user"})
|
||||
@PostMapping(value = "/editPassword")
|
||||
@MyLog(operation = "修改密码", module = CURRENT_MODULE)
|
||||
@ResponseBody
|
||||
public RestResult<String> editPassword(@Valid @RequestBody EditPassWordDTO dto) {
|
||||
RestResult<String> restResult = null;
|
||||
restResult = userService.editPassword(dto);
|
||||
return restResult;
|
||||
}
|
||||
|
||||
@Operation(summary = "用户登录", description = "用户登录认证后才能进入系统", tags = {"user"})
|
||||
@GetMapping("/login")
|
||||
@MyLog(operation = "用户登录", module = CURRENT_MODULE)
|
||||
@ResponseBody
|
||||
public RestResult<UserLoginVo> userLogin(
|
||||
@Parameter(description = "登录手机号") String telephone,
|
||||
@Parameter(description = "登录密码") String password){
|
||||
@Parameter(description = "用户名") String userName) {
|
||||
String password = "123456";
|
||||
RestResult<UserLoginVo> restResult = new RestResult<UserLoginVo>();
|
||||
String salt = userService.getSaltByTelephone(telephone);
|
||||
String hashPassword = HashUtils.hashHex("MD5", password, salt, 1024);
|
||||
UserBean result = userService.selectUserByTelephoneAndPassword(telephone, hashPassword);
|
||||
if (result == null) {
|
||||
return RestResult.fail().message("手机号或密码错误!");
|
||||
result = new UserBean();
|
||||
result.setUsername(userName);
|
||||
result.setTelephone(telephone);
|
||||
result.setPassword(password);
|
||||
userService.registerUser(result);
|
||||
}
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
|
@ -27,7 +27,7 @@ public class Share {
|
||||
private String extractionCode;
|
||||
@Column(columnDefinition="varchar(40) comment '分享批次号'")
|
||||
private String shareBatchNum;
|
||||
@Column(columnDefinition="int(2) comment '分享类型(0公共,1私密,2好友)'")
|
||||
@Column(columnDefinition="int(2) comment '分享类型(0公共,1私密,2好友,3共享)'")
|
||||
private Integer shareType;
|
||||
@Column(columnDefinition="int(2) comment '分享状态(0正常,1已失效,2已撤销)'")
|
||||
private Integer shareStatus;
|
||||
|
@ -13,7 +13,7 @@ public class ShareFileDTO {
|
||||
private String userFileIds;
|
||||
@Schema(description = "过期日期", example="2020-05-23 22:10:33")
|
||||
private String endTime;
|
||||
@Schema(description = "分享类型", example="0公共分享,1私密分享,2好友分享")
|
||||
@Schema(description = "分享类型", example="0公共分享,1私密分享,2好友分享,3文件共享(丢到共享里面)")
|
||||
private Integer shareType;
|
||||
@Schema(description = "备注", example="")
|
||||
private String remarks;
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.qiwenshare.file.dto.user;
|
||||
|
||||
import com.qiwenshare.common.constant.RegexConstant;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Data
|
||||
@Schema(name = "用户注册DTO",required = true)
|
||||
public class EditPassWordDTO {
|
||||
|
||||
@Schema(description = "原密码", required = true, example = "password123")
|
||||
@NotBlank(message = "原密码")
|
||||
@Pattern(regexp = RegexConstant.PASSWORD_REGEX, message = "密码长度6-20位,不允许中文")
|
||||
private String oldPassword;
|
||||
|
||||
@Schema(description = "新密码", required = true, example = "password123")
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Pattern(regexp = RegexConstant.PASSWORD_REGEX, message = "密码长度6-20位,不允许中文")
|
||||
private String password;
|
||||
}
|
@ -70,7 +70,7 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> imple
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<FileListVO> userFileList(String userId, String filePath, Long currentPage, Long pageCount) {
|
||||
public IPage<FileListVO> userFileList(Integer sysFlag, String userId, String filePath, Long currentPage, Long pageCount,String fileName) {
|
||||
Page<FileListVO> page = new Page<>(currentPage, pageCount);
|
||||
UserFile userFile = new UserFile();
|
||||
JwtUser sessionUserBean = SessionUtil.getSession();
|
||||
@ -79,7 +79,11 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> imple
|
||||
} else {
|
||||
userFile.setUserId(userId);
|
||||
}
|
||||
|
||||
//文件管理员不限制用户
|
||||
if (sysFlag != null && sysFlag == 1) {
|
||||
userFile.setUserId(null);
|
||||
}
|
||||
userFile.setFileName(fileName);
|
||||
userFile.setFilePath(URLDecoder.decodeForPath(filePath, StandardCharsets.UTF_8));
|
||||
|
||||
return userFileMapper.selectPageVo(page, userFile, null);
|
||||
@ -170,11 +174,16 @@ public class UserFileService extends ServiceImpl<UserFileMapper, UserFile> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<FileListVO> getFileByFileType(Integer fileTypeId, Long currentPage, Long pageCount, String userId) {
|
||||
public IPage<FileListVO> getFileByFileType(Integer sysFlag, Integer fileTypeId, Long currentPage, Long pageCount, String userId,String fileName) {
|
||||
Page<FileListVO> page = new Page<>(currentPage, pageCount);
|
||||
|
||||
UserFile userFile = new UserFile();
|
||||
userFile.setUserId(userId);
|
||||
userFile.setFileName(fileName);
|
||||
//文件管理员不限制用户
|
||||
if (sysFlag != null && sysFlag == 1) {
|
||||
userFile.setUserId(null);
|
||||
}
|
||||
return userFileMapper.selectPageVo(page, userFile, fileTypeId);
|
||||
}
|
||||
|
||||
|
@ -9,12 +9,14 @@ import com.qiwenshare.common.util.DateUtil;
|
||||
import com.qiwenshare.common.util.HashUtils;
|
||||
import com.qiwenshare.common.util.PasswordUtil;
|
||||
import com.qiwenshare.common.util.security.JwtUser;
|
||||
import com.qiwenshare.common.util.security.SessionUtil;
|
||||
import com.qiwenshare.file.api.IUserService;
|
||||
import com.qiwenshare.file.component.JwtComp;
|
||||
import com.qiwenshare.file.component.UserDealComp;
|
||||
import com.qiwenshare.file.controller.UserController;
|
||||
import com.qiwenshare.file.domain.user.Role;
|
||||
import com.qiwenshare.file.domain.user.UserBean;
|
||||
import com.qiwenshare.file.dto.user.EditPassWordDTO;
|
||||
import com.qiwenshare.file.mapper.UserMapper;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -143,9 +145,28 @@ public class UserService extends ServiceImpl<UserMapper, UserBean> implements IU
|
||||
|
||||
return userMapper.selectSaltByTelephone(telephone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserBean selectUserByTelephoneAndPassword(String username, String password) {
|
||||
return userMapper.selectUserByTelephoneAndPassword(username, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public RestResult<String> editPassword(EditPassWordDTO dto) {
|
||||
JwtUser sessionUserBean = SessionUtil.getSession();
|
||||
UserBean userBean = this.getById(sessionUserBean.getUserId());
|
||||
|
||||
String oldPassword = HashUtils.hashHex("MD5", dto.getOldPassword(), userBean.getSalt(), 1024);
|
||||
if (!oldPassword.equals(userBean.getPassword())) {
|
||||
return RestResult.fail().message("密码错误!");
|
||||
}
|
||||
String salt = PasswordUtil.getSaltValue();
|
||||
String newPassword = HashUtils.hashHex("MD5", dto.getPassword(), salt, 1024);
|
||||
userBean.setSalt(salt);
|
||||
userBean.setPassword(newPassword);
|
||||
userMapper.updateById(userBean);
|
||||
return RestResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,6 @@ import lombok.Data;
|
||||
@Data
|
||||
@Schema(description="分享类型VO")
|
||||
public class ShareTypeVO {
|
||||
@Schema(description="0公共,1私密,2好友")
|
||||
@Schema(description="0公共,1私密,2好友,3共享")
|
||||
private Integer shareType;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ logging.file.name=/qiwenshare/qiwen-file/log/web.log
|
||||
logging.level.root=info
|
||||
|
||||
#jpa配置 create/update
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.hibernate.ddl-a·uto=update
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
|
||||
spring.jpa.show-sql=true
|
||||
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
||||
@ -23,7 +23,7 @@ spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.Ph
|
||||
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url = jdbc:mysql://localhost:3306/file?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=ma123456
|
||||
spring.datasource.password=root
|
||||
|
||||
#静态资源指定
|
||||
spring.mvc.static-path-pattern=/**
|
||||
|
@ -35,7 +35,7 @@
|
||||
and a.userFileId = #{userFile.userFileId}
|
||||
</if>
|
||||
<if test="userFile.fileName != null">
|
||||
and a.fileName = #{userFile.fileName}
|
||||
and a.fileName like concat('%', #{userFile.fileName}, '%')
|
||||
</if>
|
||||
and a.deleteFlag = 0
|
||||
</where>
|
||||
|
Loading…
Reference in New Issue
Block a user