账号禁用启用接口优化
This commit is contained in:
parent
b7c5049584
commit
482ba33dc2
@ -341,23 +341,27 @@ public class StaffController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号信息禁用
|
||||
* 账号信息禁用/启用
|
||||
*
|
||||
* @param staffId
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@GetMapping("staffInfoDisable/{staffId}")
|
||||
public JsonResult<?> staffInfoDisable(@PathVariable("staffId") Long staffId) {
|
||||
|
||||
@GetMapping("staffInfoDisable/{staffId}/{state}")
|
||||
public JsonResult<?> staffInfoDisable(@PathVariable("staffId") Long staffId,
|
||||
@PathVariable("state") String state) {
|
||||
String msg = "禁用";
|
||||
if ("1".equals(state)) {
|
||||
msg = "启用";
|
||||
}
|
||||
try {
|
||||
Staff staff = staffService.getById(staffId);
|
||||
staff.setState("0");
|
||||
staff.setState(state);
|
||||
staffService.updateById(staff);
|
||||
return JsonResult.success("禁用成功!");
|
||||
return JsonResult.success(msg + "成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return JsonResult.failed("禁用失败!");
|
||||
return JsonResult.failed(msg + "失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user