liyong
16 小时以前 d9ee1fb5190f91d79c003193b7f27ff7c5072227
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
package com.ruoyi.production.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.production.dto.ProductStructureDto;
import com.ruoyi.production.pojo.ProductStructure;
import com.ruoyi.production.service.ProductStructureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Arrays;
 
@RequestMapping("productStructure")
@RestController
@Api(tags = "产品结构")
public class ProductStructureController {
    @Autowired
    private ProductStructureService productStructureService;
 
 
    @ApiOperation("根据productId查询")
    @GetMapping("listByproductModelId")
    public R listByproductModelId( Long productModelId){
        return R.ok(productStructureService.listByproductModelId( productModelId));
    }
 
    @ApiOperation("新增产品结构")
    @PostMapping()
    public R add(@RequestBody ProductStructure productStructure){
        return R.ok(productStructureService.save(productStructure));
    }
 
    @ApiOperation("修改产品结构")
    @PutMapping()
    public R update(@RequestBody ProductStructure productStructure){
        return R.ok(productStructureService.updateById(productStructure));
    }
 
    @ApiOperation("删除产品结构")
    @DeleteMapping("/{ids}")
    public R delete(@PathVariable("ids") Long[] ids){
        return R.ok(productStructureService.removeBatchByIds(Arrays.asList(ids)));
    }
}