blue
2 years ago
committed by
Gitee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with
7 additions and
7 deletions
-
im-platform/src/main/java/com/bx/implatform/controller/LoginController.java
-
im-platform/src/main/java/com/bx/implatform/service/impl/FriendServiceImpl.java
-
im-platform/src/main/java/com/bx/implatform/service/impl/GroupServiceImpl.java
|
|
|
@ -22,8 +22,8 @@ public class LoginController { |
|
|
|
private final IUserService userService; |
|
|
|
|
|
|
|
@PostMapping("/login") |
|
|
|
@ApiOperation(value = "用户注册", notes = "用户注册") |
|
|
|
public Result register(@Valid @RequestBody LoginDTO dto) { |
|
|
|
@ApiOperation(value = "用户登陆", notes = "用户登陆") |
|
|
|
public Result login(@Valid @RequestBody LoginDTO dto) { |
|
|
|
LoginVO vo = userService.login(dto); |
|
|
|
return ResultUtils.success(vo); |
|
|
|
} |
|
|
|
@ -46,7 +46,7 @@ public class LoginController { |
|
|
|
|
|
|
|
@PutMapping("/modifyPwd") |
|
|
|
@ApiOperation(value = "修改密码", notes = "修改用户密码") |
|
|
|
public Result update(@Valid @RequestBody ModifyPwdDTO dto) { |
|
|
|
public Result modifyPassword(@Valid @RequestBody ModifyPwdDTO dto) { |
|
|
|
userService.modifyPassword(dto); |
|
|
|
return ResultUtils.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ public class FriendServiceImpl extends ServiceImpl<FriendMapper, Friend> impleme |
|
|
|
@Override |
|
|
|
public void addFriend(Long friendId) { |
|
|
|
long userId = SessionContext.getSession().getUserId(); |
|
|
|
if (userId == friendId) { |
|
|
|
if (friendId.equals(userId)) { |
|
|
|
throw new GlobalException(ResultCode.PROGRAM_ERROR, "不允许添加自己为好友"); |
|
|
|
} |
|
|
|
// 互相绑定好友关系
|
|
|
|
|
|
|
|
@ -75,7 +75,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
@CacheEvict(value = "#vo.getId()") |
|
|
|
@CacheEvict(key = "#vo.getId()") |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public GroupVO modifyGroup(GroupVO vo) { |
|
|
|
@ -100,7 +100,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@CacheEvict(value = "#groupId") |
|
|
|
@CacheEvict(key = "#groupId") |
|
|
|
@Override |
|
|
|
public void deleteGroup(Long groupId) { |
|
|
|
UserSession session = SessionContext.getSession(); |
|
|
|
@ -178,7 +178,7 @@ public class GroupServiceImpl extends ServiceImpl<GroupMapper, Group> implements |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
@Cacheable(value = "#groupId") |
|
|
|
@Cacheable(key = "#groupId") |
|
|
|
@Override |
|
|
|
public Group getById(Long groupId) { |
|
|
|
Group group = super.getById(groupId); |
|
|
|
|