1414import com .brotherc .aquant .industry .service .StockIndustryBoardEmQueryService ;
1515import com .brotherc .aquant .industry .service .StockIndustryBoardEmSyncService ;
1616import com .brotherc .aquant .industry .service .StockIndustryBoardHistoryService ;
17+ import com .brotherc .aquant .industry .service .StockIndustryBoardService ;
1718import com .brotherc .aquant .sync .entity .StockSync ;
1819import com .brotherc .aquant .sync .repository .StockSyncRepository ;
1920import lombok .RequiredArgsConstructor ;
21+ import org .springdoc .core .annotations .ParameterObject ;
2022import org .springframework .beans .BeanUtils ;
23+ import org .springframework .data .domain .Page ;
24+ import org .springframework .data .domain .Pageable ;
2125import org .springframework .format .annotation .DateTimeFormat ;
2226import org .springframework .web .bind .annotation .GetMapping ;
2327import org .springframework .web .bind .annotation .RequestMapping ;
@@ -36,6 +40,7 @@ public class IndustrySourceController {
3640 private final StockIndustryBoardAnalysisService analysisService ;
3741 private final StockIndustryBoardEmQueryService emQueryService ;
3842 private final StockIndustryBoardHistoryService historyService ;
43+ private final StockIndustryBoardService boardService ;
3944 private final StockBoardConstituentService constituentService ;
4045 private final StockBoardConstituentEmService emConstituentService ;
4146 private final StockIndustryBoardRepository boardRepository ;
@@ -64,6 +69,19 @@ public ResponseDTO<IndustrySourceSnapshotVO<StockIndustryBoardVO>> overview(
6469 ? thsOverview (industry , tradeDate ) : emQueryService .overview (industry , tradeDate )));
6570 }
6671
72+ @ GetMapping ("/board/page" )
73+ public ResponseDTO <IndustrySourceSnapshotVO <Page <StockIndustryBoardVO >>> boardPage (
74+ @ RequestParam (defaultValue = "THS" ) IndustryDataSource source ,
75+ @ RequestParam (required = false ) String boardName ,
76+ @ ParameterObject Pageable pageable
77+ ) {
78+ StockIndustryBoardPageReqVO reqVO = new StockIndustryBoardPageReqVO (Boolean .FALSE );
79+ reqVO .setBoardName (boardName );
80+ return ResponseDTO .success (resolve (source , current -> current == IndustryDataSource .THS
81+ ? boardService .stockIndustryBoardPage (reqVO , pageable )
82+ : emQueryService .boardPage (boardName , pageable )));
83+ }
84+
6785 @ GetMapping ("/history/kline" )
6886 public ResponseDTO <IndustrySourceSnapshotVO <List <StockIndustryBoardKVO >>> history (
6987 @ RequestParam (defaultValue = "THS" ) IndustryDataSource source ,
@@ -113,7 +131,10 @@ private <T> IndustrySourceSnapshotVO<T> resolve(IndustryDataSource requested, ja
113131 }
114132
115133 private boolean isUnavailable (Object content ) {
116- return content == null || (content instanceof List <?> list && list .isEmpty ());
134+ if (content == null ) return true ;
135+ if (content instanceof List <?> list ) return list .isEmpty ();
136+ if (content instanceof Page <?> page ) return page .isEmpty ();
137+ return false ;
117138 }
118139
119140 private StockIndustryBoardVO thsOverview (String industry , LocalDate tradeDate ) {
0 commit comments