张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
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
package com.thhy.mobile.modules.biz.steelstock.controller;
 
import com.github.pagehelper.PageInfo;
import com.thhy.general.common.BasicResult;
import com.thhy.general.utils.PagingUtils;
import com.thhy.mobile.modules.biz.steelstock.entity.SteelStock;
import com.thhy.mobile.modules.biz.steelstock.entity.SteelStockListVo;
import com.thhy.mobile.modules.biz.steelstock.service.SteelStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import java.util.List;
 
/**
 * @author zhang_xiao_bo
 * @since 2023-05-06 14:00:33
 */
@RestController
@RequestMapping("steelStock")
public class SteelStockController {
 
 
    @Autowired
    private SteelStockService steelStockService;
 
    @RequestMapping("findList")
    public BasicResult findList(@RequestBody(required = false) SteelStock steelStock,HttpServletRequest req){
        PagingUtils.setPageParam(req);
        List<SteelStockListVo> steelStockList = steelStockService.querySteelStock(steelStock);
        PageInfo<SteelStockListVo> pageInfo = new PageInfo<>(steelStockList);
        return BasicResult.success(pageInfo);
    }
 
    @RequestMapping("addSteelStock")
    public BasicResult addSteelStock(@RequestBody SteelStock steelStock){
        steelStockService.addSteelStock(steelStock);
        return BasicResult.success();
    }
 
    /**
    @RequestMapping("update")
    public BasicResult update(@RequestBody SteelStock steelStock){
        steelStockService.update(steelStock);
        return BasicResult.success();
    }**/
 
    @RequestMapping("delete")
    public BasicResult delete(@RequestBody SteelStock steelStock){
        steelStockService.delete(steelStock.getSteelStockId());
        return BasicResult.success();
    }
}