Administrator
2026-06-01 65fbbf04892c6864906670033a9bffec1f7911c7
初始化
428 files deleted
13 files added
9 files modified
51660 ■■■■■ changed files
pom.xml 60 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/LoginUserUtils.java 77 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/base/BaseEntity.java 33 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/base/IBaseService.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/bean/LoginUserBean.java 61 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/controller/CommonController.java 110 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/controller/LoginController.java 121 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/dto/Base64UploadDto.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/dto/LoginDto.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/dto/RegisterDto.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/mapper/CandlestickMapper.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/service/CommonService.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/service/UserDetailsServiceImpl.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java 63 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/SwaggerConfig.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java 58 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/security/TokenConfigurer.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/security/TokenFilter.java 123 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/security/UserAuthenticationArgumentResolver.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/configurations/security/WebSecurityConfig.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/controller/BlockController.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/model/EosResult.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/model/XrpTransResult.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/model/XrpTransactions.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/model/XrpTx.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/BchService.java 138 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/BigDecimalUtil.java 190 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/BlockSerive.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/BtcService.java 138 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/DateUtil.java 1369 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/EosService.java 84 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/EthService.java 283 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/HttpUtil.java 281 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java 212 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/LtcService.java 125 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java 160 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtService.java 167 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/blackchain/service/XrpService.java 81 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java 202 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java 171 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountFlowEntityDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/dao/MemberSelectSymbolsDao.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/dao/OrderCoinDealDao.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/dao/OrderCoinsDao.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountFlowEntity.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountMoneyChange.java 58 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/entity/OrderCoinsDealEntity.java 76 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/entity/OrderCoinsEntity.java 84 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/mapper/MemberAccountMoneyChangeMapper.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/mapper/OrderCoinsDealMapper.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/mapper/OrderWalletCoinDealMapper.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/mapper/OrderWalletCoinMapper.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/CancelEntrustWalletCoinOrderDto.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/FindAllWalletCoinOrderDto.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/FindCollectDto.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/InOrderCoinDto.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/RecordsPageDto.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/SubmitSalesWalletCoinOrderDto.java 37 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceDto.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceFromAgentDto.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/AllWalletCoinVo.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/FindCollectListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberAccountMoneyChangeInfoVo.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberAccountMoneyChangeVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberAgentIntoInfoVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberSelectSymbolsVo.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletAgentInfoVo.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinInfoVo.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinVo.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletContractInfoVo.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinDealListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinDealVo.java 82 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinVo.java 76 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/TransactionPageOfWalletCoinVo.java 66 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/BlockCoinService.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/OrderCoinService.java 37 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/BlockCoinServiceImpl.java 431 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java 577 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java 641 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/controller/ContractEntrustOrderController.java 63 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/controller/ContractHoldOrderController.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java 109 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/dao/ContractEntrustOrderDao.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/dao/ContractHoldOrderDao.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/dao/ContractOrderDao.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/entity/ContractEntrustOrderEntity.java 91 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java 154 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java 203 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/mapper/ContractEntrustOrderEntityMapper.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/mapper/ContractHoldOrderEntityMapper.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/mapper/ContractOrderEntityMapper.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/ChangeBondDto.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/ChangeLeverRateDto.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/OrderListDto.java 31 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/ProfitOrLessDto.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/SubmitEntrustDto.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/SubmitOrderDto.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/SymbolDto.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/ContractEntrustVo.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/ContractMoneyInfoVo.java 59 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/HoldOrderDetailVo.java 89 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/HoldOrderListVo.java 92 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/OrderDetailVo.java 119 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/OrderListVo.java 82 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/ContractEntrustOrderService.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/ContractHoldOrderService.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/ContractOrderService.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/RabbitOrderService.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractEntrustOrderServiceImpl.java 210 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java 710 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractOrderServiceImpl.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java 759 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java 153 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/Example.java 97 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java 346 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java 1660 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateKlineWebSocketClient.java 362 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateTradeExecutor.java 395 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateWebSocketClientMain.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GateWebSocketClientManager.java 148 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java 532 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/TraderParam.java 211 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/celue.out patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/gate-api.txt 3067 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/gate-websocket.txt 5011 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md 583 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/AbstractPrivateChannelHandler.java 168 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/GateChannelHandler.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/AutoOrdersChannelHandler.java 108 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/CandlestickChannelHandler.java 135 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/OrdersChannelHandler.java 57 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/PositionClosesChannelHandler.java 76 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/PositionsChannelHandler.java 67 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/UserTradesChannelHandler.java 61 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/controller/MemberQuickBuySaleController.java 128 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/dao/MemberQuickBuySaleDao.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/dto/MemberQuickBuySaleCommitDto.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/dto/MemberQuickBuySaleDto.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/entity/MemberQuickBuySaleEntity.java 86 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/mapper/MemberQuickBuySaleEntityMapper.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/service/MemberQuickBuySaleService.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/service/impl/MemberQuickBuySaleServiceImpl.java 211 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/vo/MemberQuickBuySaleDetailVo.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/home/vo/MemberQuickBuySaleVo.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/controller/MemberController.java 365 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/AgentReturnDao.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/AppVersionDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberAuthenticationDao.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinAddressDao.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinChargeDao.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinWithdrawDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberDao.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberLevelRateDao.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberPaymentMethodDao.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberSettingDao.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractSimulateDao.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/AgentReturnEntity.java 74 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/AppVersionEntity.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberAuthenticationEntity.java 71 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberCoinAddressEntity.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberCoinChargeEntity.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberCoinWithdrawEntity.java 58 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java 167 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberLevelRateEntity.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberPaymentMethodEntity.java 56 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberSelectSymbolsEntity.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberSettingEntity.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java 59 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java 63 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractSimulateEntity.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberAddCoinAddressDto.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberAuthenticationDto.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberBindEmailDto.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberBindPhoneDto.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberDelCoinAddressDto.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberDelPaymethodDto.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberForgetPwdDto.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberPaymethodDto.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberSubmitCoinApplyDto.java 48 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberTradersPwdDto.java 31 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberUpdatePwdDto.java 31 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberUpdateTradePwdDto.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberUpdateTradersPwdTimeDto.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/AppVersionListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/AppVersionVo.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberAuthenticationInfoVo.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberAvivableCoinInfoVo.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressCountListVo.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressCountVo.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressVo.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinInfoListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinInfoVo.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberInfoVo.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberPaymethodDetailListVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberPaymethodDetailVo.java 52 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberPersonCenterInfoVo.java 38 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberSendCodeWayVo.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/parameter/vo/NeedMoneyMemberVo.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/service/MemberService.java 94 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/service/MemberWalletContractService.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java 1006 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberWalletContractServiceImpl.java 33 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/newPrice/OkxNewPriceWebSocketClient.java 321 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/newPrice/OkxWebSocketClient.java 352 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/ExchangeInfoEnum.java 73 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OKX_QUANT_DOCUMENTATION.md 333 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxConfig.java 182 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridElement.java 293 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridTradeService.java 760 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java 282 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxKlineWebSocketClient.java 577 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java 468 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java 517 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxTradeExecutor.java 383 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxTraderParam.java 102 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxWebSocketClientMain.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxWebSocketClientManager.java 209 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/README.md 285 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/celue/CaoZuoService.java 37 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/celue/CaoZuoServiceImpl.java 613 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java 89 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxGridChannelHandler.java 30 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxKlineChannelHandler.java 83 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java 89 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/AdvancedMA.java 129 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/BOLL.java 169 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/FifteenMinuteStrategyExample.java 81 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/FifteenMinuteTradingExample.java 214 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/FifteenMinuteTradingStrategy.java 237 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/IndicatorBase.java 161 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/KDJ.java 145 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/MA.java 232 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/MACD.java 241 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/MACDTest.java 118 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/RSI.java 145 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/TradingStrategy.java 1029 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/EMACalculator.java 107 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/IndicatorUtils.java 154 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDCalculator.java 241 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDResult.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MacdEmaStrategy.java 463 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MacdMaStrategy.java 473 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/PriceData.java 162 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/Volatility.java 159 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/内容 107 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/AbstractTechnicalIndicatorStrategy.java 89 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/ComprehensiveTechnicalStrategy.java 351 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/CoreTechnicalStrategy.java 589 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/CoreTechnicalStrategyUsageGuide.md 198 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/TechnicalIndicatorStrategy.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/TradeSignal.java 54 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/jiaoyi/IMQService.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/jiaoyi/IMQServiceImpl.java 198 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/AccountWs.java 160 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/BalanceAndPositionWs.java 100 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/InstrumentsWs.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/LoginWs.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/OrderInfoWs.java 254 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/PositionsWs.java 141 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java 247 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/enums/CoinEnums.java 80 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/enums/ExchangeInfoEnum.java 73 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/enums/OrderParamEnums.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/param/Kline.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/param/StrategyParam.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/param/TradeRequestParam.java 32 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListEnum.java 70 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListQueue.java 79 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListService.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListServiceImpl.java 175 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/DataUtil.java 54 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/MallUtils.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/Dto/QuantApiMessage.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/Dto/SubmitOrderReqDto.java 165 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/Dto/TradeOrderDto.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ExchangeInfoEnum.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ExchangeLoginEventService.java 199 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ExchangeLoginService.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/RequestHandler.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ResponseHandler.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/impl/ExchangeLoginEventServiceImpl.java 169 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/FebsException.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/ParameterChecker.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/RequestBuilder.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/SSLConfig.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/vo/BalanceVo.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/vo/InstrumentsVo.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/vo/PositionsVo.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/enumerates/TradeTypeEnum.java 58 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/ITradeOrderService.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/TradeOrderFactory.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/impl/OKXTradeOrderServiceImpl.java 130 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/vo/QuantExchangeReturnVo.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/IQueryOrderService.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/QueryOrderFactory.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/dto/QuantOperateRecode.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/impl/OKXQueryOrderServiceImpl.java 156 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/vo/QuantCheckOrderVo.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/vo/QuantOperateRecodeVo.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeEventEnum.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeEventRunner.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeRequest.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeRequestBuy.java 51 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeRequestSell.java 57 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeService.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/impl/TradeServiceBuy.java 38 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/impl/TradeServiceClosePosition.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/impl/TradeServiceSell.java 38 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/vo/SellOrderVo.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/IVerifyAccountService.java 97 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/VerifyAccountFactory.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountBalDto.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountBalanceDto.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountBalanceInfoDto.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountProfitDailyDto.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiMessageDto.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiPositionsInfoDto.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiValidApiMessageDto.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/OperateCurrencyDto.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/OperateCurrencyLeverDto.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/TradeBigdataDto.java 31 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/enums/PublicStatusEnum.java 63 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/impl/OKXVerifyAccountServiceImpl.java 680 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/ApiAccountHoldVo.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/ApiPositionsInfoVo.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/ProductMessVo.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/SinglemarketVo.java 58 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/FebsException.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/FebsResponse.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/SSLConfig.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/SignUtils.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/WsMapBuild.java 65 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/WsParamBuild.java 74 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeEnum.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeQueue.java 79 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeService.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeServiceImpl.java 142 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/zhanghu/ApiMessageServiceImpl.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/zhanghu/IApiMessageService.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/zhanghu/ZhangHuEnum.java 38 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/controller/PlatformController.java 64 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformBannerDao.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformCnyUsdtExchangeDao.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformFeeSettingDao.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformNoticeDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformPaymentMethodDao.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformSymbolsCoinDao.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformSymbolsSkuDao.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/dao/TradeSettingDao.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformBannerEntity.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformCnyUsdtExchangeEntity.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformFeeSettingEntity.java 53 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformLeverageSettingEntity.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformNoticeEntity.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformPaymentMethodEntity.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformSymbolsCoinEntity.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformSymbolsSkuEntity.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformTradeSettingEntity.java 68 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/PlatformBannerService.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/PlatformCnyUsdtExchangeService.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/PlatformNoticeService.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/PlatformPaymentMethodService.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/PlatformSymbolsSkuService.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformBannerServiceImpl.java 30 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformCnyUsdtExchangeServiceImpl.java 38 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformNoticeServiceImpl.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformPaymentMethodServiceImpl.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformSymbolsSkuServiceImpl.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/platform/vo/PlatformCnyUsdtExchangeVo.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java 71 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/dao/PlatformSymbolsContractDao.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/entity/PlatformSymbolsContractEntity.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/parameter/dto/KlineDetailDto.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/parameter/vo/HomeSymbolsVo.java 31 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/parameter/vo/KlineDataVo.java 40 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/service/SymbolsService.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java 185 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/controller/TestUserController.java 102 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/dao/TestUserDao.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/dto/TestUserDto.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/entity/TestUserEntity.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/mapper/TestUserEntityMapper.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/service/TestUserService.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/service/impl/TestUserServiceImpl.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/vo/TestUserVo.java 29 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/test/vo/TestVo.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/ChatServer.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/bean/RequestBean.java 90 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/bean/ResponseBean.java 89 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/common/ChannelManager.java 56 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/common/Contans.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/common/NettyTools.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/dispatch/MsgDispatch.java 46 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/handler/WebSocketServerHandler.java 202 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/initalizer/WebSocketServerInitializer.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/logic/MsgLogic.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/logic/WebSocketLogic.java 41 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/logic/impl/MsgLogicImpl.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/netty/server/WebSocketServer.java 68 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/BlockCoinUpdateJob.java 63 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/DayLineDataUpdateJob.java 52 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/KlineDataUpdateJob.java 153 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/LoopExecutorJob.java 70 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/NewestPriceUpdateJob.java 67 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/UsdtCnyExchangePriceUpdateJob.java 67 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/OperateOrderPriceConsumer.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/TestConsumer.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/WebsocketPriceConsumer.java 148 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java 135 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/AscBigDecimal.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/DescBigDecimal.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/OrderModel.java 83 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/OrderOperatePriceService.java 132 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/PricePriorityQueue.java 300 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java 224 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/producer/OrderProducer.java 141 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/producer/TestProducer.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/CacheSettingUtils.java 82 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/CalculateUtil.java 48 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/CoinTypeConvert.java 59 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/LogRecordUtils.java 39 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/OssUtils.java 33 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java 50 ●●●●● patch | view | raw | blame | history
src/main/resources/application-test.yml 2 ●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/GuijiTest.java 123 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/HuobiTest.java 39 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/KssframeworkApplicationTests.java 90 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/MemberSettingTest.java 51 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/RSATest.java 111 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/RabbitMqTest.java 33 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/RedisTest.java 35 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/ReturnMoneyTest.java 86 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/SmsTest.java 42 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/SymbolsTest.java 142 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/mapper/Car.java 18 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/mapper/CarDto.java 16 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/mapper/CarEntity.java 16 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/mapper/CarMapper.java 46 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/mapper/MapStructMapper.java 102 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/modules/newPrice/OkxWebSocketClientTest.java 14 ●●●●● patch | view | raw | blame | history
pom.xml
@@ -36,14 +36,6 @@
    <dependencies>
        <!-- Source: https://mvnrepository.com/artifact/io.gate/gate-api -->
        <dependency>
            <groupId>io.gate</groupId>
            <artifactId>gate-api</artifactId>
            <version>7.2.71</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ripple</groupId>
            <artifactId>ripple</artifactId>
@@ -61,13 +53,6 @@
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>core</artifactId>
            <version>4.5.5</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <!--            <version>3.6.0</version>-->
@@ -78,19 +63,6 @@
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <version>3.6.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.web3j/parity -->
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>parity</artifactId>
            <version>4.5.10</version>
            <exclusions>
                <exclusion>
                    <artifactId>core</artifactId>
                    <groupId>org.web3j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
@@ -184,18 +156,6 @@
            <version>${mysql-driver.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>core</artifactId>
            <version>4.5.5</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.web3j/parity -->
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>parity</artifactId>
            <version>4.5.10</version>
        </dependency>
        <!-- 参数校验 start -->
        <dependency>
            <groupId>javax.validation</groupId>
@@ -268,31 +228,11 @@
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
            <version>${netty.version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>${okhttp.version}</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun.oss</groupId>
            <artifactId>aliyun-sdk-oss</artifactId>
            <version>${aliyun-oss.version}</version>
        </dependency>
        <dependency>
            <groupId>com.huobi.sdk</groupId>
            <artifactId>huobi-client</artifactId>
            <version>1.0.8-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>${basedir}/lib/huobi-client-1.0.8-SNAPSHOT.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.java-websocket</groupId>
            <artifactId>Java-WebSocket</artifactId>
src/main/java/com/xcong/excoin/common/LoginUserUtils.java
File was deleted
src/main/java/com/xcong/excoin/common/system/base/BaseEntity.java
File was deleted
src/main/java/com/xcong/excoin/common/system/base/IBaseService.java
File was deleted
src/main/java/com/xcong/excoin/common/system/bean/LoginUserBean.java
File was deleted
src/main/java/com/xcong/excoin/common/system/controller/CommonController.java
File was deleted
src/main/java/com/xcong/excoin/common/system/controller/LoginController.java
File was deleted
src/main/java/com/xcong/excoin/common/system/dto/Base64UploadDto.java
File was deleted
src/main/java/com/xcong/excoin/common/system/dto/LoginDto.java
File was deleted
src/main/java/com/xcong/excoin/common/system/dto/RegisterDto.java
File was deleted
src/main/java/com/xcong/excoin/common/system/mapper/CandlestickMapper.java
File was deleted
src/main/java/com/xcong/excoin/common/system/service/CommonService.java
File was deleted
src/main/java/com/xcong/excoin/common/system/service/UserDetailsServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/common/system/service/impl/CommonServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/configurations/SwaggerConfig.java
File was deleted
src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
@@ -1,16 +1,10 @@
package com.xcong.excoin.configurations;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.xcong.excoin.configurations.properties.AliOssProperties;
import com.xcong.excoin.configurations.security.UserAuthenticationArgumentResolver;
import com.xcong.excoin.utils.SpringContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
@@ -30,7 +24,6 @@
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new UserAuthenticationArgumentResolver());
    }
    /**
@@ -46,13 +39,4 @@
                .allowCredentials(true).maxAge(3600);
    }
    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(aliOssProperties.getEndPoint(), aliOssProperties.getAccessKeyId(), aliOssProperties.getAccessKeySecret());
    }
//    @Bean
//    public SpringContextHolder springContextHolder() {
//        return new SpringContextHolder();
//    }
}
src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
@@ -1,9 +1,5 @@
package com.xcong.excoin.configurations.interceptor;
import com.xcong.excoin.common.LoginUserUtils;
import com.xcong.excoin.common.contants.AppContants;
import com.xcong.excoin.common.system.base.BaseEntity;
import com.xcong.excoin.modules.member.entity.MemberEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.MappedStatement;
@@ -34,30 +30,6 @@
            return invocation.proceed();
        }
        if (SqlCommandType.INSERT == sqlCommandType) {
            if (parameter instanceof DefaultSqlSession.StrictMap) {
                Map map = (Map) parameter;
                List list = (List) map.get("list");
                for (Object o : list) {
                    injectForInsert(o);
                }
            } else {
                injectForInsert(parameter);
            }
        }
        if (SqlCommandType.UPDATE == sqlCommandType) {
            if (parameter instanceof DefaultSqlSession.StrictMap) {
                Map map = (Map) parameter;
                List list = (List) map.get("list");
                for (Object o : list) {
                    injectForUpdate(o);
                }
            } else {
                injectForUpdate(parameter);
            }
        }
        return invocation.proceed();
    }
@@ -71,34 +43,4 @@
    }
    public void injectForInsert(Object o) {
        MemberEntity member = LoginUserUtils.getUser();
        if (o instanceof BaseEntity) {
            BaseEntity baseEntity = (BaseEntity) o;
            if (member != null) {
                String by = member.getPhone() != null ? member.getPhone() : member.getEmail();
                baseEntity.setCreateBy(by);
                baseEntity.setUpdateBy(by);
            } else {
                baseEntity.setCreateBy(AppContants.SYSTEM_USER);
                baseEntity.setUpdateBy(AppContants.SYSTEM_USER);
            }
            baseEntity.setCreateTime(new Date());
            baseEntity.setUpdateTime(new Date());
        }
    }
    public void injectForUpdate(Object o) {
        MemberEntity member = LoginUserUtils.getUser();
        if (o instanceof BaseEntity) {
            BaseEntity baseEntity = (BaseEntity) o;
            if (member != null) {
                String by = member.getPhone() != null ? member.getPhone() : member.getEmail();
                baseEntity.setUpdateBy(by);
            } else {
                baseEntity.setUpdateBy(AppContants.SYSTEM_USER);
            }
            baseEntity.setUpdateTime(new Date());
        }
    }
}
src/main/java/com/xcong/excoin/configurations/security/TokenConfigurer.java
File was deleted
src/main/java/com/xcong/excoin/configurations/security/TokenFilter.java
File was deleted
src/main/java/com/xcong/excoin/configurations/security/UserAuthenticationArgumentResolver.java
File was deleted
src/main/java/com/xcong/excoin/configurations/security/WebSecurityConfig.java
@@ -53,8 +53,7 @@
                .antMatchers("/api/member/getAppVersionInfo").permitAll()
                .antMatchers("/api/orderCoin/searchSymbolResultList").permitAll()
                .antMatchers("/api/orderCoin/findCollect").permitAll()
                .anyRequest().authenticated()
                .and().apply(securityConfiguereAdapter());
                .anyRequest().authenticated();
    }
    @Override
@@ -77,7 +76,4 @@
        return new CustomAuthenticationEntryPoint();
    }
    public TokenConfigurer securityConfiguereAdapter() {
        return new TokenConfigurer();
    }
}
src/main/java/com/xcong/excoin/modules/blackchain/controller/BlockController.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/model/EosResult.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/model/XrpTransResult.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/model/XrpTransactions.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/model/XrpTx.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/BchService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/BigDecimalUtil.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/BlockSerive.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/BtcService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/DateUtil.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/EosService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/EthService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/HttpUtil.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/LtcService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtService.java
File was deleted
src/main/java/com/xcong/excoin/modules/blackchain/service/XrpService.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountFlowEntityDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/dao/MemberSelectSymbolsDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/dao/OrderCoinDealDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/dao/OrderCoinsDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountFlowEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountMoneyChange.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/entity/OrderCoinsDealEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/entity/OrderCoinsEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/mapper/MemberAccountMoneyChangeMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/mapper/OrderCoinsDealMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/mapper/OrderWalletCoinDealMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/mapper/OrderWalletCoinMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/CancelEntrustWalletCoinOrderDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/FindAllWalletCoinOrderDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/FindCollectDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/InOrderCoinDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/RecordsPageDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/SubmitSalesWalletCoinOrderDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceFromAgentDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/AllWalletCoinVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/FindCollectListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberAccountMoneyChangeInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberAccountMoneyChangeVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberAgentIntoInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberSelectSymbolsVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletAgentInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletContractInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinDealListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinDealVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/OrderWalletCoinVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/TransactionPageOfWalletCoinVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/service/BlockCoinService.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/service/OrderCoinService.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/service/impl/BlockCoinServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/controller/ContractEntrustOrderController.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/controller/ContractHoldOrderController.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/dao/ContractEntrustOrderDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/dao/ContractHoldOrderDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/dao/ContractOrderDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/entity/ContractEntrustOrderEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/mapper/ContractEntrustOrderEntityMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/mapper/ContractHoldOrderEntityMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/mapper/ContractOrderEntityMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/ChangeBondDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/ChangeLeverRateDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/OrderListDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/ProfitOrLessDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/SubmitEntrustDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/SubmitOrderDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/dto/SymbolDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/ContractEntrustVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/ContractMoneyInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/HoldOrderDetailVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/HoldOrderListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/OrderDetailVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/parameter/vo/OrderListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/ContractEntrustOrderService.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/ContractHoldOrderService.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/ContractOrderService.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/RabbitOrderService.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractEntrustOrderServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractOrderServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/Example.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GateConfig.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GateGridTradeService.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GateKlineWebSocketClient.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GateTradeExecutor.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GateWebSocketClientMain.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GateWebSocketClientManager.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/GridElement.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/TraderParam.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/celue.out
Binary files differ
src/main/java/com/xcong/excoin/modules/gateApi/gate-api.txt
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/gate-websocket.txt
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/gateApi-logic.md
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/AbstractPrivateChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/GateChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/AutoOrdersChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/CandlestickChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/OrdersChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/PositionClosesChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/PositionsChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/gateApi/wsHandler/handler/UserTradesChannelHandler.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/controller/MemberQuickBuySaleController.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/dao/MemberQuickBuySaleDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/dto/MemberQuickBuySaleCommitDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/dto/MemberQuickBuySaleDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/entity/MemberQuickBuySaleEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/mapper/MemberQuickBuySaleEntityMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/service/MemberQuickBuySaleService.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/service/impl/MemberQuickBuySaleServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/vo/MemberQuickBuySaleDetailVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/home/vo/MemberQuickBuySaleVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/controller/MemberController.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/AgentReturnDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/AppVersionDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberAuthenticationDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinAddressDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinChargeDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinWithdrawDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberLevelRateDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberPaymentMethodDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberSettingDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractSimulateDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/AgentReturnEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/AppVersionEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberAuthenticationEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberCoinAddressEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberCoinChargeEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberCoinWithdrawEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberLevelRateEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberPaymentMethodEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberSelectSymbolsEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberSettingEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractSimulateEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberAddCoinAddressDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberAuthenticationDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberBindEmailDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberBindPhoneDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberDelCoinAddressDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberDelPaymethodDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberForgetPwdDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberPaymethodDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberSubmitCoinApplyDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberTradersPwdDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberUpdatePwdDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberUpdateTradePwdDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/dto/MemberUpdateTradersPwdTimeDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/AppVersionListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/AppVersionVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberAuthenticationInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberAvivableCoinInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressCountListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressCountVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinAddressVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinInfoListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberCoinInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberPaymethodDetailListVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberPaymethodDetailVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberPersonCenterInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/MemberSendCodeWayVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/parameter/vo/NeedMoneyMemberVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/service/MemberService.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/service/MemberWalletContractService.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberWalletContractServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/newPrice/OkxNewPriceWebSocketClient.java
File was deleted
src/main/java/com/xcong/excoin/modules/newPrice/OkxWebSocketClient.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/ExchangeInfoEnum.java
New file
@@ -0,0 +1,73 @@
package com.xcong.excoin.modules.okxNewPrice;
import lombok.Getter;
/**
 * 交易信息枚举类
 * 用于存储不同交易账户的密钥信息,包括实盘账户和模拟账户
 */
@Getter
public enum ExchangeInfoEnum {
    /**
     * 模拟盘账户1信息
     * 存储了模拟盘交易所需的API密钥、秘钥和通过码
     */
//    OKX_PRD_xiao("f512673b-2685-4fcb-9bb1-2ae8db745d62",
//            "B0C1CC8F39625B41140D93DC25039E33",
//            "Aa12345678@",
//            true);
    OKX_UAT_ceshi("ffb4e79f-fcf5-4afb-82c5-2fbb64123f61",
            "AA06C5ED1D7C7F5AFE6484052E231C55",
            "Aa12345678@",
            false);
//
//    /**
//     * 模拟盘账户2信息
//     * 存储了模拟盘交易所需的API密钥、秘钥和通过码
//     */
//    OKX_PRD_wang("72e380a6-4133-451b-8b10-8b1905b30717",
//            "2A5BD55BF0771F1ADF08AE0A2FB4D561",
//            "Aa12345678@",
//            true);
//    OKX_UAT2("7a023eb2-06c0-4255-9969-b86ea1cef0d7",
//            "D0106A4D63BD22BEAB9CBA8F41219661",
//            "Aa12345678@",
//            false);
    /**
     * 模拟盘账户3信息
     * 存储了模拟盘交易所需的API密钥、秘钥和通过码
     */
//    OKX_UAT3("0769b50c-2c36-4310-8bd9-cad6bc6c9d8f",
//            "7AF4A574BC44907CE76BBFF91F53852D",
//            "Aa123456@",
//            false);
    // API公钥,用于识别用户身份
    private String apiKey;
    // API秘钥,用于签名和验证请求
    private String secretKey;
    // API通过码,用于额外的身份验证
    private String passphrase;
    // 账户类型,true表示实盘账户,false表示模拟账户
    private boolean accountType;
    /**
     * 构造方法
     *
     * @param apiKey API公钥,用于识别用户身份
     * @param secretKey API秘钥,用于签名和验证请求
     * @param passphrase API通过码,用于额外的身份验证
     * @param accountType 账户类型,true表示实盘账户,false表示模拟账户
     */
    ExchangeInfoEnum(String apiKey, String secretKey, String passphrase, boolean accountType) {
        this.apiKey = apiKey;
        this.secretKey = secretKey;
        this.passphrase = passphrase;
        this.accountType = accountType;
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OKX_QUANT_DOCUMENTATION.md
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxConfig.java
New file
@@ -0,0 +1,182 @@
package com.xcong.excoin.modules.okxNewPrice;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
 * OKX 网格交易模块全局配置,策略的唯一参数入口。
 *
 * <h3>定位</h3>
 * 通过 Builder 模式将所有运行参数集中管理,避免策略参数散落在多个类中。
 * 运行时动态参数(step、gridElements、baseLongTraderParam、baseShortTraderParam)
 * 由 {@link OkxGridTradeService} 在策略执行过程中写入。
 *
 * <h3>参数分类</h3>
 * <table>
 *   <tr><th>类别</th><th>参数</th><th>用途</th></tr>
 *   <tr><td>认证</td><td>apiKey, secretKey, passphrase</td><td>REST/WS 签名认证</td></tr>
 *   <tr><td>交易标的</td><td>instId, leverage, quantity, ctVal</td><td>合约、杠杆、张数、面值</td></tr>
 *   <tr><td>持仓</td><td>tdMode, posSide</td><td>全仓/逐仓、多/空</td></tr>
 *   <tr><td>网格策略</td><td>gridRate, gridQueueSize, priceScale</td><td>间距比例、队列容量、价格精度</td></tr>
 *   <tr><td>止盈止损</td><td>expectedProfit, maxLoss</td><td>整体止盈/亏损阈值(USDT),触发后策略重置</td></tr>
 *   <tr><td>风控</td><td>marginRatioLimit</td><td>保证金占比上限</td></tr>
 *   <tr><td>运行时</td><td>step, gridElements, baseLongTraderParam, baseShortTraderParam</td><td>由策略动态填充</td></tr>
 * </table>
 *
 * @author Administrator
 */
public class OkxConfig {
    /** OKX API 密钥 */
    private final String apiKey;
    /** OKX API 签名密钥 */
    private final String secretKey;
    /** OKX API 密码短语 */
    private final String passphrase;
    /** 合约名称(如 ETH-USDT-SWAP) */
    private final String instId;
    /** 杠杆倍数 */
    private final String leverage;
    /** 保证金模式(cross / isolated) */
    private final String tdMode;
    /** 持仓方向(long / short),仅用于网格策略中的方向判定 */
    private final String posSide;
    /** 网格间距比例(如 0.0025 表示 0.25%) */
    private final BigDecimal gridRate;
    /** 预期收益(USDT),达到后自动重置策略 */
    private final BigDecimal expectedProfit;
    /** 最大亏损阈值(USDT) */
    private final BigDecimal maxLoss;
    /** 每次下单张数 */
    private final String quantity;
    /** 基底开仓张数(初始化时多空各开的张数) */
    private final String baseQuantity;
    /** 是否为模拟盘 */
    private final boolean isSimulate;
    /** 网格队列容量 */
    private final int gridQueueSize;
    /** 保证金占初始本金比例上限 */
    private final BigDecimal marginRatioLimit;
    /** 合约面值(单张合约代表的基础资产数量,如 ETH=0.1, BTC=0.01) */
    private final BigDecimal ctVal;
    /** 价格精度(交易所价格的最小小数位数,如 1=0.1精度,2=0.01精度) */
    private final int priceScale;
    /** 网格绝对步长(shortBaseEntryPrice × gridRate),运行时由队列生成逻辑设置 */
    private BigDecimal step;
    /** 网格元素列表,由队列初始化时同步填充 */
    private volatile List<OkxGridElement> gridElements = new ArrayList<>();
    /** 基座多头挂单参数,在基座成交后填充 */
    private OkxTraderParam baseLongTraderParam;
    /** 基座空头挂单参数,在基座成交后填充 */
    private OkxTraderParam baseShortTraderParam;
    private OkxConfig(Builder builder) {
        this.apiKey = builder.apiKey;
        this.secretKey = builder.secretKey;
        this.passphrase = builder.passphrase;
        this.instId = builder.instId;
        this.leverage = builder.leverage;
        this.tdMode = builder.tdMode;
        this.posSide = builder.posSide;
        this.gridRate = builder.gridRate;
        this.expectedProfit = builder.expectedProfit;
        this.maxLoss = builder.maxLoss;
        this.quantity = builder.quantity;
        this.baseQuantity = builder.baseQuantity;
        this.isSimulate = builder.isSimulate;
        this.gridQueueSize = builder.gridQueueSize;
        this.marginRatioLimit = builder.marginRatioLimit;
        this.ctVal = builder.ctVal;
        this.priceScale = builder.priceScale;
    }
    // ==================== 认证信息 ====================
    public String getApiKey() { return apiKey; }
    public String getSecretKey() { return secretKey; }
    public String getPassphrase() { return passphrase; }
    // ==================== 交易标的 ====================
    public String getInstId() { return instId; }
    public String getLeverage() { return leverage; }
    public String getTdMode() { return tdMode; }
    public String getPosSide() { return posSide; }
    // ==================== 策略参数 ====================
    public BigDecimal getGridRate() { return gridRate; }
    public BigDecimal getExpectedProfit() { return expectedProfit; }
    public BigDecimal getMaxLoss() { return maxLoss; }
    public String getQuantity() { return quantity; }
    public String getBaseQuantity() { return baseQuantity; }
    public int getGridQueueSize() { return gridQueueSize; }
    // ==================== 风控 ====================
    public BigDecimal getMarginRatioLimit() { return marginRatioLimit; }
    public BigDecimal getCtVal() { return ctVal; }
    public int getPriceScale() { return priceScale; }
    // ==================== 环境 ====================
    public boolean isSimulate() { return isSimulate; }
    // ==================== 运行时参数 ====================
    public BigDecimal getStep() { return step; }
    public void setStep(BigDecimal step) { this.step = step; }
    public List<OkxGridElement> getGridElements() { return gridElements; }
    public void setGridElements(List<OkxGridElement> gridElements) {
        this.gridElements = gridElements;
        OkxGridElement.rebuildIndex(gridElements);
    }
    public OkxTraderParam getBaseLongTraderParam() { return baseLongTraderParam; }
    public void setBaseLongTraderParam(OkxTraderParam baseLongTraderParam) { this.baseLongTraderParam = baseLongTraderParam; }
    public OkxTraderParam getBaseShortTraderParam() { return baseShortTraderParam; }
    public void setBaseShortTraderParam(OkxTraderParam baseShortTraderParam) { this.baseShortTraderParam = baseShortTraderParam; }
    public static Builder builder() {
        return new Builder();
    }
    public static class Builder {
        private String apiKey;
        private String secretKey;
        private String passphrase;
        private String instId = "ETH-USDT-SWAP";
        private String leverage = "100";
        private String tdMode = "cross";
        private String posSide = "long";
        private BigDecimal gridRate = new BigDecimal("0.0025");
        private BigDecimal expectedProfit = new BigDecimal("2");
        private BigDecimal maxLoss = new BigDecimal("15");
        private String quantity = "1";
        private String baseQuantity = "10";
        private boolean isSimulate = false;
        private int gridQueueSize = 300;
        private BigDecimal marginRatioLimit = new BigDecimal("0.2");
        private BigDecimal ctVal = new BigDecimal("0.1");
        private int priceScale = 2;
        public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; }
        public Builder secretKey(String secretKey) { this.secretKey = secretKey; return this; }
        public Builder passphrase(String passphrase) { this.passphrase = passphrase; return this; }
        public Builder instId(String instId) { this.instId = instId; return this; }
        public Builder leverage(String leverage) { this.leverage = leverage; return this; }
        public Builder tdMode(String tdMode) { this.tdMode = tdMode; return this; }
        public Builder posSide(String posSide) { this.posSide = posSide; return this; }
        public Builder gridRate(BigDecimal gridRate) { this.gridRate = gridRate; return this; }
        public Builder expectedProfit(BigDecimal expectedProfit) { this.expectedProfit = expectedProfit; return this; }
        public Builder maxLoss(BigDecimal maxLoss) { this.maxLoss = maxLoss; return this; }
        public Builder quantity(String quantity) { this.quantity = quantity; return this; }
        public Builder baseQuantity(String baseQuantity) { this.baseQuantity = baseQuantity; return this; }
        public Builder isSimulate(boolean isSimulate) { this.isSimulate = isSimulate; return this; }
        public Builder gridQueueSize(int gridQueueSize) { this.gridQueueSize = gridQueueSize; return this; }
        public Builder marginRatioLimit(BigDecimal marginRatioLimit) { this.marginRatioLimit = marginRatioLimit; return this; }
        public Builder ctVal(BigDecimal ctVal) { this.ctVal = ctVal; return this; }
        public Builder priceScale(int priceScale) { this.priceScale = priceScale; return this; }
        public OkxConfig build() {
            return new OkxConfig(this);
        }
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridElement.java
New file
@@ -0,0 +1,293 @@
package com.xcong.excoin.modules.okxNewPrice;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * 网格价格层级,策略的最小操作单元。
 *
 * <h3>定位</h3>
 * 每个 OkxGridElement 对应网格中的一个价格点,同时持有该点的多仓和空仓挂单状态。
 * 维护全局静态 HashMap 索引实现 O(1) 双向查询。
 *
 * <h3>ID 体系与链表</h3>
 * <pre>
 *   ID ≦ -1:  空仓队列区域(降序),ID 自减,gridPrice 递减
 *   ID  =  0:  基座位置,gridPrice = shortBaseEntryPrice
 *   ID ≧  1:  多仓队列区域(升序),ID 自增,gridPrice 递增
 *
 *   链表: ... ← -3 ← -2 ← -1 ← 0 → 1 → 2 → 3 → ...
 * </pre>
 *
 * <h3>8 个全局 O(1) 索引</h3>
 * <pre>
 *   INDEX                 → findById(int)               ID → 元素
 *   PRICE_INDEX           → findByPrice(BigDecimal)     价格 → 元素
 *   LONG_ORDER_ID_INDEX   → findByLongOrderId(String)   多仓挂单ID → 元素
 *   SHORT_ORDER_ID_INDEX  → findByShortOrderId(String)  空仓挂单ID → 元素
 *   LONG_TP_ORDER_ID_INDEX→ findByLongTakeProfitOrderId(String)  多止盈ID → 元素
 *   SHORT_TP_ORDER_ID_INDEX→ findByShortTakeProfitOrderId(String) 空止盈ID → 元素
 *   LONG_SL_ORDER_ID_INDEX→ findByLongStopLossOrderId(String)    多止损ID → 元素
 *   SHORT_SL_ORDER_ID_INDEX→ findByShortStopLossOrderId(String)  空止损ID → 元素
 * </pre>
 *
 * @author Administrator
 */
public class OkxGridElement {
    private int id;
    private BigDecimal gridPrice;
    private boolean hasLongOrder;
    private boolean hasShortOrder;
    private OkxTraderParam longTraderParam;
    private OkxTraderParam shortTraderParam;
    private Integer upId;
    private Integer downId;
    private String longOrderId;
    private String shortOrderId;
    private String longTakeProfitOrderId;
    private String shortTakeProfitOrderId;
    private String longStopLossOrderId;
    private String shortStopLossOrderId;
    // ==================== 全局索引 ====================
    private static final Map<Integer, OkxGridElement> INDEX = new ConcurrentHashMap<>();
    private static final Map<BigDecimal, OkxGridElement> PRICE_INDEX = new ConcurrentHashMap<>();
    private static final Map<String, OkxGridElement> LONG_ORDER_ID_INDEX = new ConcurrentHashMap<>();
    private static final Map<String, OkxGridElement> SHORT_ORDER_ID_INDEX = new ConcurrentHashMap<>();
    private static final Map<String, OkxGridElement> LONG_TP_ORDER_ID_INDEX = new ConcurrentHashMap<>();
    private static final Map<String, OkxGridElement> SHORT_TP_ORDER_ID_INDEX = new ConcurrentHashMap<>();
    private static final Map<String, OkxGridElement> LONG_SL_ORDER_ID_INDEX = new ConcurrentHashMap<>();
    private static final Map<String, OkxGridElement> SHORT_SL_ORDER_ID_INDEX = new ConcurrentHashMap<>();
    // ==================== 静态查找方法 ====================
    public static OkxGridElement findById(int id) {
        return INDEX.get(id);
    }
    public static OkxGridElement findByPrice(BigDecimal price) {
        return PRICE_INDEX.get(price);
    }
    public static OkxGridElement findByLongOrderId(String orderId) {
        return LONG_ORDER_ID_INDEX.get(orderId);
    }
    public static OkxGridElement findByShortOrderId(String orderId) {
        return SHORT_ORDER_ID_INDEX.get(orderId);
    }
    public static OkxGridElement findByLongTakeProfitOrderId(String orderId) {
        return LONG_TP_ORDER_ID_INDEX.get(orderId);
    }
    public static OkxGridElement findByShortTakeProfitOrderId(String orderId) {
        return SHORT_TP_ORDER_ID_INDEX.get(orderId);
    }
    public static OkxGridElement findByLongStopLossOrderId(String orderId) {
        return LONG_SL_ORDER_ID_INDEX.get(orderId);
    }
    public static OkxGridElement findByShortStopLossOrderId(String orderId) {
        return SHORT_SL_ORDER_ID_INDEX.get(orderId);
    }
    /**
     * 全量重建全局索引。由 OkxConfig.setGridElements() 调用。
     */
    public static void rebuildIndex(List<OkxGridElement> elements) {
        INDEX.clear();
        PRICE_INDEX.clear();
        LONG_ORDER_ID_INDEX.clear();
        SHORT_ORDER_ID_INDEX.clear();
        LONG_TP_ORDER_ID_INDEX.clear();
        SHORT_TP_ORDER_ID_INDEX.clear();
        LONG_SL_ORDER_ID_INDEX.clear();
        SHORT_SL_ORDER_ID_INDEX.clear();
        for (OkxGridElement e : elements) {
            INDEX.put(e.getId(), e);
            putDynamicIndices(e);
        }
        logAll();
    }
    /**
     * 增量刷新动态索引。每次修改订单状态后调用。
     */
    public static void refreshIndices() {
        PRICE_INDEX.clear();
        LONG_ORDER_ID_INDEX.clear();
        SHORT_ORDER_ID_INDEX.clear();
        LONG_TP_ORDER_ID_INDEX.clear();
        SHORT_TP_ORDER_ID_INDEX.clear();
        LONG_SL_ORDER_ID_INDEX.clear();
        SHORT_SL_ORDER_ID_INDEX.clear();
        for (OkxGridElement e : INDEX.values()) {
            putDynamicIndices(e);
        }
        logAll();
    }
    /**
     * 获取所有已挂空仓条件单且当前价高于其价格、无止盈单的网格元素。
     */
    public static List<OkxGridElement> findAllLongOrders(BigDecimal currentPrice) {
        List<OkxGridElement> result = new ArrayList<>();
        for (OkxGridElement e : INDEX.values()) {
            if (e.isHasLongOrder() && e.getGridPrice().compareTo(currentPrice) > 0 && e.getLongTakeProfitOrderId() == null) {
                result.add(e);
            }
        }
        return result;
    }
    /**
     * 获取所有已挂多仓条件单且当前价低于其价格、无止盈单的网格元素。
     */
    public static List<OkxGridElement> findAllShortOrders(BigDecimal currentPrice) {
        List<OkxGridElement> result = new ArrayList<>();
        for (OkxGridElement e : INDEX.values()) {
            if (e.isHasShortOrder() && e.getGridPrice().compareTo(currentPrice) < 0 && e.getShortTakeProfitOrderId() == null) {
                result.add(e);
            }
        }
        return result;
    }
    private static void putDynamicIndices(OkxGridElement e) {
        PRICE_INDEX.put(e.getGridPrice(), e);
        if (e.getLongOrderId() != null) LONG_ORDER_ID_INDEX.put(e.getLongOrderId(), e);
        if (e.getShortOrderId() != null) SHORT_ORDER_ID_INDEX.put(e.getShortOrderId(), e);
        if (e.getLongTakeProfitOrderId() != null) LONG_TP_ORDER_ID_INDEX.put(e.getLongTakeProfitOrderId(), e);
        if (e.getShortTakeProfitOrderId() != null) SHORT_TP_ORDER_ID_INDEX.put(e.getShortTakeProfitOrderId(), e);
        if (e.getLongStopLossOrderId() != null) LONG_SL_ORDER_ID_INDEX.put(e.getLongStopLossOrderId(), e);
        if (e.getShortStopLossOrderId() != null) SHORT_SL_ORDER_ID_INDEX.put(e.getShortStopLossOrderId(), e);
    }
    public static void logAll() {
        List<OkxGridElement> sorted = new ArrayList<>(INDEX.values());
        sorted.sort((a, b) -> Integer.compare(a.getId(), b.getId()));
        StringBuilder sb = new StringBuilder("\n========== OKX 网格数据 ==========\n");
        for (OkxGridElement e : sorted) {
            if (e.isHasLongOrder() || e.isHasShortOrder()
                    || e.getLongStopLossOrderId() != null || e.getShortStopLossOrderId() != null) {
                sb.append(String.format(
                        "  ID=%4d  价格=%s  up=%s  down=%s  多仓=%s(%s)  空仓=%s(%s)  多止盈=%s  空止盈=%s  多止损=%s  空止损=%s\n",
                        e.getId(), e.getGridPrice(), e.getUpId(), e.getDownId(),
                        e.isHasLongOrder() ? "有" : "无", e.getLongOrderId() != null ? e.getLongOrderId() : "-",
                        e.isHasShortOrder() ? "有" : "无", e.getShortOrderId() != null ? e.getShortOrderId() : "-",
                        e.getLongTakeProfitOrderId() != null ? e.getLongTakeProfitOrderId() : "-",
                        e.getShortTakeProfitOrderId() != null ? e.getShortTakeProfitOrderId() : "-",
                        e.getLongStopLossOrderId() != null ? e.getLongStopLossOrderId() : "-",
                        e.getShortStopLossOrderId() != null ? e.getShortStopLossOrderId() : "-"));
            }
        }
        sb.append(String.format(
                "  索引统计: ID=%d  价格=%d  多仓订单ID=%d  空仓订单ID=%d  多止盈ID=%d  空止盈ID=%d  多止损ID=%d  空止损ID=%d\n",
                INDEX.size(), PRICE_INDEX.size(), LONG_ORDER_ID_INDEX.size(), SHORT_ORDER_ID_INDEX.size(),
                LONG_TP_ORDER_ID_INDEX.size(), SHORT_TP_ORDER_ID_INDEX.size(),
                LONG_SL_ORDER_ID_INDEX.size(), SHORT_SL_ORDER_ID_INDEX.size()));
        sb.append("================================\n");
        System.out.println(sb);
    }
    public OkxGridElement getUp() {
        return upId != null ? INDEX.get(upId) : null;
    }
    public OkxGridElement getDown() {
        return downId != null ? INDEX.get(downId) : null;
    }
    private OkxGridElement(Builder builder) {
        this.id = builder.id;
        this.gridPrice = builder.gridPrice;
        this.hasLongOrder = builder.hasLongOrder;
        this.hasShortOrder = builder.hasShortOrder;
        this.longTraderParam = builder.longTraderParam;
        this.shortTraderParam = builder.shortTraderParam;
        this.upId = builder.upId;
        this.downId = builder.downId;
        this.longOrderId = builder.longOrderId;
        this.shortOrderId = builder.shortOrderId;
        this.longTakeProfitOrderId = builder.longTakeProfitOrderId;
        this.shortTakeProfitOrderId = builder.shortTakeProfitOrderId;
        this.longStopLossOrderId = builder.longStopLossOrderId;
        this.shortStopLossOrderId = builder.shortStopLossOrderId;
    }
    // ==================== getters/setters ====================
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public BigDecimal getGridPrice() { return gridPrice; }
    public void setGridPrice(BigDecimal gridPrice) { this.gridPrice = gridPrice; }
    public boolean isHasLongOrder() { return hasLongOrder; }
    public void setHasLongOrder(boolean hasLongOrder) { this.hasLongOrder = hasLongOrder; }
    public boolean isHasShortOrder() { return hasShortOrder; }
    public void setHasShortOrder(boolean hasShortOrder) { this.hasShortOrder = hasShortOrder; }
    public OkxTraderParam getLongTraderParam() { return longTraderParam; }
    public void setLongTraderParam(OkxTraderParam longTraderParam) { this.longTraderParam = longTraderParam; }
    public OkxTraderParam getShortTraderParam() { return shortTraderParam; }
    public void setShortTraderParam(OkxTraderParam shortTraderParam) { this.shortTraderParam = shortTraderParam; }
    public Integer getUpId() { return upId; }
    public void setUpId(Integer upId) { this.upId = upId; }
    public Integer getDownId() { return downId; }
    public void setDownId(Integer downId) { this.downId = downId; }
    public String getLongOrderId() { return longOrderId; }
    public void setLongOrderId(String longOrderId) { this.longOrderId = longOrderId; }
    public String getShortOrderId() { return shortOrderId; }
    public void setShortOrderId(String shortOrderId) { this.shortOrderId = shortOrderId; }
    public String getLongTakeProfitOrderId() { return longTakeProfitOrderId; }
    public void setLongTakeProfitOrderId(String longTakeProfitOrderId) { this.longTakeProfitOrderId = longTakeProfitOrderId; }
    public String getShortTakeProfitOrderId() { return shortTakeProfitOrderId; }
    public void setShortTakeProfitOrderId(String shortTakeProfitOrderId) { this.shortTakeProfitOrderId = shortTakeProfitOrderId; }
    public String getLongStopLossOrderId() { return longStopLossOrderId; }
    public void setLongStopLossOrderId(String longStopLossOrderId) { this.longStopLossOrderId = longStopLossOrderId; }
    public String getShortStopLossOrderId() { return shortStopLossOrderId; }
    public void setShortStopLossOrderId(String shortStopLossOrderId) { this.shortStopLossOrderId = shortStopLossOrderId; }
    public static Builder builder() {
        return new Builder();
    }
    public static class Builder {
        private int id;
        private BigDecimal gridPrice;
        private boolean hasLongOrder = false;
        private boolean hasShortOrder = false;
        private OkxTraderParam longTraderParam;
        private OkxTraderParam shortTraderParam;
        private Integer upId;
        private Integer downId;
        private String longOrderId;
        private String shortOrderId;
        private String longTakeProfitOrderId;
        private String shortTakeProfitOrderId;
        private String longStopLossOrderId;
        private String shortStopLossOrderId;
        public Builder id(int id) { this.id = id; return this; }
        public Builder gridPrice(BigDecimal gridPrice) { this.gridPrice = gridPrice; return this; }
        public Builder hasLongOrder(boolean hasLongOrder) { this.hasLongOrder = hasLongOrder; return this; }
        public Builder hasShortOrder(boolean hasShortOrder) { this.hasShortOrder = hasShortOrder; return this; }
        public Builder longTraderParam(OkxTraderParam longTraderParam) { this.longTraderParam = longTraderParam; return this; }
        public Builder shortTraderParam(OkxTraderParam shortTraderParam) { this.shortTraderParam = shortTraderParam; return this; }
        public Builder upId(Integer upId) { this.upId = upId; return this; }
        public Builder downId(Integer downId) { this.downId = downId; return this; }
        public Builder longOrderId(String longOrderId) { this.longOrderId = longOrderId; return this; }
        public Builder shortOrderId(String shortOrderId) { this.shortOrderId = shortOrderId; return this; }
        public Builder longTakeProfitOrderId(String longTakeProfitOrderId) { this.longTakeProfitOrderId = longTakeProfitOrderId; return this; }
        public Builder shortTakeProfitOrderId(String shortTakeProfitOrderId) { this.shortTakeProfitOrderId = shortTakeProfitOrderId; return this; }
        public Builder longStopLossOrderId(String longStopLossOrderId) { this.longStopLossOrderId = longStopLossOrderId; return this; }
        public Builder shortStopLossOrderId(String shortStopLossOrderId) { this.shortStopLossOrderId = shortStopLossOrderId; return this; }
        public OkxGridElement build() {
            return new OkxGridElement(this);
        }
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridTradeService.java
New file
@@ -0,0 +1,760 @@
package com.xcong.excoin.modules.okxNewPrice;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.OKXAccount;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.enums.HttpMethod;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.OKXContants;
import com.xcong.excoin.utils.dingtalk.DingTalkUtils;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/**
 * OKX 网格交易策略引擎 — 多空对冲网格。
 *
 * <h3>策略原理</h3>
 * 对齐 Gate 版本逻辑:以空仓基底入场价为价格基准,向上/向下各生成价格网格队列。
 * 价格触发网格层级时挂条件单,成交后自动挂止盈单。
 *
 * <h3>完整生命周期</h3>
 * <pre>
 *   startGrid() → WAITING_KLINE
 *     ↓
 *   onKline(首根K线) → OPENING → 异步市价双开基底(开多+开空)
 *     ↓
 *   onPositionUpdate() → 基底成交 → baseLongOpened && baseShortOpened
 *     ↓
 *   tryGenerateQueues() → generateShortQueue()+generateLongQueue()+updateGridElements()
 *     → 挂基座止损单 + state=ACTIVE
 *     ↓
 *   ACTIVE 状态每根K线:
 *     processShortGrid() + processLongGrid() → 匹配队列 → 挂条件单 → 订单成交后挂止盈
 *     ↓
 *   onPositionClose() → cumulativePnl 累加 → 检查停止条件
 * </pre>
 *
 * <h3>OKX vs Gate 差异</h3>
 * <ul>
 *   <li>OKX 使用 side(buy/sell)+posSide(long/short) 下单,而非 size 正负</li>
 *   <li>条件单使用 algo order (ordType=conditional)</li>
 *   <li>止盈止损通过 algo order 实现</li>
 * </ul>
 *
 * @author Administrator
 */
@Slf4j
public class OkxGridTradeService {
    public enum StrategyState {
        WAITING_KLINE, OPENING, ACTIVE, STOPPED
    }
    private final OkxConfig config;
    private final OkxTradeExecutor executor;
    private final OKXAccount okxAccount;
    private volatile StrategyState state = StrategyState.WAITING_KLINE;
    /** 空仓价格队列,降序排列(大→小) */
    private final List<BigDecimal> shortPriceQueue = Collections.synchronizedList(new ArrayList<>());
    /** 多仓价格队列,升序排列(小→大) */
    private final List<BigDecimal> longPriceQueue = Collections.synchronizedList(new ArrayList<>());
    /** 当前多仓条件单映射:algoId → 止盈价格 */
    private final Map<String, BigDecimal> currentLongOrderIds = Collections.synchronizedMap(new LinkedHashMap<>());
    /** 当前空仓条件单映射:algoId → 止盈价格 */
    private final Map<String, BigDecimal> currentShortOrderIds = Collections.synchronizedMap(new LinkedHashMap<>());
    /** 基底空头入场价 */
    private BigDecimal shortBaseEntryPrice;
    /** 基底多头入场价 */
    private BigDecimal longBaseEntryPrice;
    /** 基底多头是否已开 */
    private volatile boolean baseLongOpened = false;
    /** 基底空头是否已开 */
    private volatile boolean baseShortOpened = false;
    private volatile boolean shortActive = false;
    private volatile boolean longActive = false;
    private volatile BigDecimal lastKlinePrice;
    private volatile BigDecimal cumulativePnl = BigDecimal.ZERO;
    private volatile BigDecimal unrealizedPnl = BigDecimal.ZERO;
    private volatile BigDecimal longEntryPrice = BigDecimal.ZERO;
    private volatile BigDecimal shortEntryPrice = BigDecimal.ZERO;
    private volatile BigDecimal longPositionSize = BigDecimal.ZERO;
    private volatile BigDecimal shortPositionSize = BigDecimal.ZERO;
    private volatile BigDecimal initialPrincipal = BigDecimal.ZERO;
    public OkxGridTradeService(OkxConfig config, OKXAccount okxAccount) {
        this.config = config;
        this.okxAccount = okxAccount;
        this.executor = new OkxTradeExecutor(okxAccount, config.getInstId(), config.getTdMode());
    }
    // ---- 初始化 ----
    /**
     * 初始化策略环境:获取账户 → 清旧条件单 → 平已有仓位 → 设杠杆。
     */
    public void init() {
        try {
            // 1. 查询账户获取初始本金
            String balanceResp = executor.getBalance();
            if (balanceResp != null) {
                JSONObject json = JSON.parseObject(balanceResp);
                if ("0".equals(json.getString("code"))) {
                    JSONArray data = json.getJSONArray("data");
                    if (data != null && !data.isEmpty()) {
                        JSONObject detail = data.getJSONObject(0);
                        String totalEq = detail.getString("totalEq");
                        if (totalEq != null) {
                            this.initialPrincipal = new BigDecimal(totalEq);
                            log.info("[OKX] 初始本金: {} USDT", initialPrincipal);
                        }
                    }
                }
            }
            // 2. 清除旧条件单
            executor.cancelAllAlgoOrders();
            log.info("[OKX] 旧条件单已清除");
            // 3. 平掉已有仓位
            closeExistingPositions();
            // 4. 设置杠杆
            executor.setLeverage(config.getLeverage());
            log.info("[OKX] 初始化完成, 合约:{}, 杠杆:{}x", config.getInstId(), config.getLeverage());
        } catch (Exception e) {
            log.error("[OKX] 初始化失败", e);
        }
    }
    /**
     * 平掉当前合约的所有已有仓位。
     */
    private void closeExistingPositions() {
        try {
            String posResp = executor.getPositions();
            if (posResp == null) return;
            JSONObject json = JSON.parseObject(posResp);
            if (!"0".equals(json.getString("code"))) return;
            JSONArray data = json.getJSONArray("data");
            if (data == null || data.isEmpty()) {
                log.info("[OKX] 无已有仓位");
                return;
            }
            for (int i = 0; i < data.size(); i++) {
                JSONObject pos = data.getJSONObject(i);
                String instId = pos.getString("instId");
                if (!config.getInstId().equals(instId)) continue;
                String posSide = pos.getString("posSide");
                String posSz = pos.getString("pos");
                if (posSz == null || "0".equals(posSz)) continue;
                String side = "long".equals(posSide) ? "sell" : "buy";
                executor.marketClose(side, posSide, posSz);
                log.info("[OKX] 平已有仓位, posSide:{}, sz:{}, side:{}", posSide, posSz, side);
            }
        } catch (Exception e) {
            log.warn("[OKX] 平仓位异常", e);
        }
    }
    // ---- 启动/停止 ----
    public void startGrid() {
        if (state != StrategyState.WAITING_KLINE && state != StrategyState.STOPPED) {
            log.warn("[OKX] 策略已在运行中, state:{}", state);
            return;
        }
        state = StrategyState.WAITING_KLINE;
        cumulativePnl = BigDecimal.ZERO;
        unrealizedPnl = BigDecimal.ZERO;
        longEntryPrice = BigDecimal.ZERO;
        shortEntryPrice = BigDecimal.ZERO;
        longPositionSize = BigDecimal.ZERO;
        shortPositionSize = BigDecimal.ZERO;
        baseLongOpened = false;
        baseShortOpened = false;
        longActive = false;
        shortActive = false;
        shortPriceQueue.clear();
        longPriceQueue.clear();
        currentLongOrderIds.clear();
        currentShortOrderIds.clear();
        log.info("[OKX] 网格策略已启动");
    }
    public void stopGrid() {
        state = StrategyState.STOPPED;
        executor.cancelAllAlgoOrders();
        executor.shutdown();
        log.info("[OKX] 策略已停止, 累计盈亏: {}", cumulativePnl);
    }
    // ---- K线回调 ----
    public void onKline(BigDecimal closePrice) {
        lastKlinePrice = closePrice;
        updateUnrealizedPnl();
        if (state == StrategyState.STOPPED) {
            executor.cancelAllAlgoOrders();
            closeExistingPositions();
            BigDecimal totalPnl = cumulativePnl.add(unrealizedPnl);
            log.info("[OKX] 已实现:{}, 未实现:{}, 合计:{}", cumulativePnl, unrealizedPnl, totalPnl);
            startGrid();
            return;
        }
        if (state == StrategyState.WAITING_KLINE) {
            state = StrategyState.OPENING;
            log.info("[OKX] 首根K线到达,开基底仓位 多空各{}张...", config.getBaseQuantity());
            executor.openLong(config.getBaseQuantity(), (orderId) -> {
                OkxTraderParam baseLongTp = OkxTraderParam.builder().entryOrderId(orderId).build();
                config.setBaseLongTraderParam(baseLongTp);
            }, null);
            executor.openShort(config.getBaseQuantity(), (orderId) -> {
                OkxTraderParam baseShortTp = OkxTraderParam.builder().entryOrderId(orderId).build();
                config.setBaseShortTraderParam(baseShortTp);
            }, null);
            return;
        }
        if (state != StrategyState.ACTIVE) {
            return;
        }
        checkProfitAndReset();
    }
    // ---- 仓位推送回调 ----
    public void onPositionUpdate(String instId, String posSide, BigDecimal posSize, BigDecimal avgPx) {
        if (state == StrategyState.STOPPED || state == StrategyState.WAITING_KLINE) {
            return;
        }
        boolean hasPosition = posSize.compareTo(BigDecimal.ZERO) > 0;
        if ("long".equals(posSide)) {
            if (hasPosition) {
                longActive = true;
                longEntryPrice = avgPx;
                if (!baseLongOpened) {
                    longPositionSize = posSize;
                    longBaseEntryPrice = avgPx;
                    baseLongOpened = true;
                    log.info("[OKX] 基底多成交价: {}", longBaseEntryPrice);
                    tryGenerateQueues();
                } else {
                    longPositionSize = posSize;
                }
            } else {
                if (longActive && state == StrategyState.ACTIVE) {
                    log.info("[OKX] 多仓持仓归零,重置策略");
                    handlePositionZeroAndReset("多仓");
                }
                longActive = false;
                longPositionSize = BigDecimal.ZERO;
            }
        } else if ("short".equals(posSide)) {
            if (hasPosition) {
                shortActive = true;
                shortEntryPrice = avgPx;
                if (!baseShortOpened) {
                    shortPositionSize = posSize;
                    shortBaseEntryPrice = avgPx;
                    baseShortOpened = true;
                    log.info("[OKX] 基底空成交价: {}", shortBaseEntryPrice);
                    tryGenerateQueues();
                } else {
                    shortPositionSize = posSize;
                }
            } else {
                if (shortActive && state == StrategyState.ACTIVE) {
                    log.info("[OKX] 空仓持仓归零,重置策略");
                    handlePositionZeroAndReset("空仓");
                }
                shortActive = false;
                shortPositionSize = BigDecimal.ZERO;
            }
        }
    }
    // ---- 平仓推送回调 ----
    public void onPositionClose(String side, BigDecimal pnl) {
        if (state == StrategyState.STOPPED) {
            return;
        }
        cumulativePnl = cumulativePnl.add(pnl);
        updateUnrealizedPnl();
        BigDecimal totalPnl = cumulativePnl.add(unrealizedPnl);
        log.info("[OKX] 已实现:{}, 未实现:{}, 合计:{}", cumulativePnl, unrealizedPnl, totalPnl);
        if (totalPnl.compareTo(config.getMaxLoss().negate()) <= 0) {
            String logMsg = StrUtil.format("[OKX] 已达亏损风险值(合计{}), 已实现:{}, 未实现:{}",
                    totalPnl, cumulativePnl, unrealizedPnl);
            log.info(logMsg);
            DingTalkUtils.getDefault().sendActionCard("风险提醒", logMsg, config.getApiKey(), "");
        }
    }
    // ---- 订单/条件单推送回调 ----
    public void onOrderUpdate(String algoId, String state, String ordType) {
        if (!"effective".equals(state) && !"canceled".equals(state)) {
            return;
        }
        // 匹配止损单
        OkxGridElement byLongStopLoss = OkxGridElement.findByLongStopLossOrderId(algoId);
        if (byLongStopLoss != null) {
            handleLongStopLossTriggered(byLongStopLoss);
            return;
        }
        OkxGridElement byShortStopLoss = OkxGridElement.findByShortStopLossOrderId(algoId);
        if (byShortStopLoss != null) {
            handleShortStopLossTriggered(byShortStopLoss);
            return;
        }
        // 匹配挂单 —— 条件单成交后:清空挂单状态 + 追挂止损 + 挂止盈单
        OkxGridElement shortGridElement = OkxGridElement.findByShortOrderId(algoId);
        if (shortGridElement != null && shortGridElement.isHasShortOrder()) {
            int filledQty = Integer.parseInt(shortGridElement.getShortTraderParam().getQuantity());
            shortEntryTraderIdParam(shortGridElement, null, false);
            extendShortStopLoss(filledQty);
            log.info("[OKX] 空单成交 gridId:{}, qty:{}, 追挂止损", shortGridElement.getId(), filledQty);
            return;
        }
        OkxGridElement longGridElement = OkxGridElement.findByLongOrderId(algoId);
        if (longGridElement != null && longGridElement.isHasLongOrder()) {
            int filledQty = Integer.parseInt(longGridElement.getLongTraderParam().getQuantity());
            longEntryTraderIdParam(longGridElement, null, false);
            extendLongStopLoss(filledQty);
            log.info("[OKX] 多单成交 gridId:{}, qty:{}, 追挂止损", longGridElement.getId(), filledQty);
            return;
        }
    }
    // ---- 网格队列处理 ----
    private void tryGenerateQueues() {
        if (baseLongOpened && baseShortOpened) {
            generateShortQueue();
            generateLongQueue();
            updateGridElements();
            // 标记基座挂单
            OkxGridElement baseGridElement = OkxGridElement.findById(0);
            OkxTraderParam baseLongTp = config.getBaseLongTraderParam();
            baseGridElement.setLongOrderId(baseLongTp.getEntryOrderId());
            baseGridElement.setHasLongOrder(true);
            OkxTraderParam baseShortTp = config.getBaseShortTraderParam();
            baseGridElement.setShortOrderId(baseShortTp.getEntryOrderId());
            baseGridElement.setHasShortOrder(true);
            // 挂多仓止损 (id=-2 到 -11)
            for (int id = -2; id >= -11; id--) {
                OkxGridElement elem = OkxGridElement.findById(id);
                if (elem == null) continue;
                BigDecimal triggerPrice = elem.getGridPrice();
                int finalId = id;
                executor.placeTakeProfit(triggerPrice.toString(), "sell", "long", "1",
                        profitId -> {
                            elem.setLongStopLossOrderId(profitId);
                            OkxGridElement.refreshIndices();
                            log.info("[OKX] 多仓止损已挂, gridId:{}, 触发价:{}, stopLossId:{}", finalId, triggerPrice, profitId);
                        });
            }
            // 挂空仓止损 (id=2 到 11)
            for (int id = 2; id <= 11; id++) {
                OkxGridElement elem = OkxGridElement.findById(id);
                if (elem == null) continue;
                BigDecimal triggerPrice = elem.getGridPrice();
                int finalId = id;
                executor.placeTakeProfit(triggerPrice.toString(), "buy", "short", "1",
                        profitId -> {
                            elem.setShortStopLossOrderId(profitId);
                            OkxGridElement.refreshIndices();
                            log.info("[OKX] 空仓止损已挂, gridId:{}, 触发价:{}, stopLossId:{}", finalId, triggerPrice, profitId);
                        });
            }
            log.info("[OKX] 止损单已全部挂完, 空仓止损: 2~11, 多仓止损: -2~-11");
            state = StrategyState.ACTIVE;
        }
    }
    private void generateShortQueue() {
        shortPriceQueue.clear();
        int prec = config.getPriceScale();
        BigDecimal step = shortBaseEntryPrice.multiply(config.getGridRate()).setScale(prec, RoundingMode.HALF_UP);
        config.setStep(step);
        BigDecimal elem = shortBaseEntryPrice.subtract(step).setScale(prec, RoundingMode.HALF_UP);
        for (int i = 0; i < config.getGridQueueSize(); i++) {
            shortPriceQueue.add(elem);
            elem = elem.subtract(step).setScale(prec, RoundingMode.HALF_UP);
            if (elem.compareTo(BigDecimal.ZERO) <= 0) break;
        }
        shortPriceQueue.sort((a, b) -> b.compareTo(a));
        log.info("[OKX] 空队列:{}", shortPriceQueue);
    }
    private void generateLongQueue() {
        longPriceQueue.clear();
        int prec = config.getPriceScale();
        BigDecimal step = config.getStep();
        BigDecimal elem = shortBaseEntryPrice.add(step).setScale(prec, RoundingMode.HALF_UP);
        for (int i = 0; i < config.getGridQueueSize(); i++) {
            longPriceQueue.add(elem);
            elem = elem.add(step).setScale(prec, RoundingMode.HALF_UP);
        }
        longPriceQueue.sort(BigDecimal::compareTo);
        log.info("[OKX] 多队列:{}", longPriceQueue);
    }
    private void updateGridElements() {
        List<OkxGridElement> elements = new ArrayList<>();
        int shortSize = shortPriceQueue.size();
        int longSize = longPriceQueue.size();
        int prec = config.getPriceScale();
        BigDecimal step = config.getStep();
        String qty = config.getQuantity();
        // 空仓队列: id=-1, -2, ...
        for (int i = 0; i < shortSize; i++) {
            int id = -(i + 1);
            Integer upId = (i == 0) ? 0 : id + 1;
            Integer downId = (i == shortSize - 1) ? null : id - 1;
            BigDecimal price = shortPriceQueue.get(i);
            OkxTraderParam longParam = OkxTraderParam.builder()
                    .direction(OkxTraderParam.Direction.LONG)
                    .entryPrice(price).takeProfitPrice(price.add(step).setScale(prec, RoundingMode.HALF_UP)).quantity(qty).build();
            OkxTraderParam shortParam = OkxTraderParam.builder()
                    .direction(OkxTraderParam.Direction.SHORT)
                    .entryPrice(price).takeProfitPrice(price.subtract(step).setScale(prec, RoundingMode.HALF_UP)).quantity(qty).build();
            elements.add(OkxGridElement.builder().id(id).gridPrice(price).upId(upId).downId(downId)
                    .longTraderParam(longParam).shortTraderParam(shortParam).build());
        }
        // 位置 0: 基底价格
        {
            BigDecimal price = shortBaseEntryPrice;
            OkxTraderParam longParam = OkxTraderParam.builder()
                    .direction(OkxTraderParam.Direction.LONG)
                    .entryPrice(price).takeProfitPrice(price.add(step).setScale(prec, RoundingMode.HALF_UP)).quantity(qty).build();
            OkxTraderParam shortParam = OkxTraderParam.builder()
                    .direction(OkxTraderParam.Direction.SHORT)
                    .entryPrice(price).takeProfitPrice(price.subtract(step).setScale(prec, RoundingMode.HALF_UP)).quantity(qty).build();
            elements.add(OkxGridElement.builder().id(0).gridPrice(price)
                    .upId(shortSize > 0 ? 1 : null).downId(longSize > 0 ? -1 : null)
                    .longTraderParam(longParam).shortTraderParam(shortParam).build());
        }
        // 多仓队列: id=1, 2, ...
        for (int i = 0; i < longSize; i++) {
            int id = i + 1;
            Integer downId = (i == 0) ? 0 : id - 1;
            Integer upId = (i == longSize - 1) ? null : id + 1;
            BigDecimal price = longPriceQueue.get(i);
            OkxTraderParam longParam = OkxTraderParam.builder()
                    .direction(OkxTraderParam.Direction.LONG)
                    .entryPrice(price).takeProfitPrice(price.add(step).setScale(prec, RoundingMode.HALF_UP)).quantity(qty).build();
            OkxTraderParam shortParam = OkxTraderParam.builder()
                    .direction(OkxTraderParam.Direction.SHORT)
                    .entryPrice(price).takeProfitPrice(price.subtract(step).setScale(prec, RoundingMode.HALF_UP)).quantity(qty).build();
            elements.add(OkxGridElement.builder().id(id).gridPrice(price).upId(upId).downId(downId)
                    .longTraderParam(longParam).shortTraderParam(shortParam).build());
        }
        config.setGridElements(elements);
        log.info("[OKX] 网格元素列表已构建, 共{}个元素", elements.size());
    }
    // ---- 止损触发处理 ----
    /**
     * 多仓止损触发处理(Gate 模式逐步缩进)。
     * 止损触发后向基底方向缩进 1 格挂条件多单,数量 = |触发价 - 当前持仓均价| / 网格步长,取整。
     * 若 N>2,先取消上一步的旧挂单。
     */
    private void handleLongStopLossTriggered(OkxGridElement gridElement) {
        int gridId = gridElement.getId();
        int N = Math.abs(gridId);
        gridElement.setLongStopLossOrderId(null);
        log.info("[OKX] 多仓止损触发 gridId:{}, 逐步缩进", gridId);
        int newEntryGridId = -(N - 1);
        OkxGridElement newEntryGrid = OkxGridElement.findById(newEntryGridId);
        if (newEntryGrid == null) {
            OkxGridElement.refreshIndices();
            log.warn("[OKX] 多仓止损触发 gridId:{} 找不到入单网格({})", gridId, newEntryGridId);
            return;
        }
        if (N > 2) {
            int cancelGridId = -(N - 2);
            OkxGridElement cancelGrid = OkxGridElement.findById(cancelGridId);
            if (cancelGrid != null && cancelGrid.isHasLongOrder()) {
                executor.cancelAlgoOrder(cancelGrid.getLongOrderId(), oid -> {
                    longEntryTraderIdParam(cancelGrid, null, false);
                    log.info("[OKX] 多仓止损触发, 取消gridId:{}的多单", cancelGridId);
                });
            }
        }
        BigDecimal triggerPrice = newEntryGrid.getGridPrice();
        BigDecimal priceDiff = longEntryPrice.subtract(triggerPrice).abs();
        int entryQty = priceDiff.divide(config.getStep(), 0, RoundingMode.DOWN).intValue();
        entryQty = Math.max(1, entryQty);
        String size = String.valueOf(entryQty);
        log.info("[OKX] 多仓止损触发 gridId:{}, 在gridId:{}挂{}张多单", gridId, newEntryGridId, entryQty);
        newEntryGrid.getLongTraderParam().setQuantity(size);
        placeEntryOrderWithPreFlag(newEntryGrid, true, triggerPrice, size);
    }
    /**
     * 空仓止损触发处理(Gate 模式逐步缩进)。
     * 止损触发后向基底方向缩进 1 格挂条件空单,数量 = |触发价 - 当前持仓均价| / 网格步长,取整。
     * 若 N>2,先取消上一步的旧挂单。
     */
    private void handleShortStopLossTriggered(OkxGridElement gridElement) {
        int gridId = gridElement.getId();
        int N = gridId;
        gridElement.setShortStopLossOrderId(null);
        log.info("[OKX] 空仓止损触发 gridId:{}, 逐步缩进", gridId);
        int newEntryGridId = N - 1;
        OkxGridElement newEntryGrid = OkxGridElement.findById(newEntryGridId);
        if (newEntryGrid == null) {
            OkxGridElement.refreshIndices();
            log.warn("[OKX] 空仓止损触发 gridId:{} 找不到入单网格({})", gridId, newEntryGridId);
            return;
        }
        if (N > 2) {
            int cancelGridId = N - 2;
            OkxGridElement cancelGrid = OkxGridElement.findById(cancelGridId);
            if (cancelGrid != null && cancelGrid.isHasShortOrder()) {
                executor.cancelAlgoOrder(cancelGrid.getShortOrderId(), oid -> {
                    shortEntryTraderIdParam(cancelGrid, null, false);
                    log.info("[OKX] 空仓止损触发, 取消gridId:{}的空单", cancelGridId);
                });
            }
        }
        BigDecimal triggerPrice = newEntryGrid.getGridPrice();
        BigDecimal priceDiff = shortEntryPrice.subtract(triggerPrice).abs();
        int entryQty = priceDiff.divide(config.getStep(), 0, RoundingMode.DOWN).intValue();
        entryQty = Math.max(1, entryQty);
        String size = String.valueOf(entryQty);
        log.info("[OKX] 空仓止损触发 gridId:{}, 在gridId:{}挂{}张空单", gridId, newEntryGridId, entryQty);
        newEntryGrid.getShortTraderParam().setQuantity(size);
        placeEntryOrderWithPreFlag(newEntryGrid, false, triggerPrice, size);
    }
    private void extendLongStopLoss(int filledQty) {
        int furthestSlId = 0;
        for (OkxGridElement e : config.getGridElements()) {
            if (e.getLongStopLossOrderId() != null && e.getId() < furthestSlId) {
                furthestSlId = e.getId();
            }
        }
        if (furthestSlId == 0) furthestSlId = -11;
        log.info("[OKX] 多仓追挂止损, 当前最远止损gridId:{}, 追加{}张", furthestSlId, filledQty);
        for (int i = 0; i < filledQty; i++) {
            int newSlId = furthestSlId - i - 1;
            OkxGridElement elem = OkxGridElement.findById(newSlId);
            if (elem == null) continue;
            BigDecimal triggerPrice = elem.getGridPrice();
            int finalSlId = newSlId;
            executor.placeTakeProfit(triggerPrice.toString(), "sell", "long", "1",
                    profitId -> {
                        elem.setLongStopLossOrderId(profitId);
                        OkxGridElement.refreshIndices();
                        log.info("[OKX] 多仓止损追加, gridId:{}, 触发价:{}, stopLossId:{}", finalSlId, triggerPrice, profitId);
                    });
        }
    }
    private void extendShortStopLoss(int filledQty) {
        int furthestSlId = 0;
        for (OkxGridElement e : config.getGridElements()) {
            if (e.getShortStopLossOrderId() != null && e.getId() > furthestSlId) {
                furthestSlId = e.getId();
            }
        }
        if (furthestSlId == 0) furthestSlId = 11;
        log.info("[OKX] 空仓追挂止损, 当前最远止损gridId:{}, 追加{}张", furthestSlId, filledQty);
        for (int i = 0; i < filledQty; i++) {
            int newSlId = furthestSlId + i + 1;
            OkxGridElement elem = OkxGridElement.findById(newSlId);
            if (elem == null) continue;
            BigDecimal triggerPrice = elem.getGridPrice();
            int finalSlId = newSlId;
            executor.placeTakeProfit(triggerPrice.toString(), "buy", "short", "1",
                    profitId -> {
                        elem.setShortStopLossOrderId(profitId);
                        OkxGridElement.refreshIndices();
                        log.info("[OKX] 空仓止损追加, gridId:{}, 触发价:{}, stopLossId:{}", finalSlId, triggerPrice, profitId);
                    });
        }
    }
    // ---- 辅助方法 ----
    private void longTakeProfitTraderIdParam(OkxGridElement baseElement, String profitId, boolean flag) {
        OkxTraderParam tp = baseElement.getLongTraderParam();
        tp.setTakeProfitOrderId(profitId);
        tp.setTakeProfitPlaced(flag);
        baseElement.setLongTakeProfitOrderId(profitId);
        OkxGridElement.refreshIndices();
    }
    private void shortTakeProfitTraderIdParam(OkxGridElement baseElement, String profitId, boolean flag) {
        OkxTraderParam tp = baseElement.getShortTraderParam();
        tp.setTakeProfitOrderId(profitId);
        tp.setTakeProfitPlaced(flag);
        baseElement.setShortTakeProfitOrderId(profitId);
        OkxGridElement.refreshIndices();
    }
    private void longEntryTraderIdParam(OkxGridElement baseElement, String entryId, boolean flag) {
        OkxTraderParam tp = baseElement.getLongTraderParam();
        tp.setEntryOrderId(entryId);
        tp.setEntryOrderPlaced(flag);
        baseElement.setHasLongOrder(flag);
        baseElement.setLongOrderId(entryId);
        OkxGridElement.refreshIndices();
    }
    private void shortEntryTraderIdParam(OkxGridElement baseElement, String entryId, boolean flag) {
        OkxTraderParam tp = baseElement.getShortTraderParam();
        tp.setEntryOrderId(entryId);
        tp.setEntryOrderPlaced(flag);
        baseElement.setHasShortOrder(flag);
        baseElement.setShortOrderId(entryId);
        OkxGridElement.refreshIndices();
    }
    private void placeEntryOrderWithPreFlag(OkxGridElement gridElement, boolean isLong,
                                             BigDecimal triggerPrice, String size) {
        if (isLong) {
            gridElement.setHasLongOrder(true);
        } else {
            gridElement.setHasShortOrder(true);
        }
        String side = isLong ? "buy" : "sell";
        String posSide = isLong ? "long" : "short";
        executor.placeConditionalEntryOrder(triggerPrice.toString(), side, posSide, size,
                orderId -> {
                    if (isLong) {
                        longEntryTraderIdParam(gridElement, orderId, true);
                    } else {
                        shortEntryTraderIdParam(gridElement, orderId, true);
                    }
                },
                () -> {
                    if (isLong) {
                        gridElement.setHasLongOrder(false);
                        gridElement.setLongOrderId(null);
                    } else {
                        gridElement.setHasShortOrder(false);
                        gridElement.setShortOrderId(null);
                    }
                    OkxGridElement.refreshIndices();
                    log.warn("[OKX] 条件单创建失败,回滚标志位 gridId:{}, isLong:{}", gridElement.getId(), isLong);
                }
        );
    }
    private void updateUnrealizedPnl() {
        if (lastKlinePrice == null || lastKlinePrice.compareTo(BigDecimal.ZERO) == 0) return;
        BigDecimal multiplier = config.getCtVal();
        BigDecimal longPnl = BigDecimal.ZERO;
        BigDecimal shortPnl = BigDecimal.ZERO;
        if (longPositionSize.compareTo(BigDecimal.ZERO) > 0 && longEntryPrice.compareTo(BigDecimal.ZERO) > 0) {
            longPnl = longPositionSize.multiply(multiplier).multiply(lastKlinePrice.subtract(longEntryPrice));
        }
        if (shortPositionSize.compareTo(BigDecimal.ZERO) > 0 && shortEntryPrice.compareTo(BigDecimal.ZERO) > 0) {
            shortPnl = shortPositionSize.multiply(multiplier).multiply(shortEntryPrice.subtract(lastKlinePrice));
        }
        unrealizedPnl = longPnl.add(shortPnl);
        log.info("[OKX] 未实现盈亏: {}", unrealizedPnl);
    }
    private boolean isMarginSafe() {
        try {
            String balanceResp = executor.getBalance();
            if (balanceResp == null) return true;
            JSONObject json = JSON.parseObject(balanceResp);
            if (!"0".equals(json.getString("code"))) return true;
            JSONArray data = json.getJSONArray("data");
            if (data == null || data.isEmpty()) return true;
            JSONObject detail = data.getJSONObject(0);
            String imr = detail.getString("imr");
            if (imr == null) return true;
            BigDecimal margin = new BigDecimal(imr);
            if (initialPrincipal.compareTo(BigDecimal.ZERO) == 0) return true;
            BigDecimal ratio = margin.divide(initialPrincipal, 4, RoundingMode.HALF_UP);
            log.debug("[OKX] 保证金比例: {}/{}={}", margin, initialPrincipal, ratio);
            return ratio.compareTo(config.getMarginRatioLimit()) < 0;
        } catch (Exception e) {
            log.warn("[OKX] 查保证金失败,默认放行", e);
            return true;
        }
    }
    private void checkProfitAndReset() {
        try {
            String balanceResp = executor.getBalance();
            if (balanceResp == null) return;
            JSONObject json = JSON.parseObject(balanceResp);
            if (!"0".equals(json.getString("code"))) return;
            JSONArray data = json.getJSONArray("data");
            if (data == null || data.isEmpty()) return;
            JSONObject detail = data.getJSONObject(0);
            String upl = detail.getString("upl");
            String availEq = detail.getString("availEq");
            if (upl == null || availEq == null) return;
            BigDecimal unrealisedPnl = new BigDecimal(upl);
            BigDecimal available = new BigDecimal(availEq);
            BigDecimal totalEquity = unrealisedPnl.add(available);
            BigDecimal target = initialPrincipal.add(config.getExpectedProfit());
            log.info("[OKX] 盈亏检查 upl:{}, availEq:{}, 合计:{}, 目标:{}", unrealisedPnl, available, totalEquity, target);
            if (totalEquity.compareTo(target) > 0) {
                log.info("[OKX] 盈亏达标({}>{}),重置策略", totalEquity, target);
                state = StrategyState.STOPPED;
                closeExistingPositions();
                executor.cancelAllAlgoOrders();
                startGrid();
            }
        } catch (Exception e) {
            log.warn("[OKX] 盈亏检查失败", e);
        }
    }
    private void handlePositionZeroAndReset(String direction) {
        state = StrategyState.STOPPED;
        executor.cancelAllAlgoOrders();
        closeExistingPositions();
        startGrid();
    }
    // ---- getters ----
    public BigDecimal getLastKlinePrice() { return lastKlinePrice; }
    public boolean isStrategyActive() { return state != StrategyState.STOPPED && state != StrategyState.WAITING_KLINE; }
    public BigDecimal getCumulativePnl() { return cumulativePnl; }
    public BigDecimal getUnrealizedPnl() { return unrealizedPnl; }
    public StrategyState getState() { return state; }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxGridWsClient.java
New file
@@ -0,0 +1,282 @@
package com.xcong.excoin.modules.okxNewPrice;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.modules.okxNewPrice.gridWs.OkxGridChannelHandler;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.SignUtils;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.SSLConfig;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
/**
 * OKX 网格交易专用 WebSocket 客户端,对齐 Gate 的 GateKlineWebSocketClient 模式。
 *
 * <h3>职责</h3>
 * 负责 TCP 连接的建立、维持和恢复。频道逻辑(订阅/解析)全部委托给
 * {@link OkxGridChannelHandler} 实现类。
 *
 * <h3>生命周期</h3>
 * <pre>
 *   init()        → connect() → login() → subscribe handlers → startHeartbeat()
 *   destroy()     → unsubscribe 所有 handler → closeBlocking() → shutdown 线程池
 *   onClose()     → reconnectWithBackoff() (最多 3 次,指数退避)
 * </pre>
 *
 * @author Administrator
 */
@Slf4j
public class OkxGridWsClient {
    private static final int HEARTBEAT_TIMEOUT = 10;
    /** 模拟盘 WS 地址 */
    private static final String WS_URL_SIM = "wss://wspap.okx.com:8443/ws/v5/private";
    /** 实盘 WS 地址 */
    private static final String WS_URL_PROD = "wss://ws.okx.com:8443/ws/v5/private";
    private final ExchangeInfoEnum account;
    private WebSocketClient webSocketClient;
    private ScheduledExecutorService heartbeatExecutor;
    private volatile ScheduledFuture<?> pongTimeoutFuture;
    private final AtomicReference<Long> lastMessageTime = new AtomicReference<>(System.currentTimeMillis());
    private final AtomicBoolean isConnected = new AtomicBoolean(false);
    private final AtomicBoolean isConnecting = new AtomicBoolean(false);
    private final AtomicBoolean isInitialized = new AtomicBoolean(false);
    /** 频道处理器列表 */
    private final List<OkxGridChannelHandler> channelHandlers = new ArrayList<>();
    /** 共享线程池 */
    private final ExecutorService sharedExecutor = Executors.newCachedThreadPool(r -> {
        Thread t = new Thread(r, "okx-grid-ws-worker");
        t.setDaemon(true);
        return t;
    });
    public OkxGridWsClient(ExchangeInfoEnum account) {
        this.account = account;
    }
    public void addChannelHandler(OkxGridChannelHandler handler) {
        channelHandlers.add(handler);
    }
    public void init() {
        if (!isInitialized.compareAndSet(false, true)) {
            log.warn("[OKX-Grid-WS] 已初始化过,跳过重复初始化");
            return;
        }
        connect();
        startHeartbeat();
    }
    public void destroy() {
        log.info("[OKX-Grid-WS] 开始销毁...");
        if (webSocketClient != null && webSocketClient.isOpen()) {
            for (OkxGridChannelHandler handler : channelHandlers) {
                handler.unsubscribe(webSocketClient);
            }
            try { Thread.sleep(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }
        }
        if (webSocketClient != null && webSocketClient.isOpen()) {
            try {
                webSocketClient.closeBlocking();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
        shutdownExecutorGracefully(heartbeatExecutor);
        if (pongTimeoutFuture != null) pongTimeoutFuture.cancel(true);
        shutdownExecutorGracefully(sharedExecutor);
        log.info("[OKX-Grid-WS] 销毁完成");
    }
    private void connect() {
        if (isConnecting.get() || !isConnecting.compareAndSet(false, true)) {
            log.info("[OKX-Grid-WS] 连接进行中,跳过重复请求");
            return;
        }
        try {
            SSLConfig.configureSSL();
            System.setProperty("https.protocols", "TLSv1.2,TLSv1.3");
            String wsUrl = account.isAccountType() ? WS_URL_PROD : WS_URL_SIM;
            URI uri = new URI(wsUrl);
            if (webSocketClient != null) {
                try { webSocketClient.closeBlocking(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }
            }
            webSocketClient = new WebSocketClient(uri) {
                @Override
                public void onOpen(ServerHandshake handshake) {
                    log.info("[OKX-Grid-WS] 连接成功");
                    isConnected.set(true);
                    isConnecting.set(false);
                    if (sharedExecutor != null && !sharedExecutor.isShutdown()) {
                        resetHeartbeatTimer();
                        wsLogin();
                    }
                }
                @Override
                public void onMessage(String message) {
                    lastMessageTime.set(System.currentTimeMillis());
                    handleMessage(message);
                    resetHeartbeatTimer();
                }
                @Override
                public void onClose(int code, String reason, boolean remote) {
                    log.warn("[OKX-Grid-WS] 连接关闭, code:{}, reason:{}", code, reason);
                    isConnected.set(false);
                    isConnecting.set(false);
                    cancelPongTimeout();
                    if (sharedExecutor != null && !sharedExecutor.isShutdown() && !sharedExecutor.isTerminated()) {
                        sharedExecutor.execute(() -> {
                            try { reconnectWithBackoff(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (Exception e) { log.error("[OKX-Grid-WS] 重连失败", e); }
                        });
                    }
                }
                @Override
                public void onError(Exception ex) {
                    log.error("[OKX-Grid-WS] 发生错误", ex);
                    isConnected.set(false);
                }
            };
            webSocketClient.connect();
        } catch (URISyntaxException e) {
            log.error("[OKX-Grid-WS] URI格式错误", e);
            isConnecting.set(false);
        }
    }
    /**
     * WebSocket 登录认证
     */
    private void wsLogin() {
        try {
            String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
            String sign = SignUtils.signWebsocket(timestamp, account.getSecretKey());
            JSONObject msg = new JSONObject();
            msg.put("op", "login");
            com.alibaba.fastjson.JSONArray args = new com.alibaba.fastjson.JSONArray();
            JSONObject loginArgs = new JSONObject();
            loginArgs.put("apiKey", account.getApiKey());
            loginArgs.put("passphrase", account.getPassphrase());
            loginArgs.put("timestamp", timestamp);
            loginArgs.put("sign", sign);
            args.add(loginArgs);
            msg.put("args", args);
            webSocketClient.send(msg.toJSONString());
            log.info("[OKX-Grid-WS] 发送登录请求");
        } catch (Exception e) {
            log.error("[OKX-Grid-WS] 登录请求构建失败", e);
        }
    }
    private void handleMessage(String message) {
        try {
            JSONObject response = JSON.parseObject(message);
            String event = response.getString("event");
            String op = response.getString("op");
            // 登录成功 → 订阅所有频道
            if ("login".equals(event) || ("login".equals(op))) {
                log.info("[OKX-Grid-WS] 登录成功, 开始订阅频道");
                for (OkxGridChannelHandler handler : channelHandlers) {
                    handler.subscribe(webSocketClient);
                }
                return;
            }
            // 订阅确认
            if ("subscribe".equals(event) || "unsubscribe".equals(event)) {
                log.info("[OKX-Grid-WS] {}事件: {}", event, response.getString("arg"));
                return;
            }
            // 错误
            if ("error".equals(event)) {
                log.error("[OKX-Grid-WS] 错误: {}", message);
                return;
            }
            // 数据推送 → 路由到 handler
            for (OkxGridChannelHandler handler : channelHandlers) {
                if (handler.handleMessage(response)) return;
            }
        } catch (Exception e) {
            log.error("[OKX-Grid-WS] 处理消息失败: {}", message, e);
        }
    }
    // ---- heartbeat ----
    private void startHeartbeat() {
        if (heartbeatExecutor != null && !heartbeatExecutor.isTerminated()) heartbeatExecutor.shutdownNow();
        heartbeatExecutor = Executors.newSingleThreadScheduledExecutor(r -> {
            Thread t = new Thread(r, "okx-grid-ws-heartbeat");
            t.setDaemon(true);
            return t;
        });
        heartbeatExecutor.scheduleWithFixedDelay(this::checkHeartbeatTimeout, 25, 25, TimeUnit.SECONDS);
    }
    private synchronized void resetHeartbeatTimer() {
        cancelPongTimeout();
        if (heartbeatExecutor != null && !heartbeatExecutor.isShutdown()) {
            pongTimeoutFuture = heartbeatExecutor.schedule(this::sendPing, HEARTBEAT_TIMEOUT, TimeUnit.SECONDS);
        }
    }
    private void checkHeartbeatTimeout() {
        if (!isConnected.get()) return;
        if (System.currentTimeMillis() - lastMessageTime.get() >= HEARTBEAT_TIMEOUT * 1000L) sendPing();
    }
    private void sendPing() {
        try {
            if (webSocketClient != null && webSocketClient.isOpen()) {
                webSocketClient.send("ping");
                log.debug("[OKX-Grid-WS] 发送 ping");
            }
        } catch (Exception e) { log.warn("[OKX-Grid-WS] 发送 ping 失败", e); }
    }
    private synchronized void cancelPongTimeout() {
        if (pongTimeoutFuture != null && !pongTimeoutFuture.isDone()) pongTimeoutFuture.cancel(true);
    }
    private void reconnectWithBackoff() throws InterruptedException {
        int attempt = 0, maxAttempts = 3;
        long delayMs = 5000;
        while (attempt < maxAttempts) {
            try { Thread.sleep(delayMs); connect(); return; }
            catch (Exception e) { log.warn("[OKX-Grid-WS] 第{}次重连失败", attempt + 1, e); delayMs *= 2; attempt++; }
        }
        log.error("[OKX-Grid-WS] 超过最大重试次数({}),放弃重连", maxAttempts);
    }
    private void shutdownExecutorGracefully(ExecutorService executor) {
        if (executor == null || executor.isTerminated()) return;
        try {
            executor.shutdown();
            if (!executor.awaitTermination(5, TimeUnit.SECONDS)) executor.shutdownNow();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            executor.shutdownNow();
        }
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxKlineWebSocketClient.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxNewPriceWebSocketClient.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxTradeExecutor.java
New file
@@ -0,0 +1,383 @@
package com.xcong.excoin.modules.okxNewPrice;
import com.alibaba.fastjson.JSON;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.OKXAccount;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.enums.HttpMethod;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.OKXContants;
import lombok.extern.slf4j.Slf4j;
import java.util.LinkedHashMap;
import java.util.concurrent.*;
import java.util.function.Consumer;
/**
 * OKX REST API 异步执行器,所有下单/撤单操作经此类提交。
 *
 * <h3>设计目的</h3>
 * REST API 调用可能耗时数百毫秒,若在 WebSocket 回调线程中同步执行会阻塞消息处理。
 * 本类将所有网络 I/O 提交到独立单线程池异步执行。
 *
 * <h3>线程模型</h3>
 * <ul>
 *   <li><b>单线程 + 有界队列(64)</b> — 保证下单顺序,避免并发竞争</li>
 *   <li><b>CallerRunsPolicy</b> — 队列满时由提交线程直接执行,形成自然背压</li>
 *   <li><b>Daemon 线程</b> — 60s 空闲自动回收</li>
 * </ul>
 *
 * <h3>OKX API 适配说明</h3>
 * OKX 使用 algo order(条件单)代替 Gate 的 FuturesPriceTriggeredOrder:
 * <ul>
 *   <li>开仓条件单:ordType=conditional, side=buy/sell, posSide=long/short</li>
 *   <li>止盈止损单:可通过订单附带的 tpTriggerPx/slTriggerPx 或单独的 algo order 实现</li>
 *   <li>市价单:ordType=market, price不传</li>
 * </ul>
 *
 * @author Administrator
 */
@Slf4j
public class OkxTradeExecutor {
    /** OKX 账户配置(用于 REST API 调用) */
    private final OKXAccount okxAccount;
    /** 合约名称(如 ETH-USDT-SWAP) */
    private final String instId;
    /** 保证金模式 */
    private final String tdMode;
    /** 交易线程池:单线程 + 有界队列 + 背压策略 */
    private final ExecutorService executor;
    public OkxTradeExecutor(OKXAccount okxAccount, String instId, String tdMode) {
        this.okxAccount = okxAccount;
        this.instId = instId;
        this.tdMode = tdMode;
        this.executor = new ThreadPoolExecutor(
                1, 1,
                60L, TimeUnit.SECONDS,
                new LinkedBlockingQueue<>(64),
                r -> {
                    Thread t = new Thread(r, "okx-trade-worker");
                    t.setDaemon(true);
                    return t;
                },
                new ThreadPoolExecutor.CallerRunsPolicy()
        );
        ((ThreadPoolExecutor) executor).allowCoreThreadTimeOut(true);
    }
    /**
     * 优雅关闭:等待 10 秒让队列中的任务执行完毕,超时则强制中断。
     */
    public void shutdown() {
        executor.shutdown();
        try {
            executor.awaitTermination(10, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            executor.shutdownNow();
        }
    }
    /**
     * 异步 IOC 市价开多。
     *
     * @param quantity  开仓张数(正数)
     * @param onSuccess 成功回调,接收 orderId
     * @param onFailure 失败回调
     */
    public void openLong(String quantity, Consumer<String> onSuccess, Runnable onFailure) {
        submitOrder("buy", "long", quantity, "market", null, false, "t-okx-grid-long", onSuccess, onFailure);
    }
    /**
     * 异步 IOC 市价开空。
     *
     * @param quantity  开仓张数(正数)
     * @param onSuccess 成功回调,接收 orderId
     * @param onFailure 失败回调
     */
    public void openShort(String quantity, Consumer<String> onSuccess, Runnable onFailure) {
        submitOrder("sell", "short", quantity, "market", null, false, "t-okx-grid-short", onSuccess, onFailure);
    }
    /**
     * 异步市价平仓(reduceOnly=true)。
     *
     * @param side      "buy" 平空 / "sell" 平多
     * @param posSide   "long" / "short"
     * @param quantity  平仓张数(正数)
     */
    public void marketClose(String side, String posSide, String quantity) {
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = buildBaseParams(side, posSide, quantity, "market");
                params.put("reduceOnly", true);
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, OKXContants.ORDER, params, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 市价平仓成功, side:{}, posSide:{}, sz:{}, resp:{}", side, posSide, quantity, resp);
            } catch (Exception e) {
                log.error("[OkxExec] 市价平仓失败, side:{}, posSide:{}, sz:{}", side, posSide, quantity, e);
            }
        });
    }
    /**
     * 异步创建条件开仓单(价格触发后市价开仓)。
     * OKX 使用 algo order: /api/v5/trade/order-algo, ordType=conditional
     *
     * @param triggerPrice 触发价格
     * @param side         "buy" 开多 / "sell" 开空
     * @param posSide      "long" / "short"
     * @param size         开仓张数
     * @param onSuccess    成功回调,接收 algoId
     * @param onFailure    失败回调
     */
    public void placeConditionalEntryOrder(String triggerPrice, String side, String posSide,
                                            String size, Consumer<String> onSuccess, Runnable onFailure) {
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = new LinkedHashMap<>();
                params.put("instId", instId);
                params.put("tdMode", tdMode);
                params.put("side", side);
                params.put("posSide", posSide);
                params.put("ordType", "conditional");
                params.put("sz", size);
                params.put("triggerPx", triggerPrice);
                params.put("triggerPxType", "last");
                params.put("orderPx", "-1"); // 市价成交
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, "/api/v5/trade/order-algo", params, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 条件开仓单已创建, trigger:{}, side:{}, posSide:{}, sz:{}, resp:{}",
                        triggerPrice, side, posSide, size, resp);
                String algoId = parseAlgoId(resp);
                if (algoId != null && onSuccess != null) {
                    onSuccess.accept(algoId);
                }
            } catch (Exception e) {
                log.error("[OkxExec] 条件开仓单创建失败, trigger:{}, side:{}, sz:{}", triggerPrice, side, size, e);
                if (onFailure != null) {
                    onFailure.run();
                }
            }
        });
    }
    /**
     * 异步创建止盈条件单。
     * 使用 algo order: ordType=conditional, 触发后市价平仓 (reduceOnly=true)
     *
     * @param triggerPrice 止盈触发价
     * @param side         "sell" 平多 / "buy" 平空
     * @param posSide      "long" / "short"
     * @param size         平仓张数
     * @param onSuccess    成功回调,接收 algoId
     */
    public void placeTakeProfit(String triggerPrice, String side, String posSide,
                                 String size, Consumer<String> onSuccess) {
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = new LinkedHashMap<>();
                params.put("instId", instId);
                params.put("tdMode", tdMode);
                params.put("side", side);
                params.put("posSide", posSide);
                params.put("ordType", "conditional");
                params.put("sz", size);
                params.put("triggerPx", triggerPrice);
                params.put("triggerPxType", "last");
                params.put("orderPx", "-1"); // 市价成交
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, "/api/v5/trade/order-algo", params, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 止盈单已创建, trigger:{}, side:{}, posSide:{}, sz:{}, resp:{}",
                        triggerPrice, side, posSide, size, resp);
                String algoId = parseAlgoId(resp);
                if (algoId != null && onSuccess != null) {
                    onSuccess.accept(algoId);
                }
            } catch (Exception e) {
                log.error("[OkxExec] 止盈单创建失败, trigger:{}, side:{}, sz:{}, 立即市价止盈",
                        triggerPrice, side, size, e);
                // 止盈单创建失败 → 立即市价平仓
                marketClose(side, posSide, size);
            }
        });
    }
    /**
     * 异步取消单个条件单(algo order)。
     *
     * @param algoId 条件单 ID,为 null 时跳过
     */
    public void cancelAlgoOrder(String algoId, Consumer<String> onSuccess) {
        if (algoId == null) {
            return;
        }
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = new LinkedHashMap<>();
                params.put("instId", instId);
                params.put("algoId", algoId);
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, "/api/v5/trade/cancel-algos", params, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 条件单已取消, algoId:{}", algoId);
                if (onSuccess != null) {
                    onSuccess.accept(algoId);
                }
            } catch (Exception e) {
                log.warn("[OkxExec] 取消条件单失败(可能已触发), algoId:{}", algoId);
            }
        });
    }
    /**
     * 异步取消所有未完成的 algo 订单。
     */
    public void cancelAllAlgoOrders() {
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = new LinkedHashMap<>();
                params.put("instId", instId);
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, "/api/v5/trade/cancel-algos", params, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 已尝试清除条件单, resp:{}", resp);
            } catch (Exception e) {
                log.error("[OkxExec] 清除条件单失败", e);
            }
        });
    }
    /**
     * 查询账户余额(同步方法,在策略线程中调用)。
     */
    public String getBalance() {
        try {
            LinkedHashMap<String, Object> params = new LinkedHashMap<>();
            params.put("ccy", "USDT");
            return okxAccount.requestHandler.sendSignedRequest(
                    okxAccount.baseUrl, OKXContants.BALANCE, params, HttpMethod.GET, okxAccount.isSimluate());
        } catch (Exception e) {
            log.error("[OkxExec] 查询余额失败", e);
            return null;
        }
    }
    /**
     * 查询持仓信息(同步方法)。
     */
    public String getPositions() {
        try {
            LinkedHashMap<String, Object> params = new LinkedHashMap<>();
            params.put("instId", instId);
            return okxAccount.requestHandler.sendSignedRequest(
                    okxAccount.baseUrl, OKXContants.POSITIONS, params, HttpMethod.GET, okxAccount.isSimluate());
        } catch (Exception e) {
            log.error("[OkxExec] 查询持仓失败", e);
            return null;
        }
    }
    /**
     * 设置杠杆倍数(同步方法)。
     */
    public void setLeverage(String leverage) {
        try {
            LinkedHashMap<String, Object> params = new LinkedHashMap<>();
            params.put("instId", instId);
            params.put("lever", leverage);
            params.put("mgnMode", tdMode);
            String resp = okxAccount.requestHandler.sendSignedRequest(
                    okxAccount.baseUrl, OKXContants.SETLEVERAGE, params, HttpMethod.POST, okxAccount.isSimluate());
            log.info("[OkxExec] 设置杠杆成功, lever:{}, resp:{}", leverage, resp);
        } catch (Exception e) {
            log.error("[OkxExec] 设置杠杆失败, lever:{}", leverage, e);
        }
    }
    // ==================== 私有方法 ====================
    private LinkedHashMap<String, Object> buildBaseParams(String side, String posSide, String sz, String ordType) {
        LinkedHashMap<String, Object> params = new LinkedHashMap<>();
        params.put("instId", instId);
        params.put("tdMode", tdMode);
        params.put("side", side);
        params.put("posSide", posSide);
        params.put("ordType", ordType);
        params.put("sz", sz);
        return params;
    }
    private void submitOrder(String side, String posSide, String quantity, String ordType,
                              String price, boolean reduceOnly, String tag,
                              Consumer<String> onSuccess, Runnable onFailure) {
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = buildBaseParams(side, posSide, quantity, ordType);
                if (price != null) {
                    params.put("px", price);
                }
                if (reduceOnly) {
                    params.put("reduceOnly", true);
                }
                if (tag != null) {
                    params.put("tag", tag);
                }
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, OKXContants.ORDER, params, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 下单成功, side:{}, posSide:{}, sz:{}, ordType:{}, resp:{}",
                        side, posSide, quantity, ordType, resp);
                String orderId = parseOrderId(resp);
                if (orderId != null && onSuccess != null) {
                    onSuccess.accept(orderId);
                }
            } catch (Exception e) {
                log.error("[OkxExec] 下单失败, side:{}, posSide:{}, sz:{}", side, posSide, quantity, e);
                if (onFailure != null) {
                    onFailure.run();
                }
            }
        });
    }
    /**
     * 从 OKX 响应中解析订单 ID。
     * 响应格式: {"code":"0","data":[{"ordId":"xxx",...}]}
     */
    private String parseOrderId(String resp) {
        try {
            com.alibaba.fastjson.JSONObject json = JSON.parseObject(resp);
            if ("0".equals(json.getString("code"))) {
                com.alibaba.fastjson.JSONArray data = json.getJSONArray("data");
                if (data != null && !data.isEmpty()) {
                    return data.getJSONObject(0).getString("ordId");
                }
            }
        } catch (Exception e) {
            log.warn("[OkxExec] 解析订单ID失败, resp:{}", resp);
        }
        return null;
    }
    /**
     * 从 OKX 响应中解析 algo 订单 ID。
     */
    private String parseAlgoId(String resp) {
        try {
            com.alibaba.fastjson.JSONObject json = JSON.parseObject(resp);
            if ("0".equals(json.getString("code"))) {
                com.alibaba.fastjson.JSONArray data = json.getJSONArray("data");
                if (data != null && !data.isEmpty()) {
                    return data.getJSONObject(0).getString("algoId");
                }
            }
        } catch (Exception e) {
            log.warn("[OkxExec] 解析algoId失败, resp:{}", resp);
        }
        return null;
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxTraderParam.java
New file
@@ -0,0 +1,102 @@
package com.xcong.excoin.modules.okxNewPrice;
import java.math.BigDecimal;
/**
 * 单笔挂单的完整参数,封装条件开仓单及止盈单的状态。
 *
 * <h3>定位</h3>
 * 每个 OkxGridElement 内嵌两个 OkxTraderParam(longTraderParam / shortTraderParam),
 * 分别记录该价格层级上多仓和空仓的挂单参数。
 *
 * <h3>字段分组</h3>
 * <table>
 *   <tr><th>类别</th><th>字段</th><th>生命周期</th></tr>
 *   <tr><td>开仓准备</td><td>direction, entryPrice, quantity</td><td>updateGridElements() 预填充</td></tr>
 *   <tr><td>止盈预定</td><td>takeProfitPrice</td><td>updateGridElements() 预填充</td></tr>
 *   <tr><td>挂单确认</td><td>entryOrderPlaced, entryOrderId</td><td>条件单挂成功后写入</td></tr>
 *   <tr><td>止盈确认</td><td>takeProfitPlaced, takeProfitOrderId</td><td>止盈单挂成功后写入</td></tr>
 * </table>
 *
 * @author Administrator
 */
public class OkxTraderParam {
    public enum Direction {
        LONG,
        SHORT
    }
    /** 交易方向 */
    private Direction direction;
    /** 下单数量(合约张数) */
    private String quantity;
    /** 条件开仓触发价 */
    private BigDecimal entryPrice;
    /** 挂单(条件开仓单)订单 ID */
    private String entryOrderId;
    /** 挂单价是否挂成功 */
    private boolean entryOrderPlaced;
    /** 止盈触发价 */
    private BigDecimal takeProfitPrice;
    /** 止盈条件单(算法单)订单 ID(OKX 用 algoId) */
    private String takeProfitOrderId;
    /** 止盈价是否挂成功 */
    private boolean takeProfitPlaced;
    private OkxTraderParam(Builder builder) {
        this.direction = builder.direction;
        this.entryPrice = builder.entryPrice;
        this.takeProfitPrice = builder.takeProfitPrice;
        this.quantity = builder.quantity;
        this.takeProfitPlaced = builder.takeProfitPlaced;
        this.entryOrderPlaced = builder.entryOrderPlaced;
        this.takeProfitOrderId = builder.takeProfitOrderId;
        this.entryOrderId = builder.entryOrderId;
    }
    public Direction getDirection() { return direction; }
    public void setDirection(Direction direction) { this.direction = direction; }
    public BigDecimal getEntryPrice() { return entryPrice; }
    public void setEntryPrice(BigDecimal entryPrice) { this.entryPrice = entryPrice; }
    public BigDecimal getTakeProfitPrice() { return takeProfitPrice; }
    public void setTakeProfitPrice(BigDecimal takeProfitPrice) { this.takeProfitPrice = takeProfitPrice; }
    public String getQuantity() { return quantity; }
    public void setQuantity(String quantity) { this.quantity = quantity; }
    public String getEntryOrderId() { return entryOrderId; }
    public void setEntryOrderId(String entryOrderId) { this.entryOrderId = entryOrderId; }
    public boolean isEntryOrderPlaced() { return entryOrderPlaced; }
    public void setEntryOrderPlaced(boolean entryOrderPlaced) { this.entryOrderPlaced = entryOrderPlaced; }
    public boolean isTakeProfitPlaced() { return takeProfitPlaced; }
    public void setTakeProfitPlaced(boolean takeProfitPlaced) { this.takeProfitPlaced = takeProfitPlaced; }
    public String getTakeProfitOrderId() { return takeProfitOrderId; }
    public void setTakeProfitOrderId(String takeProfitOrderId) { this.takeProfitOrderId = takeProfitOrderId; }
    public static Builder builder() {
        return new Builder();
    }
    public static class Builder {
        private Direction direction;
        private BigDecimal entryPrice;
        private BigDecimal takeProfitPrice;
        private String quantity = "1";
        private boolean takeProfitPlaced = false;
        private boolean entryOrderPlaced = false;
        private String takeProfitOrderId;
        private String entryOrderId;
        public Builder direction(Direction direction) { this.direction = direction; return this; }
        public Builder entryPrice(BigDecimal entryPrice) { this.entryPrice = entryPrice; return this; }
        public Builder takeProfitPrice(BigDecimal takeProfitPrice) { this.takeProfitPrice = takeProfitPrice; return this; }
        public Builder quantity(String quantity) { this.quantity = quantity; return this; }
        public Builder takeProfitPlaced(boolean takeProfitPlaced) { this.takeProfitPlaced = takeProfitPlaced; return this; }
        public Builder entryOrderPlaced(boolean entryOrderPlaced) { this.entryOrderPlaced = entryOrderPlaced; return this; }
        public Builder takeProfitOrderId(String takeProfitOrderId) { this.takeProfitOrderId = takeProfitOrderId; return this; }
        public Builder entryOrderId(String entryOrderId) { this.entryOrderId = entryOrderId; return this; }
        public OkxTraderParam build() {
            return new OkxTraderParam(this);
        }
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxWebSocketClientMain.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxWebSocketClientManager.java
@@ -1,132 +1,153 @@
package com.xcong.excoin.modules.okxNewPrice;
import com.xcong.excoin.modules.okxNewPrice.celue.CaoZuoService;
import com.xcong.excoin.modules.okxNewPrice.okxWs.enums.ExchangeInfoEnum;
import com.xcong.excoin.modules.okxNewPrice.okxWs.wanggeList.WangGeListService;
import com.xcong.excoin.utils.RedisUtils;
import com.xcong.excoin.modules.okxNewPrice.gridWs.OkxAlgoOrdersChannelHandler;
import com.xcong.excoin.modules.okxNewPrice.gridWs.OkxKlineChannelHandler;
import com.xcong.excoin.modules.okxNewPrice.gridWs.OkxPositionsChannelHandler;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.OKXAccount;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.enums.DefaultUrls;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.math.BigDecimal;
/**
 * 管理多个OKX WebSocket客户端实例,每个实例对应一个账号
 * OKX 网格交易系统 Spring 容器入口 — 组件组装 + 生命周期管理。
 *
 * <h3>组装顺序({@code @PostConstruct})</h3>
 * <ol>
 *   <li>{@link OkxConfig} — 构建配置(API 密钥、合约、策略参数)</li>
 *   <li>{@link OkxGridTradeService}.init() — 获取账户 → 清条件单 → 平仓 → 设杠杆</li>
 *   <li>{@link OkxGridWsClient} — 注册 3 个频道处理器 → init():建立 WS 连接并登录订阅</li>
 *   <li>{@code gridTradeService.startGrid()} — 状态重置,等待首根 K 线</li>
 * </ol>
 *
 * <h3>3 个频道处理器</h3>
 * <ol>
 *   <li>OkxKlineChannelHandler — candle1m,K线 → onKline()</li>
 *   <li>OkxPositionsChannelHandler — positions,持仓 → onPositionUpdate()</li>
 *   <li>OkxAlgoOrdersChannelHandler — orders-algo,条件单 → onOrderUpdate()</li>
 * </ol>
 *
 * <h3>销毁顺序({@code @PreDestroy})</h3>
 * <ol>
 *   <li>gridTradeService.stopGrid():取消所有条件单 → 关闭交易线程池</li>
 *   <li>gridWsClient.destroy():取消订阅 → 断开 WS → 关闭线程池</li>
 * </ol>
 *
 * @author Administrator
 */
@Slf4j
@Component
@ConditionalOnProperty(prefix = "app", name = "quant", havingValue = "true")
public class OkxWebSocketClientManager {
    @Autowired
    private CaoZuoService caoZuoService;
    @Autowired
    private RedisUtils redisUtils;
    @Autowired
    private WangGeListService wangGeListService;
    // 存储所有OkxQuantWebSocketClient实例,key为账号类型名称
    private final Map<String, OkxQuantWebSocketClient> quantClientMap = new ConcurrentHashMap<>();
    // 存储OkxNewPriceWebSocketClient实例
    private OkxKlineWebSocketClient klinePriceClient;
    /** 网格交易 WS 客户端 */
    private OkxGridWsClient gridWsClient;
    /** 网格交易策略服务 */
    private OkxGridTradeService gridTradeService;
    /** 统一配置 */
    private OkxConfig okxConfig;
    /**
     * 初始化方法,在Spring Bean构造完成后执行
     * 创建并初始化所有账号的WebSocket客户端实例
     */
    @PostConstruct
    public void init() {
        log.info("开始初始化OkxWebSocketClientManager");
        // 初始化价格WebSocket客户端
        log.info("[OKX-Manager] 开始初始化...");
        try {
            klinePriceClient = new OkxKlineWebSocketClient(redisUtils, caoZuoService, this, wangGeListService);
            klinePriceClient.init();
            log.info("已初始化OkxNewPriceWebSocketClient");
        } catch (Exception e) {
            log.error("初始化OkxNewPriceWebSocketClient失败", e);
        }
        // 获取所有ExchangeInfoEnum枚举值
        ExchangeInfoEnum[] accounts = ExchangeInfoEnum.values();
        // 为每个账号创建一个WebSocket客户端实例
        for (ExchangeInfoEnum account : accounts) {
            try {
                OkxQuantWebSocketClient client = new OkxQuantWebSocketClient(account, caoZuoService, redisUtils);
                quantClientMap.put(account.name(), client);
                client.init();
                log.info("已初始化账号 {} 的WebSocket客户端", account.name());
            } catch (Exception e) {
                log.error("初始化账号 {} 的WebSocket客户端失败", account.name(), e);
            // 获取账户配置
            ExchangeInfoEnum[] accounts = ExchangeInfoEnum.values();
            if (accounts == null || accounts.length == 0) {
                log.error("[OKX-Manager] 无可用账户,初始化失败");
                return;
            }
            // 使用第一个账户
            ExchangeInfoEnum primaryAccount = accounts[0];
            log.info("[OKX-Manager] 使用主账户: {}", primaryAccount.name());
            // 1. 创建 OKXAccount(REST API 调用需要)
            String baseUrl = primaryAccount.isAccountType() ? DefaultUrls.USDM_PROD_URL : DefaultUrls.USDM_UAT_URL;
            OKXAccount okxAccount = new OKXAccount(
                    baseUrl,
                    primaryAccount.getApiKey(),
                    primaryAccount.getSecretKey(),
                    primaryAccount.getPassphrase(),
                    !primaryAccount.isAccountType()
            );
            // 2. 构建 OkxConfig
            // TODO: 参数可通过配置文件/数据库动态读取
            okxConfig = OkxConfig.builder()
                    .apiKey(primaryAccount.getApiKey())
                    .secretKey(primaryAccount.getSecretKey())
                    .passphrase(primaryAccount.getPassphrase())
                    .instId("ETH-USDT-SWAP")
                    .leverage("100")
                    .tdMode("cross")
                    .gridRate(new BigDecimal("0.0025"))
                    .expectedProfit(new BigDecimal("2"))
                    .maxLoss(new BigDecimal("15"))
                    .quantity("1")
                    .baseQuantity("10")
                    .priceScale(2)
                    .ctVal(new BigDecimal("0.1"))
                    .isSimulate(!primaryAccount.isAccountType())
                    .gridQueueSize(300)
                    .marginRatioLimit(new BigDecimal("0.2"))
                    .build();
            // 3. 初始化交易服务:查账户 → 清条件单 → 平已有仓位 → 设杠杆
            gridTradeService = new OkxGridTradeService(okxConfig, okxAccount);
            gridTradeService.init();
            // 4. 创建 WS 客户端并注册 3 个频道处理器
            gridWsClient = new OkxGridWsClient(primaryAccount);
            gridWsClient.addChannelHandler(new OkxKlineChannelHandler(okxConfig.getInstId(), gridTradeService));
            gridWsClient.addChannelHandler(new OkxPositionsChannelHandler(okxConfig.getInstId(), gridTradeService));
            gridWsClient.addChannelHandler(new OkxAlgoOrdersChannelHandler(okxConfig.getInstId(), gridTradeService));
            gridWsClient.init();
            log.info("[OKX-Manager] WS已连接, 已注册 3 个频道处理器: candle1m/positions/orders-algo");
            // 5. 激活策略,等待首根 K 线触发基底双开
            gridTradeService.startGrid();
            log.info("[OKX-Manager] 初始化完成");
        } catch (Exception e) {
            log.error("[OKX-Manager] 初始化失败", e);
        }
        log.info("OkxWebSocketClientManager初始化完成");
    }
    /**
     * 销毁方法,在Spring Bean销毁前执行
     * 关闭所有WebSocket客户端连接和相关资源
     * 销毁:停止策略 → 关闭交易线程池 → 取消 WS 订阅 → 断开连接 → 关闭 WS 线程池。
     */
    @PreDestroy
    public void destroy() {
        log.info("开始销毁OkxWebSocketClientManager");
        // 关闭价格WebSocket客户端
        if (klinePriceClient != null) {
        log.info("[OKX-Manager] 开始销毁...");
        if (gridTradeService != null) {
            try {
                klinePriceClient.destroy();
                log.info("已销毁OkxNewPriceWebSocketClient");
                gridTradeService.stopGrid();
            } catch (Exception e) {
                log.error("销毁OkxNewPriceWebSocketClient失败", e);
                log.error("[OKX-Manager] 停止策略失败", e);
            }
        }
        // 关闭所有量化交易WebSocket客户端实例
        for (Map.Entry<String, OkxQuantWebSocketClient> entry : quantClientMap.entrySet()) {
        if (gridWsClient != null) {
            try {
                OkxQuantWebSocketClient client = entry.getValue();
                client.destroy();
                log.info("已销毁账号 {} 的WebSocket客户端", entry.getKey());
                gridWsClient.destroy();
            } catch (Exception e) {
                log.error("销毁账号 {} 的WebSocket客户端失败", entry.getKey(), e);
                log.error("[OKX-Manager] 销毁WS客户端失败", e);
            }
        }
        // 清空客户端映射
        quantClientMap.clear();
        log.info("OkxWebSocketClientManager销毁完成");
        log.info("[OKX-Manager] 销毁完成");
    }
    /**
     * 获取指定账号的OkxQuantWebSocketClient实例
     * @param accountName 账号类型名称
     * @return WebSocket客户端实例
     */
    public OkxQuantWebSocketClient getClient(String accountName) {
        return quantClientMap.get(accountName);
    }
    /**
     * 获取所有OkxQuantWebSocketClient实例
     * @return 所有客户端实例的集合
     */
    public Collection<OkxQuantWebSocketClient> getAllClients() {
        return quantClientMap.values();
    }
    /**
     * 获取OkxNewPriceWebSocketClient实例
     * @return 价格WebSocket客户端实例
     */
    public OkxKlineWebSocketClient getKlineWebSocketClient() {
        return klinePriceClient;
    }
}
    /** @return 网格交易策略服务实例 */
    public OkxGridTradeService getGridTradeService() { return gridTradeService; }
    /** @return 网格交易 WS 客户端实例 */
    public OkxGridWsClient getGridWsClient() { return gridWsClient; }
    /** @return 统一配置实例 */
    public OkxConfig getOkxConfig() { return okxConfig; }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/README.md
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/celue/CaoZuoService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/celue/CaoZuoServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxAlgoOrdersChannelHandler.java
New file
@@ -0,0 +1,89 @@
package com.xcong.excoin.modules.okxNewPrice.gridWs;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.modules.okxNewPrice.OkxGridTradeService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
/**
 * OKX 策略委托(算法单)频道处理器 (orders-algo)。
 * 接收条件单状态变更推送并回调 OkxGridTradeService.onOrderUpdate()。
 *
 * @author Administrator
 */
@Slf4j
public class OkxAlgoOrdersChannelHandler implements OkxGridChannelHandler {
    private static final String CHANNEL_NAME = "orders-algo";
    private final String instId;
    private final OkxGridTradeService gridTradeService;
    public OkxAlgoOrdersChannelHandler(String instId, OkxGridTradeService gridTradeService) {
        this.instId = instId;
        this.gridTradeService = gridTradeService;
    }
    @Override
    public String getChannelName() { return CHANNEL_NAME; }
    @Override
    public void subscribe(WebSocketClient ws) {
        JSONObject msg = new JSONObject();
        JSONObject arg = new JSONObject();
        arg.put("channel", CHANNEL_NAME);
        arg.put("instType", "SWAP");
        msg.put("op", "subscribe");
        JSONArray args = new JSONArray();
        args.add(arg);
        msg.put("args", args);
        ws.send(msg.toJSONString());
        log.info("[OKX-WS] {} 订阅成功", CHANNEL_NAME);
    }
    @Override
    public void unsubscribe(WebSocketClient ws) {
        JSONObject msg = new JSONObject();
        JSONObject arg = new JSONObject();
        arg.put("channel", CHANNEL_NAME);
        arg.put("instType", "SWAP");
        msg.put("op", "unsubscribe");
        JSONArray args = new JSONArray();
        args.add(arg);
        msg.put("args", args);
        ws.send(msg.toJSONString());
        log.info("[OKX-WS] {} 取消订阅成功", CHANNEL_NAME);
    }
    @Override
    public boolean handleMessage(JSONObject response) {
        JSONObject arg = response.getJSONObject("arg");
        if (arg == null || !CHANNEL_NAME.equals(arg.getString("channel"))) {
            return false;
        }
        try {
            JSONArray data = response.getJSONArray("data");
            if (data == null || data.isEmpty()) return true;
            for (int i = 0; i < data.size(); i++) {
                JSONObject order = data.getJSONObject(i);
                if (!instId.equals(order.getString("instId"))) continue;
                String algoId = order.getString("algoId");
                String state = order.getString("state");
                String ordType = order.getString("ordType");
                log.info("[OKX-WS] 算法单更新, algoId:{}, state:{}, ordType:{}, triggerPx:{}, actualPx:{}",
                        algoId, state, ordType,
                        order.getString("triggerPx"),
                        order.getString("actualPx"));
                if (gridTradeService != null) {
                    gridTradeService.onOrderUpdate(algoId, state, ordType);
                }
            }
        } catch (Exception e) {
            log.error("[OKX-WS] {} 处理数据失败", CHANNEL_NAME, e);
        }
        return true;
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxGridChannelHandler.java
New file
@@ -0,0 +1,30 @@
package com.xcong.excoin.modules.okxNewPrice.gridWs;
import com.alibaba.fastjson.JSONObject;
import org.java_websocket.client.WebSocketClient;
/**
 * OKX 网格交易 WebSocket 频道处理器接口。
 * 对齐 Gate 版本的 GateChannelHandler。
 *
 * @author Administrator
 */
public interface OkxGridChannelHandler {
    /** 频道名称,如 "candle1m"、"positions" */
    String getChannelName();
    /** 发送订阅请求 */
    void subscribe(WebSocketClient ws);
    /** 发送取消订阅请求 */
    void unsubscribe(WebSocketClient ws);
    /**
     * 处理频道推送消息。
     *
     * @param response WebSocket 推送的完整 JSON
     * @return true 表示已处理(循环停止),false 表示频道不匹配
     */
    boolean handleMessage(JSONObject response);
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxKlineChannelHandler.java
New file
@@ -0,0 +1,83 @@
package com.xcong.excoin.modules.okxNewPrice.gridWs;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.modules.okxNewPrice.OkxGridTradeService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import java.math.BigDecimal;
/**
 * OKX K线频道处理器 (candle1m)。
 * 策略的唯一价格时间驱动源,每收到一根K线触发 onKline()。
 *
 * @author Administrator
 */
@Slf4j
public class OkxKlineChannelHandler implements OkxGridChannelHandler {
    private static final String CHANNEL_NAME = "candle1m";
    private static final String INTERVAL = "1m";
    private final String instId;
    private final OkxGridTradeService gridTradeService;
    public OkxKlineChannelHandler(String instId, OkxGridTradeService gridTradeService) {
        this.instId = instId;
        this.gridTradeService = gridTradeService;
    }
    @Override
    public String getChannelName() { return CHANNEL_NAME; }
    @Override
    public void subscribe(WebSocketClient ws) {
        JSONObject msg = new JSONObject();
        JSONObject arg = new JSONObject();
        arg.put("channel", CHANNEL_NAME);
        arg.put("instId", instId);
        msg.put("op", "subscribe");
        JSONArray args = new JSONArray();
        args.add(arg);
        msg.put("args", args);
        ws.send(msg.toJSONString());
        log.info("[OKX-WS] {} 订阅成功, instId:{}", CHANNEL_NAME, instId);
    }
    @Override
    public void unsubscribe(WebSocketClient ws) {
        JSONObject msg = new JSONObject();
        JSONObject arg = new JSONObject();
        arg.put("channel", CHANNEL_NAME);
        arg.put("instId", instId);
        msg.put("op", "unsubscribe");
        JSONArray args = new JSONArray();
        args.add(arg);
        msg.put("args", args);
        ws.send(msg.toJSONString());
        log.info("[OKX-WS] {} 取消订阅成功", CHANNEL_NAME);
    }
    @Override
    public boolean handleMessage(JSONObject response) {
        JSONObject arg = response.getJSONObject("arg");
        if (arg == null || !CHANNEL_NAME.equals(arg.getString("channel"))) {
            return false;
        }
        try {
            JSONArray data = response.getJSONArray("data");
            if (data == null || data.isEmpty()) return true;
            // OKX K线数据格式: [ts, o, h, l, c, vol, volCcy, volCcyQuote, confirm]
            JSONArray candle = data.getJSONArray(0);
            if (candle == null || candle.size() < 5) return true;
            BigDecimal closePx = candle.getBigDecimal(4); // 收盘价在索引4
            if (closePx != null && gridTradeService != null) {
                gridTradeService.onKline(closePx);
            }
        } catch (Exception e) {
            log.error("[OKX-WS] {} 处理数据失败", CHANNEL_NAME, e);
        }
        return true;
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/gridWs/OkxPositionsChannelHandler.java
New file
@@ -0,0 +1,89 @@
package com.xcong.excoin.modules.okxNewPrice.gridWs;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.modules.okxNewPrice.OkxGridTradeService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import java.math.BigDecimal;
/**
 * OKX 持仓频道处理器 (positions)。
 * 接收持仓更新推送并回调 OkxGridTradeService.onPositionUpdate()。
 *
 * @author Administrator
 */
@Slf4j
public class OkxPositionsChannelHandler implements OkxGridChannelHandler {
    private static final String CHANNEL_NAME = "positions";
    private final String instId;
    private final OkxGridTradeService gridTradeService;
    public OkxPositionsChannelHandler(String instId, OkxGridTradeService gridTradeService) {
        this.instId = instId;
        this.gridTradeService = gridTradeService;
    }
    @Override
    public String getChannelName() { return CHANNEL_NAME; }
    @Override
    public void subscribe(WebSocketClient ws) {
        JSONObject msg = new JSONObject();
        JSONObject arg = new JSONObject();
        arg.put("channel", CHANNEL_NAME);
        arg.put("instType", "SWAP");
        msg.put("op", "subscribe");
        JSONArray args = new JSONArray();
        args.add(arg);
        msg.put("args", args);
        ws.send(msg.toJSONString());
        log.info("[OKX-WS] {} 订阅成功", CHANNEL_NAME);
    }
    @Override
    public void unsubscribe(WebSocketClient ws) {
        JSONObject msg = new JSONObject();
        JSONObject arg = new JSONObject();
        arg.put("channel", CHANNEL_NAME);
        arg.put("instType", "SWAP");
        msg.put("op", "unsubscribe");
        JSONArray args = new JSONArray();
        args.add(arg);
        msg.put("args", args);
        ws.send(msg.toJSONString());
        log.info("[OKX-WS] {} 取消订阅成功", CHANNEL_NAME);
    }
    @Override
    public boolean handleMessage(JSONObject response) {
        JSONObject arg = response.getJSONObject("arg");
        if (arg == null || !CHANNEL_NAME.equals(arg.getString("channel"))) {
            return false;
        }
        try {
            JSONArray data = response.getJSONArray("data");
            if (data == null || data.isEmpty()) return true;
            for (int i = 0; i < data.size(); i++) {
                JSONObject pos = data.getJSONObject(i);
                if (!instId.equals(pos.getString("instId"))) continue;
                String posSide = pos.getString("posSide");
                BigDecimal posSize = new BigDecimal(pos.getString("pos"));
                BigDecimal avgPx = new BigDecimal(pos.getString("avgPx"));
                log.info("[OKX-WS] 持仓更新, instId:{}, posSide:{}, pos:{}, avgPx:{}",
                        instId, posSide, posSize, avgPx);
                if (gridTradeService != null) {
                    gridTradeService.onPositionUpdate(instId, posSide, posSize, avgPx);
                }
            }
        } catch (Exception e) {
            log.error("[OKX-WS] {} 处理数据失败", CHANNEL_NAME, e);
        }
        return true;
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/AdvancedMA.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/BOLL.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/FifteenMinuteStrategyExample.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/FifteenMinuteTradingExample.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/FifteenMinuteTradingStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/IndicatorBase.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/KDJ.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/MA.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/MACD.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/MACDTest.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/RSI.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/TradingStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/EMACalculator.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/IndicatorUtils.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDCalculator.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MACDResult.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MacdEmaStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/MacdMaStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/PriceData.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/Volatility.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/macdAndMatrategy/内容
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/AbstractTechnicalIndicatorStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/ComprehensiveTechnicalStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/CoreTechnicalStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/CoreTechnicalStrategyUsageGuide.md
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/TechnicalIndicatorStrategy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/indicator/strategy/TradeSignal.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/jiaoyi/IMQService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/jiaoyi/IMQServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/AccountWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/BalanceAndPositionWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/InstrumentsWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/LoginWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/OrderInfoWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/PositionsWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/TradeOrderWs.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/enums/CoinEnums.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/enums/ExchangeInfoEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/enums/OrderParamEnums.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/param/Kline.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/param/StrategyParam.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/param/TradeRequestParam.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListQueue.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxWs/wanggeList/WangGeListServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/DataUtil.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/MallUtils.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/Dto/QuantApiMessage.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/Dto/SubmitOrderReqDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/Dto/TradeOrderDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ExchangeInfoEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ExchangeLoginEventService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ExchangeLoginService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/RequestHandler.java
@@ -1,7 +1,7 @@
package com.xcong.excoin.modules.okxNewPrice.okxpi.config;
import com.alibaba.fastjson.JSON;
import com.xcong.excoin.modules.okxNewPrice.utils.FebsException;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.FebsException;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.enums.HttpMethod;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.enums.RequestType;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.DateUtils;
@@ -83,6 +83,7 @@
                    queryString = UrlBuilder.buildFullUrl(urlPath,"" , parameters, null);
//                    queryString = UrlBuilder.buildFullUrl(null, urlPath, parameters, null);
                }
                String sign = SignUtils.signRest(secretKey,
                        timestamp,
                        httpMethod.toString(),
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/ResponseHandler.java
@@ -1,7 +1,7 @@
package com.xcong.excoin.modules.okxNewPrice.okxpi.config;
import com.xcong.excoin.modules.okxNewPrice.utils.FebsException;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.FebsException;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.JSONParser;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.OkHttpUtils;
import okhttp3.Request;
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/impl/ExchangeLoginEventServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/FebsException.java
New file
@@ -0,0 +1,15 @@
package com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils;
/**
 * OKX 系统内部异常。
 *
 * @author MrBird
 */
public class FebsException extends RuntimeException {
    private static final long serialVersionUID = -994962710559017255L;
    public FebsException(String message) {
        super(message);
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/ParameterChecker.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/RequestBuilder.java
@@ -1,7 +1,7 @@
package com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils;
import com.xcong.excoin.modules.okxNewPrice.utils.FebsException;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils.FebsException;
import com.xcong.excoin.modules.okxNewPrice.okxpi.config.enums.HttpMethod;
import okhttp3.MediaType;
import okhttp3.Request;
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/utils/SSLConfig.java
New file
@@ -0,0 +1,22 @@
package com.xcong.excoin.modules.okxNewPrice.okxpi.config.utils;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import java.security.SecureRandom;
/**
 * SSL 配置工具。
 *
 * @author Administrator
 */
public class SSLConfig {
    public static void configureSSL() {
        try {
            SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
            sslContext.init(null, null, new SecureRandom());
            HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/vo/BalanceVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/vo/InstrumentsVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/config/vo/PositionsVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/enumerates/TradeTypeEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/ITradeOrderService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/TradeOrderFactory.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/impl/OKXTradeOrderServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/order/vo/QuantExchangeReturnVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/IQueryOrderService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/QueryOrderFactory.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/dto/QuantOperateRecode.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/impl/OKXQueryOrderServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/vo/QuantCheckOrderVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/query/vo/QuantOperateRecodeVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeEventEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeEventRunner.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeRequest.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeRequestBuy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeRequestSell.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/TradeService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/impl/TradeServiceBuy.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/impl/TradeServiceClosePosition.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/impl/TradeServiceSell.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/trade/vo/SellOrderVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/IVerifyAccountService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/VerifyAccountFactory.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountBalDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountBalanceDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountBalanceInfoDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiAccountProfitDailyDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiMessageDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiPositionsInfoDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/ApiValidApiMessageDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/OperateCurrencyDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/OperateCurrencyLeverDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/dto/TradeBigdataDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/enums/PublicStatusEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/impl/OKXVerifyAccountServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/ApiAccountHoldVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/ApiPositionsInfoVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/ProductMessVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/okxpi/verify/vo/SinglemarketVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/FebsException.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/FebsResponse.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/SSLConfig.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/SignUtils.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/WsMapBuild.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/utils/WsParamBuild.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeQueue.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/wangge/WangGeServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/zhanghu/ApiMessageServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/zhanghu/IApiMessageService.java
File was deleted
src/main/java/com/xcong/excoin/modules/okxNewPrice/zhanghu/ZhangHuEnum.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/controller/PlatformController.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformBannerDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformCnyUsdtExchangeDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformFeeSettingDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformNoticeDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformPaymentMethodDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformSymbolsCoinDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/PlatformSymbolsSkuDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/dao/TradeSettingDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformBannerEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformCnyUsdtExchangeEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformFeeSettingEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformLeverageSettingEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformNoticeEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformPaymentMethodEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformSymbolsCoinEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformSymbolsSkuEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/entity/PlatformTradeSettingEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/PlatformBannerService.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/PlatformCnyUsdtExchangeService.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/PlatformNoticeService.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/PlatformPaymentMethodService.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/PlatformSymbolsSkuService.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformBannerServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformCnyUsdtExchangeServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformNoticeServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformPaymentMethodServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/service/impl/PlatformSymbolsSkuServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/platform/vo/PlatformCnyUsdtExchangeVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/controller/SymbolsController.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/dao/PlatformSymbolsContractDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/entity/PlatformSymbolsContractEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/parameter/dto/KlineDetailDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/parameter/vo/HomeSymbolsVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/parameter/vo/KlineDataVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/service/SymbolsService.java
File was deleted
src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/controller/TestUserController.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/dao/TestUserDao.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/dto/TestUserDto.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/entity/TestUserEntity.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/mapper/TestUserEntityMapper.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/service/TestUserService.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/service/impl/TestUserServiceImpl.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/vo/TestUserVo.java
File was deleted
src/main/java/com/xcong/excoin/modules/test/vo/TestVo.java
File was deleted
src/main/java/com/xcong/excoin/netty/ChatServer.java
File was deleted
src/main/java/com/xcong/excoin/netty/bean/RequestBean.java
File was deleted
src/main/java/com/xcong/excoin/netty/bean/ResponseBean.java
File was deleted
src/main/java/com/xcong/excoin/netty/common/ChannelManager.java
File was deleted
src/main/java/com/xcong/excoin/netty/common/Contans.java
File was deleted
src/main/java/com/xcong/excoin/netty/common/NettyTools.java
File was deleted
src/main/java/com/xcong/excoin/netty/dispatch/MsgDispatch.java
File was deleted
src/main/java/com/xcong/excoin/netty/handler/WebSocketServerHandler.java
File was deleted
src/main/java/com/xcong/excoin/netty/initalizer/WebSocketServerInitializer.java
File was deleted
src/main/java/com/xcong/excoin/netty/logic/MsgLogic.java
File was deleted
src/main/java/com/xcong/excoin/netty/logic/WebSocketLogic.java
File was deleted
src/main/java/com/xcong/excoin/netty/logic/impl/MsgLogicImpl.java
File was deleted
src/main/java/com/xcong/excoin/netty/server/WebSocketServer.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/BlockCoinUpdateJob.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/DayLineDataUpdateJob.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/KlineDataUpdateJob.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/LoopExecutorJob.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/NewestPriceUpdateJob.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/NotionalPoolingJob.java
File was deleted
src/main/java/com/xcong/excoin/quartz/job/UsdtCnyExchangePriceUpdateJob.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/consumer/OperateOrderPriceConsumer.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/consumer/TestConsumer.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/consumer/WebsocketPriceConsumer.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/init/OrderProducerInit.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/pricequeue/AscBigDecimal.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/pricequeue/DescBigDecimal.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/pricequeue/OrderModel.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/pricequeue/OrderOperatePriceService.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/pricequeue/PricePriorityQueue.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/producer/OrderProducer.java
File was deleted
src/main/java/com/xcong/excoin/rabbit/producer/TestProducer.java
File was deleted
src/main/java/com/xcong/excoin/utils/CacheSettingUtils.java
File was deleted
src/main/java/com/xcong/excoin/utils/CalculateUtil.java
File was deleted
src/main/java/com/xcong/excoin/utils/CoinTypeConvert.java
File was deleted
src/main/java/com/xcong/excoin/utils/LogRecordUtils.java
File was deleted
src/main/java/com/xcong/excoin/utils/OssUtils.java
File was deleted
src/main/java/com/xcong/excoin/utils/ThreadPoolUtils.java
File was deleted
src/main/resources/application-test.yml
@@ -102,7 +102,7 @@
  rabbit-consumer: false
  block-job: false
  websocket: false
  quant: false
  quant: true
aliyun:
  oss:
src/test/java/com/xcong/excoin/GuijiTest.java
File was deleted
src/test/java/com/xcong/excoin/HuobiTest.java
File was deleted
src/test/java/com/xcong/excoin/KssframeworkApplicationTests.java
File was deleted
src/test/java/com/xcong/excoin/MemberSettingTest.java
File was deleted
src/test/java/com/xcong/excoin/RSATest.java
File was deleted
src/test/java/com/xcong/excoin/RabbitMqTest.java
File was deleted
src/test/java/com/xcong/excoin/RedisTest.java
File was deleted
src/test/java/com/xcong/excoin/ReturnMoneyTest.java
File was deleted
src/test/java/com/xcong/excoin/SmsTest.java
File was deleted
src/test/java/com/xcong/excoin/SymbolsTest.java
File was deleted
src/test/java/com/xcong/excoin/mapper/Car.java
File was deleted
src/test/java/com/xcong/excoin/mapper/CarDto.java
File was deleted
src/test/java/com/xcong/excoin/mapper/CarEntity.java
File was deleted
src/test/java/com/xcong/excoin/mapper/CarMapper.java
File was deleted
src/test/java/com/xcong/excoin/mapper/MapStructMapper.java
File was deleted
src/test/java/com/xcong/excoin/modules/newPrice/OkxWebSocketClientTest.java
File was deleted