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
package com.dy.pmsWechat.product;
 
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 产品管理
 */
@Slf4j
@RestController
@RequestMapping(path = "product")
@SuppressWarnings("unchecked")
public class ProductCtrl {
 
 
    private ProductSv proSv;
    @Autowired
    public void setProSv(ProductSv proSv){
        this.proSv = proSv;
    }
 
    /**
     * 根据ID查询产品信息
     * @return
     */
    @GetMapping(path="one")
    @Log("根据ID查询产品信息")
    public BaseResponse<PltProduct> one(String id){
        PltProduct pro=proSv.selectById(id);
 
        return BaseResponseUtils.buildSuccess(pro);
    }
 
    /**
     * 查询产品信息
     * @param vo
     * @return
     */
    @PostMapping(path="some")
    @Log("分页查询产品信息")
    public BaseResponse<QueryResultVo<List<PltProduct>>> some(@RequestBody QueryVo vo){
        QueryResultVo<List<PltProduct>> list = proSv.selectSome(vo);
        return BaseResponseUtils.buildSuccess(list);
    }
}