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 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)); } }