ZengTao
2025-05-26 fcb8b8cc392b146aa11bbaab9e497f7f13f29d44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.mes.hollow.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mes.hollow.entity.HollowFormulaDetails;
import com.mes.hollow.service.HollowFormulaDetailsService;
import com.mes.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * (HollowFormulaDetails)表控制层
 *
 * @author makejava
 * @since 2024-12-27 13:34:59
 */
@Api(tags = "中空配方详情信息")
@RestController
@RequestMapping("hollowFormulaDetails")
public class HollowFormulaDetailsController {
    /**
     * 服务对象
     */
    @Resource
    private HollowFormulaDetailsService hollowFormulaDetailsService;
 
    @ApiOperation("获取配方信息(分页)")
    @PostMapping("/pageFormulaDetails")
    public Result<Page<HollowFormulaDetails>> pageFormulaDetails(Integer pageNo, Integer pageSize, String keyword) {
        Page<HollowFormulaDetails> page = new Page<>(pageNo, pageSize);
        LambdaQueryWrapper<HollowFormulaDetails> wrapper = new LambdaQueryWrapper<HollowFormulaDetails>().like(StringUtils.isNotBlank(keyword)
                , HollowFormulaDetails::getFormulaName, keyword);
        return Result.success(hollowFormulaDetailsService.page(page, wrapper));
    }
 
    @ApiOperation("获取配方信息(列表)")
    @PostMapping("/listFormulaDetails")
    public Result<List<HollowFormulaDetails>> listFormulaDetails(String keyword) {
        LambdaQueryWrapper<HollowFormulaDetails> wrapper = new LambdaQueryWrapper<HollowFormulaDetails>().like(StringUtils.isNotBlank(keyword)
                , HollowFormulaDetails::getFormulaName, keyword);
        return Result.success(hollowFormulaDetailsService.list(wrapper));
    }
 
    @ApiOperation("通过主键查询单条数据")
    @GetMapping("/getFormulaDetailsById")
    public Result getFormulaDetailsById(Long id) {
        return Result.success(hollowFormulaDetailsService.getById(id));
    }
 
    @ApiOperation("新增数据")
    @PostMapping("/saveFormulaDetails")
    public Result saveFormulaDetails(@RequestBody HollowFormulaDetails hollowFormulaDetails) {
        return Result.success(hollowFormulaDetailsService.save(hollowFormulaDetails));
    }
 
    @ApiOperation("修改数据")
    @PostMapping("updateFormulaDetails")
    public Result updateFormulaDetails(@RequestBody HollowFormulaDetails hollowFormulaDetails) {
        return Result.success(this.hollowFormulaDetailsService.updateById(hollowFormulaDetails));
    }
 
    @ApiOperation("删除数据")
    @PostMapping("deleteFormulaDetails")
    public Result deleteFormulaDetails(@RequestParam("idList") List<Long> idList) {
        return Result.success(this.hollowFormulaDetailsService.removeByIds(idList));
    }
}