用户模块接口优化
This commit is contained in:
parent
7f1aa34efd
commit
99312a646f
@ -64,14 +64,7 @@ public class AppUserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/save")
|
|
||||||
@RequiresPermissions("admin:user:save")
|
|
||||||
@ApiOperation("用户保存")
|
|
||||||
public R save(@RequestBody AppUserEntity user){
|
|
||||||
appUserService.save(user);
|
|
||||||
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
|
@ -97,6 +97,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void ban(Integer id) {
|
public void ban(Integer id) {
|
||||||
Integer status = this.lambdaQuery().eq(AppUserEntity::getUid, id).one().getStatus();
|
Integer status = this.lambdaQuery().eq(AppUserEntity::getUid, id).one().getStatus();
|
||||||
if (status.equals(Constant.USER_BANNER)) {
|
if (status.equals(Constant.USER_BANNER)) {
|
||||||
@ -104,6 +105,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
}
|
}
|
||||||
this.lambdaUpdate()
|
this.lambdaUpdate()
|
||||||
.set(AppUserEntity::getStatus, 1)
|
.set(AppUserEntity::getStatus, 1)
|
||||||
|
.set(AppUserEntity::getUpdateTime,new Date())
|
||||||
.eq(AppUserEntity::getUid, id)
|
.eq(AppUserEntity::getUid, id)
|
||||||
.update();
|
.update();
|
||||||
}
|
}
|
||||||
@ -117,6 +119,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
}
|
}
|
||||||
boolean update = this.lambdaUpdate()
|
boolean update = this.lambdaUpdate()
|
||||||
.set(AppUserEntity::getStatus, 0)
|
.set(AppUserEntity::getStatus, 0)
|
||||||
|
.set(AppUserEntity::getUpdateTime,new Date())
|
||||||
.eq(AppUserEntity::getUid, id)
|
.eq(AppUserEntity::getUid, id)
|
||||||
.update();
|
.update();
|
||||||
if(!update){
|
if(!update){
|
||||||
|
Loading…
Reference in New Issue
Block a user