|
@@ -0,0 +1,67 @@
|
|
|
+package com.aizuda.boot.modules.test.controller;
|
|
|
+
|
|
|
+import com.aizuda.core.api.ApiController;
|
|
|
+import com.aizuda.core.api.PageParam;
|
|
|
+import com.aizuda.core.validation.Create;
|
|
|
+import com.aizuda.core.validation.Update;
|
|
|
+import com.aizuda.boot.modules.test.entity.TestPurchaseOrder;
|
|
|
+import com.aizuda.boot.modules.test.service.ITestPurchaseOrderService;
|
|
|
+import com.baomidou.kisso.annotation.Permission;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 测试采购单 前端控制器
|
|
|
+ *
|
|
|
+ * @author hubin
|
|
|
+ * @since 2024-06-10
|
|
|
+ */
|
|
|
+@Tag(name = "测试采购单")
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/v1/purchase-order")
|
|
|
+public class TestPurchaseOrderController extends ApiController {
|
|
|
+ private ITestPurchaseOrderService testPurchaseOrderService;
|
|
|
+
|
|
|
+ @Operation(summary = "分页列表")
|
|
|
+ @Permission("sys:testPurchaseOrder:page")
|
|
|
+ @PostMapping("/page")
|
|
|
+ public Page<TestPurchaseOrder> getPage(@RequestBody PageParam<TestPurchaseOrder> dto) {
|
|
|
+ return testPurchaseOrderService.page(dto.page(), dto.getData());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "查询 id 信息")
|
|
|
+ @Permission("sys:testPurchaseOrder:get")
|
|
|
+ @GetMapping("/get")
|
|
|
+ public TestPurchaseOrder get(@RequestParam Long id) {
|
|
|
+ return testPurchaseOrderService.getById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "根据 id 修改信息")
|
|
|
+ @Permission("sys:testPurchaseOrder:update")
|
|
|
+ @PostMapping("/update")
|
|
|
+ public boolean update(@Validated(Update.class) @RequestBody TestPurchaseOrder testPurchaseOrder) {
|
|
|
+ return testPurchaseOrderService.updateById(testPurchaseOrder);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "创建添加")
|
|
|
+ @Permission("sys:testPurchaseOrder:create")
|
|
|
+ @PostMapping("/create")
|
|
|
+ public boolean create(@Validated(Create.class) @RequestBody TestPurchaseOrder testPurchaseOrder) {
|
|
|
+ return testPurchaseOrderService.save(testPurchaseOrder);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "根据 ids 删除")
|
|
|
+ @Permission("sys:testPurchaseOrder:delete")
|
|
|
+ @PostMapping("/delete")
|
|
|
+ public boolean delete(@NotEmpty @RequestBody List<Long> ids) {
|
|
|
+ return testPurchaseOrderService.removeByIds(ids);
|
|
|
+ }
|
|
|
+}
|