| | |
| | | |
| | | private final ClientService clientService; |
| | | |
| | | @GetMapping("/add") |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addClient(@RequestBody ClientPrarm clientPrarm){ |
| | | boolean b = clientService.addClient(clientPrarm); |
| | | if(b){ |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping ("/update/{id}") |
| | | @PostMapping ("/update/{id}") |
| | | public ResponseVO<Object> updateClient(@PathVariable Long id,@RequestBody ClientPrarm clientPrarm){ |
| | | boolean b = clientService.updateClient(id,clientPrarm); |
| | | if(b){ |
| | |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/delete/{id}") |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteClient(@PathVariable Long id){ |
| | | boolean b = clientService.deleteClient(id); |
| | | if(b){ |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/list") |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listClient(){ |
| | | // 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 { |
| | | |
| | | }*/ |
| | | if(AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | return ResponseUtil.success(clientService.clientList(SecurityUtils.getUserId())); |
| | | // }else if("0".equals(SecurityUtils.getAdministratorIdentity())){ |