| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/update") |
| | | public ResponseVO<Object> updateClient(@RequestBody Long id,@RequestBody ClientPrarm clientPrarm){ |
| | | @PostMapping("/update/{id}") |
| | | public ResponseVO<Object> updateClient(@PathVariable Long id,@RequestBody ClientPrarm clientPrarm){ |
| | | boolean b = clientService.updateClient(id,clientPrarm); |
| | | if(b){ |
| | | return ResponseUtil.success("更新成功"); |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/delete") |
| | | public ResponseVO<Object> deleteClient(@RequestBody Long id){ |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteClient(@PathVariable Long id){ |
| | | boolean b = clientService.deleteClient(id); |
| | | if(b){ |
| | | return ResponseUtil.success("删除成功"); |
| | |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listClient(){ |
| | | Integer administratorIdentity = SecurityUtils.getAdministratorIdentity(); |
| | | Integer administratorIdentity = SecurityUtils.getAdministratorIdentity();//0 为管理员 |
| | | if(administratorIdentity==0){//判断 如果是管理员 就判断下CustomerInspectContextHolder.getCustomerId() 有没有值 |
| | | Long customerId = CustomerInspectContextHolder.getCustomerId(); |
| | | if(customerId!=null){ |
| | | return ResponseUtil.success(clientService.list()); |
| | | } |
| | | return ResponseUtil.success(clientService.list()); |
| | | }else { |
| | | return ResponseUtil.success(clientService.clientList(SecurityUtils.getUserId())); |