User/delete (#74)

* feat: add delete user api

* feat:update frontend resources
This commit is contained in:
vran
2022-04-09 19:14:00 +08:00
committed by GitHub
parent 401f61b45c
commit a880778f6e
77 changed files with 295 additions and 115 deletions

View File

@@ -42,6 +42,7 @@ public enum DomainErrors implements DatabasirErrors {
CIRCLE_REFERENCE("A_10027", "检查到循环引用"),
DUPLICATE_COLUMN("A_10028", "重复的列"),
INVALID_MOCK_DATA_SCRIPT("A_10029", "不合法的表达式"),
CANNOT_DELETE_SELF("A_10030", "无法对自己执行删除账号操作"),
;
private final String errCode;

View File

@@ -176,4 +176,12 @@ public class UserService {
userPojo.setNickname(request.getNickname());
userDao.updateById(userPojo);
}
@Transactional
public void deleteOne(Integer userId) {
if (userDao.existsById(userId)) {
userDao.deleteById(userId);
loginDao.deleteByUserId(userId);
}
}
}