package com.ruoyi.basic.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.CustomerPrivatePoolDto; import com.ruoyi.basic.service.CustomerPrivatePoolService; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.framework.web.domain.R; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; /** *

* 前端控制器 客户(私海) *

* * @author 芯导软件(江苏)有限公司 * @since 2026-04-16 04:43:00 */ @RestController @Tag(name = "客户(私海)") @RequestMapping("/customerPrivatePool") @AllArgsConstructor public class CustomerPrivatePoolController { private final CustomerPrivatePoolService customerPrivatePoolService; @GetMapping("/listPage") @Operation(summary = "客户(私海)列表") public R listPage(CustomerPrivatePoolDto customerPrivatePoolDto, Page page){ //查询当前用户的客户信息 customerPrivatePoolDto.setBoundId(SecurityUtils.getUserId()); IPage listPage = customerPrivatePoolService.listPage(page, customerPrivatePoolDto); return R.ok(listPage); } @PostMapping("/add") @Operation(summary = "分配客户(私海)") public R add(@RequestBody CustomerPrivatePoolDto customerPrivatePool){ boolean result = customerPrivatePoolService.add(customerPrivatePool); return R.ok(result); } @PutMapping("/update") public R update(@RequestBody CustomerPrivatePoolDto customerPrivatePoolDto) { return R.ok(customerPrivatePoolService.updateCustomerPrivatePoolDto(customerPrivatePoolDto)); } @DeleteMapping("/delete/{id}") @Operation(summary = "删除客户(私海)") public R delete(@PathVariable Long id){ boolean result = customerPrivatePoolService.deleteCustomerPrivatePool(id); return R.ok(result); } @PostMapping("/together") @Operation(summary = "共享") public R together( @RequestBody CustomerPrivatePoolDto customerPrivatePool){ boolean result = customerPrivatePoolService.together(customerPrivatePool); return R.ok(result); } @GetMapping("/info/{id}") @Operation(summary = "详情") public R getInfo(@PathVariable Long id){ CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getInfo(id); return R.ok(customerPrivatePool); } @GetMapping("/getbyId/{id}") @Operation(summary = "详情") public R getbyId(@PathVariable Long id){ CustomerPrivatePoolDto customerPrivatePool = customerPrivatePoolService.getbyId(id); return R.ok(customerPrivatePool); } }