From 088ceb9faf6f1d0d9f57bb9cd65f542337d40b7f Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期四, 07 九月 2023 15:30:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java | 71 ++++++++++++++++++++++++++++++++---
1 files changed, 64 insertions(+), 7 deletions(-)
diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
index b56b93d..176ae9b 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
@@ -1,6 +1,7 @@
package com.yuanchu.mom.controller;
+import com.yuanchu.mom.pojo.dto.TechnologyDto;
import com.yuanchu.mom.service.TechnologyService;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
@@ -8,17 +9,13 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-import java.util.Map;
/**
* <p>
- * 鍓嶇鎺у埗鍣�
+ * 鍓嶇鎺у埗鍣�
* </p>
*
* @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
@@ -32,5 +29,65 @@
@Autowired
private TechnologyService technologyService;
+ @ApiOperation("鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎-->閫夋嫨璁惧缁�")
+ @GetMapping("/chooseDevice")
+ public Result<?> chooseDevice() {
+ return Result.success(technologyService.chooseDevice());
+ }
+ @ApiOperation("鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎-->閫夋嫨宸ュ簭")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "specificationsId", value = "鍨嬪彿id", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/chooseFather")
+ public Result<?> chooseFather(Integer specificationsId) {
+ return Result.success(technologyService.chooseFather(specificationsId));
+ }
+
+ @ApiOperation("鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "specificationsId", value = "鍨嬪彿id", dataTypeClass = Integer.class, required = true)
+ })
+ @PostMapping("/add")
+ public Result<?> addTechnology(Integer specificationsId, @Validated @RequestBody TechnologyDto technologyDto) {
+ technologyService.addTechnology(specificationsId, technologyDto);
+ return Result.success("娣诲姞宸ヨ壓銆�" + technologyDto.getName() + "銆戞垚鍔�");
+ }
+
+ @ApiOperation("濉啓鐢熶骇瀹氶,榧犳爣绉诲紑淇濆瓨")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "productionQuota", value = "鐢熶骇瀹氶(涓�/澶�)", dataTypeClass = Integer.class, required = true)
+
+ })
+ @PostMapping("/write")
+ public Result<?> write(Integer id, Integer productionQuota) {
+ Integer write = technologyService.write(id, productionQuota);
+ if (write >= 1) {
+ return Result.success("鏇存柊鎴愬姛");
+ }
+ return Result.fail("鏇存柊澶辫触");
+ }
+
+
+ @ApiOperation(value = "鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class,required = true)
+ })
+ @PostMapping("/delTechById")
+ public Result delTechById(Integer id) {
+ technologyService.delTechById(id);
+ return Result.success("鍒犻櫎"+id+"鎴愬姛!");
+ }
+
+ @ApiOperation(value = "鎵归噺鍒犻櫎")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "ids", value = "宸ヨ壓璺嚎id", dataTypeClass = String.class,required = true)
+ })
+ @PostMapping("/delAllTech")
+ public Result delAllTech(String ids) {
+ technologyService.delAllTech(ids);
+ return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+ }
}
+
--
Gitblit v1.9.3