feat():钢种返回格式

This commit is contained in:
Allenxy
2024-10-10 14:46:24 +08:00
parent 217d1ae9d3
commit 9f45fefdbd

View File

@@ -2,6 +2,7 @@ package com.fizz.business.controller;
import com.fizz.business.domain.SteelGradeInfo;
import com.fizz.business.service.SteelGradeInfoService;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,25 +21,25 @@ public class SteelGradeInfoController {
@GetMapping("/list")
@ApiOperation("查询钢种列表")
public List<SteelGradeInfo> list() {
return steelGradeInfoService.list();
public R<List<SteelGradeInfo>> list() {
return R.ok(steelGradeInfoService.list());
}
@PostMapping("/add")
@ApiOperation("新增")
public boolean add(@RequestBody SteelGradeInfo steelGradeInfo) {
return steelGradeInfoService.save(steelGradeInfo);
public R<Boolean> add(@RequestBody SteelGradeInfo steelGradeInfo) {
return R.ok(steelGradeInfoService.save(steelGradeInfo));
}
@PutMapping("/update")
@ApiOperation("更新")
public boolean update(@RequestBody SteelGradeInfo steelGradeInfo) {
return steelGradeInfoService.updateById(steelGradeInfo);
public R<Boolean> update(@RequestBody SteelGradeInfo steelGradeInfo) {
return R.ok(steelGradeInfoService.updateById(steelGradeInfo));
}
@ApiOperation("删除")
@DeleteMapping("/delete/{id}")
public boolean delete(@PathVariable Integer id) {
return steelGradeInfoService.removeById(id);
public R<Boolean> delete(@PathVariable Integer id) {
return R.ok(steelGradeInfoService.removeById(id));
}
}