|
@@ -14,6 +14,8 @@ import lombok.RequiredArgsConstructor;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @author 李仁杰
|
|
* @author 李仁杰
|
|
* @date 2023-2-24
|
|
* @date 2023-2-24
|
|
@@ -25,37 +27,54 @@ import org.springframework.web.bind.annotation.*;
|
|
@RequestMapping(Constants.PERMISSION_API + "/client")
|
|
@RequestMapping(Constants.PERMISSION_API + "/client")
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
public class ClientController {
|
|
public class ClientController {
|
|
- public final ClientService clientService;
|
|
|
|
|
|
+ public final ClientService clientService;
|
|
|
|
+
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
@Operation(summary = "添加客户")
|
|
@Operation(summary = "添加客户")
|
|
public String addClient(@RequestBody Client client) {
|
|
public String addClient(@RequestBody Client client) {
|
|
- return clientService.add(client);
|
|
|
|
|
|
+ return clientService.add(client);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/queryPageList")
|
|
@PostMapping("/queryPageList")
|
|
- @Operation(summary = "查询客户")
|
|
|
|
|
|
+ @Operation(summary = "查询客户")
|
|
public String getPageList(@RequestBody ClientDTO clientDTO) {
|
|
public String getPageList(@RequestBody ClientDTO clientDTO) {
|
|
- return Response.success( clientService.getPageList(clientDTO));
|
|
|
|
|
|
+ return Response.success(clientService.getPageList(clientDTO));
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping("/getNoTenantClients")
|
|
@GetMapping("/getNoTenantClients")
|
|
@Operation(summary = "查询没有租户的客户")
|
|
@Operation(summary = "查询没有租户的客户")
|
|
- public String getNoTenantClients() {
|
|
|
|
- return Response.success( clientService.getNoTenantClients());
|
|
|
|
|
|
+ public String getNoTenantClients() {
|
|
|
|
+ return Response.success(clientService.getNoTenantClients());
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping("/delete")
|
|
@GetMapping("/delete")
|
|
@Operation(summary = "删除客户")
|
|
@Operation(summary = "删除客户")
|
|
public String delete(Integer id) {
|
|
public String delete(Integer id) {
|
|
return clientService.delete(id);
|
|
return clientService.delete(id);
|
|
}
|
|
}
|
|
|
|
+
|
|
@PostMapping("edit")
|
|
@PostMapping("edit")
|
|
@Operation(summary = "编辑委托方")
|
|
@Operation(summary = "编辑委托方")
|
|
public String edit(@RequestBody Client client) {
|
|
public String edit(@RequestBody Client client) {
|
|
return clientService.edit(client);
|
|
return clientService.edit(client);
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping("/queryList")
|
|
@GetMapping("/queryList")
|
|
@Operation(summary = "根据租户id查询客户(不分页)")
|
|
@Operation(summary = "根据租户id查询客户(不分页)")
|
|
public String queryList(Integer tenantId) {
|
|
public String queryList(Integer tenantId) {
|
|
|
|
+ return Response.success(clientService.queryList(tenantId));
|
|
|
|
+ }
|
|
|
|
|
|
- return Response.success( clientService.queryList(tenantId));
|
|
|
|
|
|
+ @PostMapping("/getByIds")
|
|
|
|
+ @Operation(summary = "根据客户Id获得客户")
|
|
|
|
+ public List<Client> getByIds(@RequestBody List<Integer> clientIds) {
|
|
|
|
+ return clientService.getByIds(clientIds);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @GetMapping("/getByName")
|
|
|
|
+ @Operation(summary = "根据客户Id获得客户")
|
|
|
|
+ public Client getByName(String name) {
|
|
|
|
+ return clientService.getByName(name);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|