mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-08 18:25:17 +08:00
User/delete (#74)
* feat: add delete user api * feat:update frontend resources
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user