| | |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.dto.request.supplier.*; |
| | | import com.mzl.flower.dto.response.current.CurrentUserDTO; |
| | | import com.mzl.flower.dto.response.payment.DeliveryOrderItemListDTO; |
| | | import com.mzl.flower.dto.response.supplier.SupplierSubVO; |
| | | import com.mzl.flower.entity.supplier.SupplierSub; |
| | | import com.mzl.flower.service.supplier.SupplierSubService; |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/supplierSub") |
| | | @RequestMapping("/api") |
| | | @Api(value = "供应商子账号管理", tags = "供应商子账号管理") |
| | | @Validated |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/addOrUpdate") |
| | | @PostMapping("/supplierSub/addOrUpdate") |
| | | @ApiOperation(value = "供应商子账号信息登记、修改", notes = "供应商信息子账号登记、修改") |
| | | public ResponseEntity<ReturnDataDTO> addOrUpdateSupplier(@Validated @RequestBody SupplierSubDTO dto) { |
| | | supplierSubService.addOrUpdateSupplier(dto); |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/page") |
| | | @GetMapping("/supplierSub/page") |
| | | @ApiOperation(value = "运营端-供应商子账号分页查询", notes = "运营端-供应商子账号分页查询") |
| | | public ResponseEntity<ReturnDataDTO<Page<SupplierSubVO>>> querySupplier(QuerySupplierSubDTO dto, Page page) { |
| | | return returnData(R.SUCCESS.getCode(), supplierSubService.querySupplier(dto, page)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/page/isEnable") |
| | | @GetMapping("/supplierSub/page/isEnable") |
| | | @ApiOperation(value = "子账号启用/禁用", notes = "子账号启用/禁用") |
| | | public ResponseEntity<ReturnDataDTO<String>> isEnable(@NotNull(message = "id不能为空") Long id) { |
| | | supplierSubService.isEnable(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | @PostMapping("/supplierSub/delete/{id}") |
| | | @ApiOperation(value = "子账号删除", notes = "子账号删除") |
| | | public ResponseEntity<ReturnDataDTO> delete(@PathVariable("id") Long id) { |
| | | supplierSubService.delete(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @GetMapping("/sub/all") |
| | | @GetMapping("/supplierSub/sub/all") |
| | | @ApiOperation(value = "获取当前用户下子账号信息", notes = "获取当前用户下子账号信息") |
| | | public ResponseEntity<ReturnDataDTO<List<SupplierSub>>> getSubSupplier() { |
| | | return returnData(R.SUCCESS.getCode(), supplierSubService.getSubSupplier()); |
| | | } |
| | | |
| | | @GetMapping("/getById") |
| | | @GetMapping("/supplierSub/getById") |
| | | @ApiOperation(value = "通过ID查询子账号", notes = "通过ID查询子账号") |
| | | public ResponseEntity<ReturnDataDTO<SupplierSub>> getById(@NotNull(message = "id不能为空") Long id) { |
| | | SupplierSub supplierSub = supplierSubService.getById(id); |
| | | return returnData(R.SUCCESS.getCode(), supplierSub); |
| | | } |
| | | |
| | | @GetMapping("/getSwitchById") |
| | | @GetMapping("/supplierSub/getSwitchById") |
| | | @ApiOperation(value = "子账号切换", notes = "子账号切换") |
| | | public ResponseEntity<ReturnDataDTO<CurrentUserDTO>> getSwitchById(@NotNull(message = "id不能为空") Long id) { |
| | | CurrentUserDTO currentUserDTO = supplierSubService.getSwitchById(id); |
| | | public ResponseEntity<ReturnDataDTO<CurrentUserDTO>> getSwitchById(@NotNull(message = "id不能为空") Long id, Integer type) { |
| | | CurrentUserDTO currentUserDTO = supplierSubService.getSwitchById(id, type); |
| | | return returnData(R.SUCCESS.getCode(), currentUserDTO); |
| | | } |
| | | |
| | | @GetMapping("/supplierAccount/all") |
| | | @ApiOperation(value = "获取当前用户下所有账号信息", notes = "获取当前用户下所有账号信息") |
| | | public ResponseEntity<ReturnDataDTO<List<SupplierSub>>> getSupplierAccount() { |
| | | return returnData(R.SUCCESS.getCode(), supplierSubService.getAllSupplier()); |
| | | } |
| | | } |