From 7f73eadee4c6b73f2c0608254bc9e9b82f023c3d Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 04 Aug 2025 10:31:58 +0800
Subject: [PATCH] 新增分页
---
src/main/java/com/nq/controller/backend/AdminStockAiController.java | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/nq/controller/backend/AdminStockAiController.java b/src/main/java/com/nq/controller/backend/AdminStockAiController.java
index c1cb5bc..da957ff 100644
--- a/src/main/java/com/nq/controller/backend/AdminStockAiController.java
+++ b/src/main/java/com/nq/controller/backend/AdminStockAiController.java
@@ -4,6 +4,8 @@
import com.nq.pojo.StockAI;
import com.nq.pojo.StockAIOrderPosition;
import com.nq.service.IStockAiService;
+ import com.nq.service.IStockService;
+ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@@ -17,6 +19,8 @@
@Autowired
IStockAiService stockAiService;
+ @Autowired
+ IStockService stockService;
/**
* 获取ai交易产品列表
* @return
@@ -90,10 +94,37 @@
if (id == null) {
return ServerResponse.createByErrorMsg("id is null");
}
- if (status.isEmpty()) {
+ if (StringUtils.isBlank(status)) {
return ServerResponse.createByErrorMsg("status is null");
}
return stockAiService.orderOperation(id, status);
}
+
+ /**
+ * 根据条件查询股票
+ * @param pageNum
+ * @param pageSize
+ * @param keyWords code 名称 或 spell
+ * @return
+ */
+ @PostMapping({"getStocksByKeyWords.do"})
+ @ResponseBody
+ public ServerResponse getStocksByKeyWords(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+ @RequestParam(value = "pageSize", defaultValue = "5") int pageSize,
+ @RequestParam(value = "keyWords", required = false) String keyWords) {
+ return stockService.getStocksByKeyWords(pageNum, pageSize, keyWords);
+ }
+
+ //建仓列表页
+ @PostMapping({"getPositionList.do"})
+ @ResponseBody
+ public ServerResponse getPositionList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+ @RequestParam(value = "pageSize", defaultValue = "5") int pageSize,
+ @RequestParam(value = "id", required = false) Integer stockAiOrderId) {
+ if (stockAiOrderId == null) {
+ return ServerResponse.createByErrorMsg("id is null");
+ }
+ return stockAiService.getPositionList(pageNum, pageSize, stockAiOrderId);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3