From 68ee8235c8cd659fba5e59e3d924d5ea093504ab Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期四, 18 七月 2024 08:39:57 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 102 insertions(+), 0 deletions(-) diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java new file mode 100644 index 0000000..9f95757 --- /dev/null +++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java @@ -0,0 +1,102 @@ +package com.mes.rawusage.controller; + +import com.mes.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.web.bind.annotation.*; +import com.mes.rawusage.entity.RawUsage; +import com.mes.rawusage.service.RawUsageService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.GetMapping; +import java.util.List; + +/** + * + * + * @author system + * @since 2024-07-09 14:51:27 + */ +@RestController +@RequestMapping("/api/rawUsage") +@Api(tags = " 鎺у埗鍣�") +public class RawUsageController { + + @Autowired + private RawUsageService rawUsageService; + + /** + * 鍒楄〃鏌ヨ + * + * @param params + * @return + */ + @ApiOperation(value = "鍒楄〃鏌ヨ",notes = "鍒楄〃鏌ヨ",produces = "application/json") + @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) + @PostMapping("/findList") + public Result findList(@RequestBody RawUsage params) { + List<RawUsage> result = rawUsageService.findList(params); + return Result.success(result); + } + + /** + * 鏌ヨ + * + * @param id + * @return + */ + @ApiOperation(value = "鏌ヨ", notes = "鏌ヨ璇︽儏") + @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) + @GetMapping("/{id}") + public Result findById(@PathVariable("id") Long id) { + RawUsage rawUsage = rawUsageService.getById(id); + return Result.success(rawUsage); + } + + /** + * 鏂板 + * + * @param rawUsage + * @return + */ + @ApiOperation(value = "鏂板", notes = "鏂板鏁版嵁") + @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) + @PostMapping + public Result insert( @RequestBody RawUsage rawUsage) { + boolean result = rawUsageService.save(rawUsage); + return Result.success(result); + } + + /** + * 淇敼 + * + * @param rawUsage + * @return + */ + @ApiOperation(value = "淇敼", notes = "淇敼鏁版嵁") + @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) + @PutMapping + public Result update( @RequestBody RawUsage rawUsage) { + boolean result = rawUsageService.updateById(rawUsage); + return Result.success(result); + } + + /** + * 鍒犻櫎 + * + * @param id + * @return + */ + @ApiOperation(value = "鍒犻櫎", notes = "鍒犻櫎鏁版嵁") + @DeleteMapping("/{id}") + public Result delete(@PathVariable("id") Long id) { + int result = rawUsageService.getBaseMapper().deleteById(id); + return Result.success(result); + } + +} \ No newline at end of file -- Gitblit v1.8.0