2025-08-01 15:10:15 +08:00
|
|
|
package vvpkassistant.User.controller;
|
2025-08-04 21:58:55 +08:00
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
2025-08-01 13:59:30 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import vvpkassistant.CoinRecords.CoinRecords;
|
|
|
|
|
import vvpkassistant.CoinRecords.CoinRecordsDao;
|
|
|
|
|
import vvpkassistant.Data.ResponseData;
|
|
|
|
|
import vvpkassistant.Data.ResponseInfo;
|
|
|
|
|
import vvpkassistant.Data.WxChatParam;
|
2025-08-01 15:10:15 +08:00
|
|
|
import vvpkassistant.User.mapper.UserDao;
|
2025-08-04 21:58:55 +08:00
|
|
|
import vvpkassistant.User.model.DTO.UserModelDTO;
|
2025-08-01 15:10:15 +08:00
|
|
|
import vvpkassistant.User.model.UserModel;
|
2025-08-04 21:58:55 +08:00
|
|
|
import vvpkassistant.User.model.UserModelVO;
|
|
|
|
|
import vvpkassistant.User.service.UserService;
|
2025-08-01 21:55:48 +08:00
|
|
|
import vvpkassistant.common.ErrorCode;
|
2025-08-01 15:10:15 +08:00
|
|
|
import vvpkassistant.config.FunctionConfigHolder;
|
2025-08-01 13:59:30 +08:00
|
|
|
import vvpkassistant.Tools.VVRequester;
|
|
|
|
|
import vvpkassistant.Tools.VVTools;
|
2025-08-01 21:55:48 +08:00
|
|
|
import vvpkassistant.exception.BusinessException;
|
2025-08-04 21:58:55 +08:00
|
|
|
import vvpkassistant.mail.model.MailModel;
|
|
|
|
|
import vvpkassistant.mail.service.MailService;
|
2025-08-01 15:10:15 +08:00
|
|
|
import vvpkassistant.pk.mapper.PkInfoDao;
|
|
|
|
|
import vvpkassistant.pk.model.PkInfoModel;
|
|
|
|
|
import vvpkassistant.pk.model.PkRecordDetail;
|
|
|
|
|
import vvpkassistant.pk.mapper.PkRecordDetailDao;
|
2025-08-04 21:58:55 +08:00
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
2025-08-01 13:59:30 +08:00
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("user")
|
|
|
|
|
public class UserController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserDao userDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private PkInfoDao pkInfoDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private PkRecordDetailDao detailDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private CoinRecordsDao coinRecordsDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxChatParam wxChatParam;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private VVRequester vvRequester;
|
|
|
|
|
|
2025-08-04 21:58:55 +08:00
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private UserService userService;
|
|
|
|
|
|
2025-08-05 15:16:03 +08:00
|
|
|
@Resource
|
|
|
|
|
private MailService mailService;
|
|
|
|
|
|
2025-08-01 13:59:30 +08:00
|
|
|
// 配置用户信息
|
|
|
|
|
@PostMapping("inputUserInfo")
|
|
|
|
|
public ResponseData<Object> inputUserInfo(@RequestBody Map<String,Object> param) {
|
|
|
|
|
|
|
|
|
|
if (!param.containsKey("code")) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.PARAMS_ERROR,"code不能为空");
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!param.containsKey("id")) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.PARAMS_ERROR,"id不能为空");
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取前端传递过来的code
|
|
|
|
|
String code = param.get("code").toString();
|
|
|
|
|
|
|
|
|
|
// 调用微信获取openid接口
|
|
|
|
|
Map<String, Object> wx_result = vvRequester.loginApp(code);
|
|
|
|
|
|
|
|
|
|
// 错误处理
|
|
|
|
|
if (wx_result.containsKey("errcode")) {
|
|
|
|
|
Integer errcode = Integer.valueOf(wx_result.get("errcode").toString());
|
|
|
|
|
|
|
|
|
|
if (errcode == 45011) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.WX_API_CALL_TOO_FREQUENT);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (errcode == 40029) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.WX_INVALID_JSCODE);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (errcode == 40226) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.WX_RISK_ACCOUNT);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (errcode == -1) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.WX_SYSTEM_BUSY);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!wx_result.containsKey("openid")) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.WX_GET_USER_INFO_FAILED);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询用户
|
|
|
|
|
String openId = wx_result.get("openid").toString();
|
|
|
|
|
String sessionKey = wx_result.get("session_key").toString();
|
|
|
|
|
|
|
|
|
|
// 创建一个临时model
|
|
|
|
|
UserModel tempModel = new UserModel();
|
|
|
|
|
tempModel.setId(Integer.valueOf(param.get("id").toString()));
|
|
|
|
|
tempModel.setOpenid(openId);
|
|
|
|
|
tempModel.setHeaderIcon(param.get("headerIcon").toString());
|
|
|
|
|
tempModel.setNickName(param.get("nickName").toString());
|
|
|
|
|
tempModel.setSessionKey(sessionKey);
|
|
|
|
|
tempModel.setUserChatId(openId);
|
|
|
|
|
int i = userDao.updateById(tempModel);
|
|
|
|
|
if (i == 1) {
|
|
|
|
|
// String usersig = param.get("usersig").toString();
|
|
|
|
|
// // 注册聊天账号
|
|
|
|
|
// Integer createAccountResult = vvRequester.createChatAccount(tempModel, usersig);
|
|
|
|
|
// if (createAccountResult != 0) {
|
|
|
|
|
// return ResponseData.error(ResponseInfo.ERROR,"创建聊天账号失败,请稍后再试");
|
|
|
|
|
// }
|
|
|
|
|
Map<String,Object> result = new HashMap<>();
|
|
|
|
|
result.put("info", tempModel);
|
|
|
|
|
result.put("newAccount",false);
|
|
|
|
|
//否则直接返回用户
|
|
|
|
|
return ResponseData.success(result);
|
|
|
|
|
}
|
2025-08-04 13:49:12 +08:00
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 手机号登录 / 注册
|
|
|
|
|
@PostMapping("loginWithPhoneNumber")
|
|
|
|
|
public ResponseData<Object> loginWithPhoneNumber(@RequestBody Map<String,Object> param) {
|
|
|
|
|
|
|
|
|
|
if (!param.containsKey("code")) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.PARAMS_ERROR,"code不能为空");
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String code = param.get("code").toString();
|
|
|
|
|
String phoneNumber = vvRequester.queryPhoneNumber(code);
|
|
|
|
|
if (phoneNumber.isEmpty()) {
|
2025-08-01 21:55:48 +08:00
|
|
|
throw new BusinessException(ErrorCode.PARAMS_ERROR,"手机号码无法查询");
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询是否存在用户。如果用户存在直接返回 如果用户不存在则新建用户
|
|
|
|
|
UserModel model = userDao.queryWithPhoneNumber(phoneNumber);
|
|
|
|
|
Map<String,Object> result = new HashMap<>();
|
|
|
|
|
if (model != null) { // 老用户
|
|
|
|
|
result.put("info",model);
|
|
|
|
|
result.put("newAccount", false);
|
|
|
|
|
result.put("chatInfo",wxChatParam);
|
|
|
|
|
return ResponseData.success(result);
|
|
|
|
|
}else{ // 新用户
|
|
|
|
|
UserModel tempModel = new UserModel();
|
|
|
|
|
tempModel.setPhoneNumber(phoneNumber);
|
|
|
|
|
tempModel.setCreateTime(VVTools.currentTimeStamp());
|
|
|
|
|
//设置状态为正常
|
|
|
|
|
tempModel.setStatus(0);
|
|
|
|
|
//设置积分为0
|
|
|
|
|
tempModel.setPoints(0);
|
|
|
|
|
userDao.insert(tempModel);
|
|
|
|
|
|
|
|
|
|
// 判断用户是否为邀请用户
|
|
|
|
|
if (param.containsKey("inviterId")) {
|
|
|
|
|
int inviterId = (int) param.get("inviterId");
|
|
|
|
|
// 查询用户增加积分
|
|
|
|
|
UserModel oldUser = userDao.selectById(inviterId);
|
|
|
|
|
oldUser.setPoints(oldUser.getPoints() + 10);
|
|
|
|
|
userDao.updateById(oldUser);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put("info",tempModel);
|
|
|
|
|
result.put("newAccount",true);
|
|
|
|
|
result.put("chatInfo",wxChatParam);
|
|
|
|
|
return ResponseData.success(result);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-01 21:55:48 +08:00
|
|
|
|
2025-08-01 13:59:30 +08:00
|
|
|
// 修改用户信息
|
|
|
|
|
@PostMapping("updateUserInfo")
|
2025-08-04 21:58:55 +08:00
|
|
|
public ResponseData<Object> updateUserInfo(@RequestBody UserModelDTO userModelDTO) {
|
|
|
|
|
UserModelVO userModelVO = userService.updateUserInfo( userModelDTO);
|
|
|
|
|
return ResponseData.success(userModelVO);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取用户信息
|
|
|
|
|
@PostMapping("getUserInfo")
|
|
|
|
|
public ResponseData<Object> getUserInfo(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
UserModel userModel = userDao.selectById(map.get("id"));
|
|
|
|
|
return ResponseData.success(userModel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询用户所有pk数据
|
|
|
|
|
@PostMapping("queryMyAllPkData")
|
|
|
|
|
public ResponseData<Object> queryMyAllPkData(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
Integer userId = map.get("userId");
|
|
|
|
|
Integer page = map.get("page");
|
|
|
|
|
Integer size = map.get("size");
|
|
|
|
|
List<PkInfoModel> pkInfoModels = pkInfoDao.queryAllPkData(userId, page * size, size);
|
|
|
|
|
long currentTimeStamp = VVTools.currentTimeStamp();
|
|
|
|
|
// 查找置顶的数据
|
|
|
|
|
for (PkInfoModel pkInfoModel : pkInfoModels) {
|
|
|
|
|
pkInfoModel.setIsPin(pkInfoModel.getPinExpireTime() > currentTimeStamp);
|
|
|
|
|
}
|
|
|
|
|
return ResponseData.success(pkInfoModels);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询我的pk记录 列表
|
|
|
|
|
@PostMapping("handlePkInfo")
|
|
|
|
|
public ResponseData<Object> handlePkInfo(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
Integer type = map.get("type");
|
|
|
|
|
Integer id = map.get("userId");
|
|
|
|
|
Integer page = map.get("page");
|
|
|
|
|
Integer size = map.get("size");
|
|
|
|
|
|
|
|
|
|
// 我发起的pk数据
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
return ResponseData.success(userDao.findCreatedPk(id, page * size, size));
|
|
|
|
|
}else if (type == 2){
|
|
|
|
|
// 别人邀请我的pk数据
|
|
|
|
|
return ResponseData.success(userDao.getMyGuestPkList(id, page * size, size));
|
|
|
|
|
}
|
2025-08-04 13:34:37 +08:00
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查詢单条pk记录详情
|
|
|
|
|
@PostMapping("pkRecordDetail")
|
|
|
|
|
public ResponseData<Object> pkRecordDetail(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
Integer id = map.get("id");
|
|
|
|
|
List<PkRecordDetail> pkRecordDetails = detailDao.queryDetail(id);
|
|
|
|
|
return ResponseData.success(pkRecordDetails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 签到
|
|
|
|
|
@PostMapping("signIn")
|
|
|
|
|
public ResponseData<Object> signIn(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
Integer userId = map.get("userId");
|
|
|
|
|
int i = userDao.checkSignStatus(userId);
|
|
|
|
|
if (i != 0) {
|
2025-08-04 13:34:37 +08:00
|
|
|
throw new BusinessException(ErrorCode.SIGN_IN_FAIL);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int result = userDao.signIn(userId);
|
|
|
|
|
UserModel userModel = userDao.selectById(userId);
|
|
|
|
|
int count = Integer.parseInt(FunctionConfigHolder.getValue("签到增加积分"));
|
|
|
|
|
|
|
|
|
|
// 增加积分
|
|
|
|
|
userModel.setPoints(userModel.getPoints() + count);
|
|
|
|
|
|
|
|
|
|
// 入库
|
|
|
|
|
userDao.updateById(userModel);
|
|
|
|
|
|
|
|
|
|
if (result == 1) {
|
|
|
|
|
// 增加记录
|
|
|
|
|
CoinRecords coinRecords = new CoinRecords("签到增加积分",userId,count, (int) VVTools.currentTimeStamp(),1);
|
|
|
|
|
coinRecordsDao.insert(coinRecords);
|
|
|
|
|
return ResponseData.success(null);
|
|
|
|
|
}else {
|
2025-08-04 13:34:37 +08:00
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR,"签到失败");
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询用户当天签到状态
|
|
|
|
|
@GetMapping("checkSignStatus")
|
|
|
|
|
public ResponseData<Object> checkSignStatus(Integer userId) {
|
|
|
|
|
int i = userDao.checkSignStatus(userId);
|
|
|
|
|
return i == 0 ? ResponseData.success(true) : ResponseData.success(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 置顶文章
|
|
|
|
|
@PostMapping("pinToTop")
|
|
|
|
|
public ResponseData<Object> pinToTop(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
// 文章id
|
|
|
|
|
Integer articleId = map.get("articleId");
|
|
|
|
|
PkInfoModel pkInfoModel = pkInfoDao.selectById(articleId);
|
|
|
|
|
Integer userId = pkInfoModel.getSenderId();
|
|
|
|
|
// 到期时间戳
|
|
|
|
|
Integer pinExpireTime = map.get("pinExpireTime");
|
|
|
|
|
|
|
|
|
|
long currentTimeStamp = VVTools.currentTimeStamp();
|
|
|
|
|
long hour = VVTools.calculateHoursRound(pinExpireTime, currentTimeStamp);
|
|
|
|
|
String coin = FunctionConfigHolder.getValue("置顶扣除积分");
|
|
|
|
|
int totalCoin = (int) (Integer.parseInt(coin) * hour);
|
|
|
|
|
|
|
|
|
|
UserModel userModel = userDao.selectById(userId);
|
|
|
|
|
if (userModel != null) {
|
|
|
|
|
// 扣除积分 更新数据
|
|
|
|
|
Integer points = userModel.getPoints();
|
|
|
|
|
if (points - totalCoin > 0) {
|
|
|
|
|
userModel.setPoints(userModel.getPoints() - totalCoin);
|
|
|
|
|
userDao.updateById(userModel);
|
|
|
|
|
// 设置置顶到期时间
|
|
|
|
|
pkInfoModel.setPinExpireTime(pinExpireTime);
|
|
|
|
|
// 设置创建置顶的时间
|
|
|
|
|
pkInfoModel.setPinCreateTime((int) VVTools.currentTimeStamp());
|
|
|
|
|
// 更新pk文章数据
|
|
|
|
|
int i = pkInfoDao.updateById(pkInfoModel);
|
|
|
|
|
if (i == 1) {
|
|
|
|
|
String info = String.format("置顶成功,扣除%d积分",totalCoin);
|
|
|
|
|
// 增加积分变动记录
|
|
|
|
|
CoinRecords coinRecords = new CoinRecords("置顶扣除积分",userId,totalCoin, (int) VVTools.currentTimeStamp(),0);
|
|
|
|
|
coinRecordsDao.insert(coinRecords);
|
|
|
|
|
// 返回给前端数据
|
|
|
|
|
return ResponseData.success(info);
|
|
|
|
|
}else {
|
2025-08-04 13:34:37 +08:00
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
}else {
|
2025-08-04 13:34:37 +08:00
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR,String.format("积分不足,需要%d积分",totalCoin));
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
}else {
|
2025-08-04 13:34:37 +08:00
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR,"用户不存在");
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 取消置顶
|
|
|
|
|
@PostMapping("cancelPin")
|
|
|
|
|
public ResponseData<Object> cancelPin(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
Integer articleId = map.get("articleId");
|
|
|
|
|
PkInfoModel pkInfoModel = pkInfoDao.selectById(articleId);
|
|
|
|
|
Integer pinExpireTime = pkInfoModel.getPinExpireTime();
|
|
|
|
|
long hour = VVTools.calculateHoursFloor(pinExpireTime, VVTools.currentTimeStamp());
|
|
|
|
|
|
|
|
|
|
String coin = FunctionConfigHolder.getValue("置顶扣除积分");
|
|
|
|
|
// 计算总积分。用于返还给用户
|
|
|
|
|
int totalCoin = (int) (Integer.parseInt(coin) * hour);
|
|
|
|
|
|
|
|
|
|
// 获取用户对象
|
|
|
|
|
UserModel userModel = userDao.selectById(pkInfoModel.getSenderId());
|
|
|
|
|
Integer points = userModel.getPoints();
|
|
|
|
|
// 返还用户积分
|
|
|
|
|
userModel.setPoints(points + totalCoin);
|
|
|
|
|
// 更新数据库
|
|
|
|
|
userDao.updateById(userModel);
|
|
|
|
|
|
|
|
|
|
// 重置置顶时间
|
|
|
|
|
pkInfoModel.setPinExpireTime(0);
|
|
|
|
|
pkInfoModel.setPinCreateTime(0);
|
|
|
|
|
int i = pkInfoDao.updateById(pkInfoModel);
|
|
|
|
|
if (i == 1) {
|
|
|
|
|
// 添加积分更变相关记录
|
|
|
|
|
CoinRecords coinRecords = new CoinRecords("取消置顶返还积分",pkInfoModel.getSenderId(),totalCoin, (int) VVTools.currentTimeStamp(),1);
|
|
|
|
|
coinRecordsDao.insert(coinRecords);
|
|
|
|
|
return ResponseData.success(String.format("操作成功,返还%d积分",totalCoin));
|
|
|
|
|
}else {
|
2025-08-01 21:15:16 +08:00
|
|
|
return ResponseData.error(ResponseInfo.ERROR.getCode(),null);
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取积分明细
|
|
|
|
|
@PostMapping("pointsDetail")
|
|
|
|
|
public ResponseData<Object> pointsDetail(@RequestBody Map<String,Integer> map) {
|
|
|
|
|
Integer userId = map.get("userId");
|
|
|
|
|
Integer page = map.get("page");
|
|
|
|
|
Integer size = map.get("size");
|
|
|
|
|
List<CoinRecords> coinRecords = coinRecordsDao.fetchMyPointsData(userId, page * size, size);
|
|
|
|
|
return ResponseData.success(coinRecords);
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-04 21:58:55 +08:00
|
|
|
@PostMapping("/loginWithMail")
|
|
|
|
|
public ResponseData<Object> loginWithMail(@RequestBody UserModelDTO model) {
|
|
|
|
|
return ResponseData.success(userService.loginWithMail(model));
|
|
|
|
|
}
|
2025-08-01 13:59:30 +08:00
|
|
|
|
2025-08-04 21:58:55 +08:00
|
|
|
@PostMapping("/registerWithMail")
|
|
|
|
|
public ResponseData<Object> mailRegister(@RequestBody UserModelDTO model){
|
|
|
|
|
return ResponseData.success(userService.addUserWithMail(model));
|
|
|
|
|
}
|
2025-08-05 15:16:03 +08:00
|
|
|
|
2025-08-05 15:39:38 +08:00
|
|
|
@GetMapping("/activateAccount")
|
|
|
|
|
public ResponseData<Object> activateAccount(@RequestParam("token") String token){
|
2025-08-05 15:16:03 +08:00
|
|
|
return ResponseData.success(userService.activateAccount(token));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/resendMail")
|
|
|
|
|
public ResponseData<Object> resendMail(@RequestBody UserModelDTO userModelDTO){
|
|
|
|
|
return ResponseData.success(mailService.resendMail(userModelDTO));
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-05 15:39:38 +08:00
|
|
|
@GetMapping("/verificationMail")
|
|
|
|
|
public ResponseData<Object> verificationMail(@RequestParam("token") String token){
|
|
|
|
|
return ResponseData.success(userService.verificationMail(token));
|
|
|
|
|
}
|
2025-08-01 13:59:30 +08:00
|
|
|
}
|