You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.3 KiB
76 lines
2.3 KiB
package com.zilber.boot.intelligencesite.controller;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.zilber.boot.intelligencesite.entity.IManpower;
|
|
import com.zilber.boot.intelligencesite.entity.IMaterials;
|
|
import com.zilber.boot.intelligencesite.service.IIManpowerService;
|
|
import com.zilber.boot.intelligencesite.service.IIMaterialsService;
|
|
import com.zilber.boot.utils.AjaxResult;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* <p>
|
|
* 材料信息表 前端控制器
|
|
* </p>
|
|
*
|
|
* @author lsc
|
|
* @since 2025-05-06
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/imaterials")
|
|
@Api(tags = "材料信息")
|
|
public class IMaterialsController {
|
|
|
|
@Resource
|
|
private IIMaterialsService iiMaterialsService;
|
|
|
|
@GetMapping("/list")
|
|
@ApiOperation(value="分页查询",notes="分页查询")
|
|
@ResponseBody
|
|
public AjaxResult queryList(IMaterials iMaterials, @RequestParam(defaultValue = "1") Integer pageNo,
|
|
@RequestParam(defaultValue = "10") Integer pageSize) {
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
List<IMaterials> iMaterials1 = iiMaterialsService.queryList(iMaterials);
|
|
PageInfo<IMaterials> page = new PageInfo<>(iMaterials1);
|
|
return AjaxResult.success(page);
|
|
}
|
|
|
|
/***
|
|
* 查询单个
|
|
*/
|
|
@GetMapping("/getById")
|
|
@ApiOperation("查询单个")
|
|
public AjaxResult getById(Integer id) {
|
|
return AjaxResult.success(iiMaterialsService.getById(id));
|
|
}
|
|
|
|
|
|
@PostMapping("/add")
|
|
@ApiOperation("增加")
|
|
public AjaxResult add(@RequestBody IMaterials iMaterials) {
|
|
return AjaxResult.success(iiMaterialsService.save(iMaterials));
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
@ApiOperation("修改")
|
|
public AjaxResult update(@RequestBody @Validated IMaterials iMaterials) {
|
|
iiMaterialsService.updateById(iMaterials);
|
|
return AjaxResult.success();
|
|
}
|
|
|
|
@DeleteMapping("/delete")
|
|
@ApiOperation("删除")
|
|
public AjaxResult delete(Integer id) {
|
|
return AjaxResult.success(iiMaterialsService.removeById(id));
|
|
}
|
|
|
|
}
|
|
|