历史记录获取与删除功能;修复用户修改密码后缓存并未删除的问题

dev-active
lensfrex 2 years ago
parent 685b582d04
commit a3dedc2c98
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 2
      src/main/java/net/lensfrex/dscape/dao/entity/ComputeHistory.java
  2. 2
      src/main/java/net/lensfrex/dscape/dao/entity/PatientData.java
  3. 16
      src/main/java/net/lensfrex/dscape/dao/mapper/ComputeHistoryMapper.java
  4. 15
      src/main/java/net/lensfrex/dscape/dao/mapper/PatientDataMapper.java
  5. 26
      src/main/java/net/lensfrex/dscape/dao/service/ComputeHistoryService.java
  6. 21
      src/main/java/net/lensfrex/dscape/dao/service/PatientDataService.java
  7. 3
      src/main/java/net/lensfrex/dscape/dao/service/UserBasicService.java
  8. 72
      src/main/java/net/lensfrex/dscape/dao/service/impl/ComputeHistoryServiceImpl.java
  9. 36
      src/main/java/net/lensfrex/dscape/dao/service/impl/PatientDataServiceImpl.java
  10. 36
      src/main/java/net/lensfrex/dscape/dto/response/data/admin/CreateUserResponse.java
  11. 62
      src/main/java/net/lensfrex/dscape/dto/response/data/admin/UserRegisterApplicationResponseData.java
  12. 87
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeHistoryReponseData.java
  13. 26
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeHistoryResponseData.java
  14. 36
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeStatusQueryResponse.java
  15. 26
      src/main/java/net/lensfrex/dscape/dto/response/data/compute/ComputeTaskResponseData.java
  16. 66
      src/main/java/net/lensfrex/dscape/dto/response/data/user/LoginResponseData.java
  17. 6
      src/main/java/net/lensfrex/dscape/dto/response/data/user/RegisterResponseBody.java
  18. 26
      src/main/java/net/lensfrex/dscape/dto/response/data/user/RegisterResponseData.java
  19. 1
      src/main/java/net/lensfrex/dscape/dto/response/general/ResponseCode.java
  20. 2
      src/main/java/net/lensfrex/dscape/exception/handler/GlobalExceptionHandler.java
  21. 64
      src/main/java/net/lensfrex/dscape/web/controllers/history/HistoryController.java
  22. 4
      src/main/java/net/lensfrex/dscape/web/controllers/user/UserController.java
  23. 5
      src/main/java/net/lensfrex/dscape/web/controllers/user/admin/AdminController.java
  24. 51
      src/main/java/net/lensfrex/dscape/web/service/data/HistoryService.java
  25. 6
      src/main/java/net/lensfrex/dscape/web/service/user/AdminService.java
  26. 9
      src/main/java/net/lensfrex/dscape/web/service/user/UserService.java

@ -29,7 +29,7 @@ public class ComputeHistory implements Serializable {
/**
* 计算数据记录对应的患者数据id
*/
private Integer rid;
private Long rid;
public ComputeHistory() {}
}

@ -22,7 +22,7 @@ public class PatientData implements Serializable {
* 数据id
*/
@TableId(type = IdType.AUTO)
private Integer id;
private Long id;
/**
* 病人id

@ -0,0 +1,16 @@
package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import net.lensfrex.dscape.dao.entity.ComputeHistory;
/**
* @author lensfrex
* @description compute_historyMapper
* @date 2022-08-22
*/
@Mapper
public interface ComputeHistoryMapper extends BaseMapper<ComputeHistory> {
}

@ -0,0 +1,15 @@
package net.lensfrex.dscape.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import net.lensfrex.dscape.dao.entity.PatientData;
/**
* @author lensfrex
* @description patient_dataMapper
* @date 2022-08-22
*/
@Mapper
public interface PatientDataMapper extends BaseMapper<PatientData> {
}

@ -0,0 +1,26 @@
package net.lensfrex.dscape.dao.service;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import net.lensfrex.dscape.dao.entity.ComputeHistory;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @author lensfrex
* @description compute_history服务层
* @date 2022-08-22
*/
@Service
public interface ComputeHistoryService extends IService<ComputeHistory> {
long count(SFunction<ComputeHistory, ?> indexColum, Object index);
List<ComputeHistory> getHistory(String uid, int page, int limit);
List<Long> getHistoryIds(String uid, int page, int limit);
boolean remove(Long id);
String getHistoryUser(Long rid);
}

@ -0,0 +1,21 @@
package net.lensfrex.dscape.dao.service;
import net.lensfrex.dscape.dao.entity.PatientData;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @author lensfrex
* @description patient_data服务层
* @date 2022-08-22
*/
@Service
public interface PatientDataService extends IService<PatientData> {
List<PatientData> getData(List<Long> ids);
PatientData getData(Long id);
}

@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import net.lensfrex.dscape.dao.entity.UserBasic;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.function.Function;
/**
* @description user_basic服务层
* @author lensfrex

@ -0,0 +1,72 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.lensfrex.dscape.dao.entity.ComputeHistory;
import net.lensfrex.dscape.dao.mapper.ComputeHistoryMapper;
import net.lensfrex.dscape.dao.service.ComputeHistoryService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class ComputeHistoryServiceImpl extends ServiceImpl<ComputeHistoryMapper, ComputeHistory> implements ComputeHistoryService {
@Override
public long count(SFunction<ComputeHistory, ?> indexColum, Object index) {
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>();
wrapper.lambda()
.eq(indexColum, index);
return this.count(wrapper);
}
@Override
public List<ComputeHistory> getHistory(String uid, int page, int limit) {
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>();
wrapper.lambda()
.eq(ComputeHistory::getUid, uid);
return this.page(new Page<>(page, limit), wrapper).getRecords();
}
@Override
public List<Long> getHistoryIds(String uid, int page, int limit) {
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>();
wrapper.lambda()
.select(ComputeHistory::getRid)
.eq(ComputeHistory::getUid, uid);
List<ComputeHistory> results = this.page(new Page<>(page, limit), wrapper).getRecords();
List<Long> ids = new ArrayList<>(results.size());
results.forEach(result -> ids.add(result.getRid()));
return ids;
}
@Override
public boolean remove(Long id) {
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>();
wrapper.lambda()
.eq(ComputeHistory::getRid, id);
return this.remove(wrapper);
}
@Override
public String getHistoryUser(Long rid) {
QueryWrapper<ComputeHistory> wrapper = new QueryWrapper<>();
wrapper.lambda()
.select(ComputeHistory::getUid)
.eq(ComputeHistory::getRid, rid);
return this.getOne(wrapper).getUid();
}
}

@ -0,0 +1,36 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dao.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.lensfrex.dscape.dao.entity.PatientData;
import net.lensfrex.dscape.dao.mapper.PatientDataMapper;
import net.lensfrex.dscape.dao.service.PatientDataService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class PatientDataServiceImpl extends ServiceImpl<PatientDataMapper, PatientData> implements PatientDataService {
@Override
public List<PatientData> getData(List<Long> ids) {
QueryWrapper<PatientData> wrapper = new QueryWrapper<>();
wrapper.lambda()
.in(PatientData::getId, ids)
.orderByDesc(PatientData::getId);
return this.list(wrapper);
}
@Override
public PatientData getData(Long id) {
QueryWrapper<PatientData> wrapper = new QueryWrapper<>();
wrapper.lambda()
.eq(PatientData::getId, id);
return this.getOne(wrapper);
}
}

@ -1,36 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.admin;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class CreateUserResponse {
@Expose
private long role;
@Expose
private String uid;
public long getRole() {
return role;
}
public void setRole(long role) {
this.role = role;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}

@ -1,62 +0,0 @@
package net.lensfrex.dscape.dto.response.data.admin;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class UserRegisterApplicationResponseData {
@Expose
private long id;
@Expose
private String ip;
@Expose
private String name;
@Expose
private String time;
@Expose
private String uid;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}

@ -1,87 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.compute;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class ComputeHistoryReponseData {
@Expose
private long cpg;
@Expose
private long ctdna;
@Expose
private Boolean hcc;
@SerializedName("hcc_infer")
private Boolean hccInfer;
@Expose
private long id;
@Expose
private long pid;
@Expose
private String time;
public long getCpg() {
return cpg;
}
public void setCpg(long cpg) {
this.cpg = cpg;
}
public long getCtdna() {
return ctdna;
}
public void setCtdna(long ctdna) {
this.ctdna = ctdna;
}
public Boolean getHcc() {
return hcc;
}
public void setHcc(Boolean hcc) {
this.hcc = hcc;
}
public Boolean getHccInfer() {
return hccInfer;
}
public void setHccInfer(Boolean hccInfer) {
this.hccInfer = hccInfer;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getPid() {
return pid;
}
public void setPid(long pid) {
this.pid = pid;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}

@ -0,0 +1,26 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.compute;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class ComputeHistoryResponseData {
private long cpg;
private long ctdna;
private Boolean hcc;
@JsonProperty("hcc_infer")
private Boolean hccInfer;
private long id;
private long pid;
private String time;
}

@ -1,36 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.compute;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class ComputeStatusQueryResponse {
@Expose
private String id;
@Expose
private int status;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}

@ -1,26 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.compute;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class ComputeTaskResponseData {
@Expose
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}

@ -1,66 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.user;
import javax.annotation.Generated;
import com.google.gson.annotations.SerializedName;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class LoginResponseData {
@SerializedName("access_token")
private String mAccessToken;
@SerializedName("expired")
private long mExpired;
@SerializedName("refresh_token")
private String mRefreshToken;
@SerializedName("role")
private long mRole;
@SerializedName("uid")
private String mUid;
public String getAccessToken() {
return mAccessToken;
}
public void setAccessToken(String accessToken) {
mAccessToken = accessToken;
}
public long getExpired() {
return mExpired;
}
public void setExpired(long expired) {
mExpired = expired;
}
public String getRefreshToken() {
return mRefreshToken;
}
public void setRefreshToken(String refreshToken) {
mRefreshToken = refreshToken;
}
public long getRole() {
return mRole;
}
public void setRole(long role) {
mRole = role;
}
public String getUid() {
return mUid;
}
public void setUid(String uid) {
mUid = uid;
}
}

@ -1,4 +1,8 @@
package net.lensfrex.dscape.dto.response.user;
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.user;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@ -1,26 +0,0 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.dto.response.data.user;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class RegisterResponseData {
@Expose
private String uid;
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}

@ -9,6 +9,7 @@ public enum ResponseCode {
INVALID_REQUEST(30000, "非法请求"),
PARAM_WRONG(30001, "参数错误"),
PERMISSION_DENIED(40000, "权限不足"),
NEED_LOGIN(40001, "需要登录"),
TOKEN_EXPIRED(40001, "token过期"),
TOKEN_INVALID(40002, "token无效"),
SERVER_INTERNAL_ERROR(50000, "服务器内部错误"),

@ -154,6 +154,6 @@ public class GlobalExceptionHandler {
*/
@ExceptionHandler(NotLoginException.class)
public Response<Object> handler(NotLoginException e) {
return Response.error(ResponseCode.PERMISSION_DENIED);
return Response.error(ResponseCode.NEED_LOGIN);
}
}

@ -4,24 +4,72 @@
package net.lensfrex.dscape.web.controllers.history;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil;
import net.lensfrex.dscape.dao.entity.PatientData;
import net.lensfrex.dscape.dto.response.data.compute.ComputeHistoryResponseData;
import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.exception.GlobalException;
import net.lensfrex.dscape.web.service.data.HistoryService;
import org.springframework.web.bind.annotation.*;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@SaCheckLogin
@RestController
@RequestMapping("/history")
public class HistoryController {
private final HistoryService historyService;
public HistoryController(HistoryService historyService) {
this.historyService = historyService;
}
@GetMapping(value = "/list", produces = "application/json")
public Response<List<ComputeHistoryResponseData>> list(@RequestParam(required = false, defaultValue = "1") int page,
@RequestParam(required = false, defaultValue = "10") int limit) {
String uid = StpUtil.getLoginIdAsString();
List<PatientData> results = historyService.getUserHistoryData(uid, page, limit);
List<ComputeHistoryResponseData> responseDataList = new ArrayList<>(results.size());
results.forEach(result -> {
ComputeHistoryResponseData response = new ComputeHistoryResponseData();
response.setId(result.getId());
response.setPid(result.getPid());
response.setCpg(result.getCpg());
response.setHcc(result.getIsHcc() == 1);
response.setHccInfer(result.getIsInferHcc() == 1);
response.setCtdna(result.getCtdnaLength());
response.setTime(result.getCreateTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
responseDataList.add(response);
});
@GetMapping(value = "/list/{uid}", produces = "application/json")
public Response<Object> list(@PathVariable String uid,
@RequestParam int offset, @RequestParam int limit, @RequestParam int page,
@RequestHeader String token) {
return Response.error(ResponseCode.API_NOT_IMPLEMENT);
return Response.success(responseDataList);
}
@RequestMapping(value = "/delete/{rid}", method = {RequestMethod.DELETE, RequestMethod.GET}, produces = "application/json")
public Response delete(@PathVariable int rid,
@RequestHeader String token) {
return Response.error(ResponseCode.API_NOT_IMPLEMENT);
public Response<Object> delete(@PathVariable long rid) {
String historyUser = historyService.getHistoryUser(rid);
if (!StpUtil.getLoginIdAsString().equals(historyUser)) {
throw new GlobalException(ResponseCode.PERMISSION_DENIED);
}
historyService.deleteHistoryData(rid);
return Response.success();
}
@RequestMapping(value = "/count", method = {RequestMethod.DELETE, RequestMethod.GET}, produces = "application/json")
public Response<Long> count() {
long result = historyService.getTotalCount(StpUtil.getLoginIdAsString());
return Response.success(result);
}
}

@ -13,16 +13,14 @@ import net.lensfrex.dscape.dto.request.user.PasswordModifyRequestBody;
import net.lensfrex.dscape.dto.request.user.RegisterRequestBody;
import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.dto.response.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.exception.GlobalException;
import net.lensfrex.dscape.utils.NetworkUtil;
import net.lensfrex.dscape.utils.validate.TextCheckUtil;
import net.lensfrex.dscape.web.service.user.UserService;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import java.net.http.HttpClient;
@JsonSerialize(using = ToStringSerializer.class)
@RestController

@ -4,13 +4,13 @@
package net.lensfrex.dscape.web.controllers.user.admin;
import cn.dev33.satoken.annotation.SaCheckRole;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.dto.request.user.UserAddRequest;
import net.lensfrex.dscape.dto.response.general.Response;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.dto.response.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.enums.user.UserRoleEnum;
import net.lensfrex.dscape.exception.GlobalException;
import net.lensfrex.dscape.utils.NetworkUtil;
@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Slf4j
@SaCheckLogin
@RestController
@RequestMapping("/user/admin")
public class AdminController {

@ -0,0 +1,51 @@
/*
* Class created by lensfrex.
*/
package net.lensfrex.dscape.web.service.data;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.dao.entity.ComputeHistory;
import net.lensfrex.dscape.dao.entity.PatientData;
import net.lensfrex.dscape.dao.service.ComputeHistoryService;
import net.lensfrex.dscape.dao.service.PatientDataService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
public class HistoryService {
private final ComputeHistoryService computeHistoryService;
private final PatientDataService patientDataService;
public HistoryService(ComputeHistoryService computeHistoryService,
PatientDataService patientDataService) {
this.computeHistoryService = computeHistoryService;
this.patientDataService = patientDataService;
}
public long getTotalCount(String uid) {
return computeHistoryService.count(ComputeHistory::getUid, uid);
}
public List<Long> getUserHistoryId(String uid, int page, int limit) {
return computeHistoryService.getHistoryIds(uid, page, limit);
}
public List<PatientData> getUserHistoryData(String uid, int page, int limit) {
return patientDataService.getData(getUserHistoryId(uid, page, limit));
}
public String getHistoryUser(Long rid) {
return computeHistoryService.getHistoryUser(rid);
}
public void deleteHistoryData(Long rid) {
computeHistoryService.remove(rid);
}
}

@ -9,7 +9,6 @@
package net.lensfrex.dscape.web.service.user;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import net.lensfrex.dscape.cache.InviteCodeService;
import net.lensfrex.dscape.cache.UserBasicCache;
@ -19,11 +18,10 @@ import net.lensfrex.dscape.dao.service.BlackListService;
import net.lensfrex.dscape.dao.service.UserBasicService;
import net.lensfrex.dscape.dto.request.user.UserAddRequest;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.dto.response.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.enums.user.BlackListTypeEnum;
import net.lensfrex.dscape.enums.user.UserRoleEnum;
import net.lensfrex.dscape.exception.GlobalException;
import net.lensfrex.dscape.web.service.user.UserService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -99,7 +97,7 @@ public class AdminService {
String uid = userService.addUserToDatabase(requestBody.getUserName(), requestBody.getPassword(),
StpUtil.getLoginIdAsString(), UserRoleEnum.getTypeEnumByCode(requestBody.getRole()), registerIp);
RegisterResponseBody registerResponseBody = new RegisterResponseBody();
RegisterResponseBody registerResponseBody = new RegisterResponseBody ();
registerResponseBody.setUid(uid);
return registerResponseBody;

@ -6,13 +6,9 @@ package net.lensfrex.dscape.web.service.user;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import lombok.extern.slf4j.Slf4j;
import net.lensfrex.dscape.cache.InviteCodeService;
import net.lensfrex.dscape.cache.UserBasicCache;
import net.lensfrex.dscape.configure.GlobalConstant;
import net.lensfrex.dscape.dao.entity.UserBasic;
import net.lensfrex.dscape.dao.entity.UserRole;
import net.lensfrex.dscape.dao.service.UserBasicService;
@ -20,13 +16,12 @@ import net.lensfrex.dscape.dao.service.UserRoleService;
import net.lensfrex.dscape.dto.request.UserLoginRequestBody;
import net.lensfrex.dscape.dto.request.user.RegisterRequestBody;
import net.lensfrex.dscape.dto.response.general.ResponseCode;
import net.lensfrex.dscape.dto.response.user.RegisterResponseBody;
import net.lensfrex.dscape.dto.response.data.user.RegisterResponseBody;
import net.lensfrex.dscape.enums.user.UserRoleEnum;
import net.lensfrex.dscape.enums.user.UserStatusEnum;
import net.lensfrex.dscape.exception.GlobalException;
import org.mindrot.jbcrypt.BCrypt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -197,5 +192,7 @@ public class UserService {
userBasicService.modify(UserBasic::getUid, uid,
UserBasic::getPassword, newHashedPassword);
userBasicCache.clear(uid);
}
}
Loading…
Cancel
Save