商品模块代码提交
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.product.dto.ConsGroupDTO;
|
||||
import com.czg.product.service.ConsGroupService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 耗材分组
|
||||
*
|
||||
* @author Tankaikai tankaikai@aliyun.com
|
||||
* @since 1.0 2025-02-20
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/product/cons-group")
|
||||
public class ConsGroupController {
|
||||
private final ConsGroupService consGroupService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
@OperationLog("耗材分组-分页")
|
||||
//@SaAdminCheckPermission("consGroup:page")
|
||||
public CzgResult<Page<ConsGroupDTO>> getConsGroupPage(ConsGroupDTO param) {
|
||||
Page<ConsGroupDTO> data = consGroupService.getConsGroupPage(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping("list")
|
||||
@OperationLog("耗材分组-列表")
|
||||
//@SaAdminCheckPermission("consGroup:list")
|
||||
public CzgResult<List<ConsGroupDTO>> getConsGroupList(ConsGroupDTO param) {
|
||||
List<ConsGroupDTO> data = consGroupService.getConsGroupList(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param id 分组id
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@OperationLog("耗材分组-详情")
|
||||
//@SaAdminCheckPermission("consGroup:info")
|
||||
public CzgResult<ConsGroupDTO> getConsGroupById(@PathVariable("id") Long id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
ConsGroupDTO data = consGroupService.getConsGroupById(id);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("耗材分组-新增")
|
||||
//@SaAdminCheckPermission("consGroup:add")
|
||||
public CzgResult<Void> addConsGroup(@RequestBody @Validated({InsertGroup.class, DefaultGroup.class}) ConsGroupDTO dto) {
|
||||
consGroupService.addConsGroup(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("耗材分组-修改")
|
||||
//@SaAdminCheckPermission("consGroup:update")
|
||||
public CzgResult<Void> updateConsGroup(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) ConsGroupDTO dto) {
|
||||
consGroupService.updateConsGroup(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用
|
||||
*
|
||||
* @param id 分组id
|
||||
*/
|
||||
@PostMapping("disable/{id}")
|
||||
@OperationLog("耗材分组-禁用")
|
||||
//@SaAdminCheckPermission("consGroup:able")
|
||||
public CzgResult<Void> disableConsGroup(@PathVariable("id") Long id) {
|
||||
//效验数据
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
consGroupService.disableConsGroup(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*
|
||||
* @param id 分组id
|
||||
*/
|
||||
@PostMapping("enable/{id}")
|
||||
@OperationLog("耗材分组-启用")
|
||||
//@SaAdminCheckPermission("consGroup:able")
|
||||
public CzgResult<Void> enableConsGroup(@PathVariable("id") Long id) {
|
||||
//效验数据
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
consGroupService.enableConsGroup(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,6 @@ public class ShopVendorController {
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id 供应商id
|
||||
*/
|
||||
@DeleteMapping("{id}")
|
||||
|
||||
Reference in New Issue
Block a user