Closed jouzitong closed 6 months ago
public class OkxWsApiService { private void subscribe(WsChannel wsChannel, WsChannelRequestArg requestArg) { if (!subscribeStateService.hasSubscribed(wsChannel, requestArg)) { pureSubscribe(wsChannel, requestArg); subscribeStateService.addSubscribed(wsChannel, requestArg); } else { log.error("subscribe already exists: {} {}", wsChannel, requestArg); } } public void pureSubscribe(WsChannel wsChannel, WsChannelRequestArg requestArg) { WsRequest<WsRequestArg> wsRequest = WsRequest.builder() .op(Operation.SUBSCRIBE) .args(List.of(requestArg)).build(); send(wsChannel, JSON.toJSONString(wsRequest)); } private void unsubscribe(WsChannel wsChannel, WsChannelRequestArg requestArg) { WsRequest<WsRequestArg> wsRequest = WsRequest.builder() .op(Operation.UNSUBSCRIBE) .args(List.of(requestArg)).build(); send(wsChannel, JSON.toJSONString(wsRequest)); } }
I hope you can change subscribe and unsubscribe to protected permissions. reason:
subscribe
unsubscribe
protected
Thanks for your advance. You are right. I designed it by using by myself at the beginning which it not extendable for others. I will change it and release a new version 0.4.2024051501.
0.4.2024051501
I hope you can change
subscribe
andunsubscribe
toprotected
permissions. reason: