wuyouming666
2024-07-17 fdd8b5a108ce6adef15d88a9c4c520205ed84c94
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java
@@ -1,5 +1,6 @@
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;
@@ -38,9 +39,9 @@
    @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
    @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
    @PostMapping("/findList")
    public ResponseEntity<List<RawUsage>> findList(@RequestBody RawUsage params) {
    public Result findList(@RequestBody RawUsage params) {
        List<RawUsage> result = rawUsageService.findList(params);
        return ResponseEntity.ok(result);
        return Result.success(result);
    }
    /**
@@ -52,9 +53,9 @@
    @ApiOperation(value = "查询", notes = "查询详情")
    @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
    @GetMapping("/{id}")
    public ResponseEntity<RawUsage> findById(@PathVariable("id") Long id) {
        RawUsage rawUsage = rawUsageService.findById(id);
        return ResponseEntity.ok(rawUsage);
    public Result findById(@PathVariable("id") Long id) {
        RawUsage rawUsage = rawUsageService.getById(id);
        return Result.success(rawUsage);
    }
    /**
@@ -66,9 +67,9 @@
    @ApiOperation(value = "新增", notes = "新增数据")
    @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
    @PostMapping
    public ResponseEntity<Boolean> insert( @RequestBody RawUsage rawUsage) {
        boolean result = rawUsageService.insert(rawUsage);
        return ResponseEntity.ok(result);
    public Result insert( @RequestBody RawUsage rawUsage) {
        boolean result = rawUsageService.save(rawUsage);
        return Result.success(result);
    }
    /**
@@ -80,9 +81,9 @@
    @ApiOperation(value = "修改", notes = "修改数据")
    @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
    @PutMapping
    public ResponseEntity<Boolean> update( @RequestBody RawUsage rawUsage) {
        boolean result = rawUsageService.update(rawUsage);
        return ResponseEntity.ok(result);
    public Result update( @RequestBody RawUsage rawUsage) {
        boolean result = rawUsageService.updateById(rawUsage);
        return Result.success(result);
    }
    /**
@@ -93,9 +94,9 @@
     */
    @ApiOperation(value = "删除", notes = "删除数据")
    @DeleteMapping("/{id}")
    public ResponseEntity<Integer> delete(@PathVariable("id") Long id) {
        int result = rawUsageService.delete(id);
        return ResponseEntity.ok(result);
    public Result delete(@PathVariable("id") Long id) {
        int result = rawUsageService.getBaseMapper().deleteById(id);
        return Result.success(result);
    }
}