前端和json优化

This commit is contained in:
2025-11-28 17:16:17 +08:00
parent 34e69c7f62
commit dfb11c85f1
135 changed files with 930 additions and 633 deletions

View File

@@ -64,7 +64,7 @@ public class UserCollectionController {
resultDomain.fail("请先登录");
return resultDomain;
}
return userCollectionService.isCollected(user.getID(), collectionType, collectionID);
return userCollectionService.isCollected(user.getId(), collectionType, collectionID);
}
/**

View File

@@ -42,7 +42,7 @@ public class UserProfileController {
@GetMapping("/info")
public ResultDomain<UserVO> getUserProfile(@HttpLogin LoginDomain loginDomain) {
// TODO: 实现获取个人信息
ResultDomain<UserVO> result = userService.getUserInfoTotal(loginDomain.getUser().getID());
ResultDomain<UserVO> result = userService.getUserInfoTotal(loginDomain.getUser().getId());
if (result.isSuccess()) {
return result;
} else {
@@ -60,7 +60,7 @@ public class UserProfileController {
ResultDomain<UserVO> result = new ResultDomain<>();
// 更新tb_sys_user
TbSysUser user = new TbSysUser();
user.setID(userVO.getUserID());
user.setId(userVO.getUserID());
user.setUsername(userVO.getUsername());
user.setEmail(userVO.getEmail());
user.setPhone(userVO.getPhone());
@@ -97,7 +97,7 @@ public class UserProfileController {
ResultDomain<String> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("用户上传头像: userId={}, fileName={}", userId, file.getOriginalFilename());
// 上传文件到文件服务
@@ -149,7 +149,7 @@ public class UserProfileController {
ResultDomain<String> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("用户更新头像URL: userId={}, avatarUrl={}", userId, avatarUrl);
// 更新用户信息中的头像
@@ -187,7 +187,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
String oldPassword = (String) params.get("oldPassword");
String newPassword = (String) params.get("newPassword");
@@ -238,7 +238,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
String phone = (String) params.get("phone");
String verifyCode = (String) params.get("verifyCode");
@@ -250,7 +250,7 @@ public class UserProfileController {
logger.info("用户绑定手机号: userId={}, phone={}", userId, phone);
TbSysUser user = new TbSysUser();
user.setID(userId);
user.setId(userId);
user.setPhone(phone);
ResultDomain<TbSysUser> bindResult = userService.updateUser(user);
@@ -278,7 +278,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
String email = (String) params.get("email");
String verifyCode = (String) params.get("verifyCode");
@@ -290,7 +290,7 @@ public class UserProfileController {
logger.info("用户绑定邮箱: userId={}, email={}", userId, email);
TbSysUser user = new TbSysUser();
user.setID(userId);
user.setId(userId);
user.setEmail(email);
ResultDomain<TbSysUser> bindResult = userService.updateUser(user);
@@ -316,7 +316,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("用户解绑手机号: userId={}", userId);
// TODO: 验证用户身份
@@ -340,7 +340,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("用户解绑邮箱: userId={}", userId);
// TODO: 验证用户身份
@@ -366,7 +366,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
String reason = (String) params.get("reason");
logger.info("用户申请账号注销: userId={}, reason={}", userId, reason);
@@ -392,7 +392,7 @@ public class UserProfileController {
ResultDomain<Map<String, Object>> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("获取账号安全信息: userId={}", userId);
// TODO: 获取用户的手机号、邮箱绑定状态
@@ -419,7 +419,7 @@ public class UserProfileController {
ResultDomain<Boolean> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
String verifyType = (String) params.get("verifyType"); // password, phone, email
String verifyCode = (String) params.get("verifyCode");
@@ -448,7 +448,7 @@ public class UserProfileController {
ResultDomain<Map<String, Object>> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("获取学习记录统计: userId={}", userId);
// TODO: 获取用户学习记录统计数据
@@ -475,7 +475,7 @@ public class UserProfileController {
ResultDomain<Map<String, Object>> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("按时间筛选学习记录: userId={}, timeRange={}", userId, timeRange);
// TODO: 根据时间范围筛选学习记录(周/月/年)
@@ -499,7 +499,7 @@ public class UserProfileController {
ResultDomain<Map<String, Object>> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("获取学习时长图表数据: userId={}", userId);
// TODO: 获取每日学习时长数据
@@ -523,7 +523,7 @@ public class UserProfileController {
ResultDomain<Map<String, Object>> resultDomain = new ResultDomain<>();
try {
String userId = loginDomain.getUser().getID();
String userId = loginDomain.getUser().getId();
logger.info("获取资源学习次数图表数据: userId={}", userId);
// TODO: 获取各资源的学习次数

View File

@@ -45,7 +45,7 @@ public class UCUserCollectionServiceImpl implements UCUserCollectionService {
if (user == null) {
throw new RuntimeException("请先登录");
}
userCollection.setUserID(user.getID());
userCollection.setUserID(user.getId());
userCollection.setCreateTime(new Date());
int result = userCollectionMapper.insertUserCollection(userCollection);
if (result > 0) {
@@ -113,7 +113,7 @@ public class UCUserCollectionServiceImpl implements UCUserCollectionService {
if (user == null) {
throw new RuntimeException("请先登录");
}
userCollection.setUserID(user.getID());
userCollection.setUserID(user.getId());
userCollection.setCollectionValue(-1);
int result = userCollectionMapper.deleteUserCollection(userCollection);