zj
2024-06-03 81a29edf665881828e4ca1f0e444bfcbc6ab6f24
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.nq.controller;
 
import java.util.List;
 
import com.nq.common.BaseController;
import com.nq.common.page.TableDataInfo;
import com.nq.pojo.StockPre;
import com.nq.service.IStockPreService;
import com.nq.vo.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 盘前交易Controller
 *
 * @author xt
 * @date 2024-03-18
 */
@RestController
@RequestMapping("/stock/pre")
public class StockPreController extends BaseController
{
    @Autowired
    private IStockPreService stockPreService;
 
    /**
     * 查询盘前交易列表
     */
    @GetMapping("/list")
    public TableDataInfo list(StockPre stockPre)
    {
        startPage();
        List<StockPre> list = stockPreService.selectStockPreList(stockPre);
        return getDataTable(list);
    }
 
    /**
     * 获取盘前交易详细信息
     */
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(stockPreService.selectStockPreById(id));
    }
 
    /**
     * 新增盘前交易
     */
    @PostMapping
    public AjaxResult add(@RequestBody StockPre stockPre)
    {
        return toAjax(stockPreService.insertStockPre(stockPre));
    }
 
    /**
     * 修改盘前交易
     */
    @PostMapping("/editStockPre")
    public AjaxResult edit(StockPre stockPre)
    {
        return toAjax(stockPreService.updateStockPre(stockPre));
    }
 
  /*  *//**
     * 删除盘前交易
     *//*
    @GetMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(stockPreService.deleteStockPreByIds(ids));
    }
*/
    /**
     * 删除盘前交易
     */
    @GetMapping("/{id}")
    public AjaxResult remove(@PathVariable("id") Long id)
    {
        return toAjax(stockPreService.deleteStockPreById(id));
    }
}