package thyyxxk.webserver.service.externalhttp;

import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.socketmessage.ApiMessageBody;
import thyyxxk.webserver.entity.socketmessage.SendUserList;

import java.util.List;

@BaseRequest(baseURL = "${socketCenter}")
public interface WebSocketService {
    @Post("/sendMessageBySid")
    ResultVo<String> sendMessageBySid(@JSONBody ApiMessageBody body);

    @Post(value = "/sendMessageByUserCode", async = true)
    ResultVo<String> sendMessageByUserCode(@JSONBody ApiMessageBody body);

    @Post(value = "/sendMessageByGroupId", async = true)
    void sendMessageByGroupId(@JSONBody ApiMessageBody body);

    @Post(value = "/sendMessageToAll", async = true)
    void sendMessageToAll(@JSONBody ApiMessageBody body);

    @Get("/getOnlineCount")
    ResultVo<Integer> getOnlineCount();

    @Post("/sendFloorTriageMessage")
    void sendFloorTriageMessage(@JSONBody ApiMessageBody body);

    @Post("/sendRoomTriageMessage")
    ResultVo<String> sendRoomTriageMessage(@JSONBody ApiMessageBody body);

    @Post("/emrSocketUnlock")
    ResultVo<String> emrSocketUnlock(@JSONBody ApiMessageBody body);

    @Post("/fetchEmrSessions")
    ResultVo<List<String>> fetchEmrSessions(@JSONBody ApiMessageBody body);

    @Get("/isBeingEditing?documentId={documentId}")
    ResultVo<String> isBeingEditing(@Var("documentId") String documentId);

    @Get(value = "/textToSpeech?text={text}&id={id}")
    ResultVo<String> textToSpeech(@Var("text") String text, @Var("id") String id);

    @Get(value = "/getWeComAddressBookToken")
    String getWeComAddressBookToken();

    @Get(value = "/getWeComClockInToken")
    String getWeComClockInToken();

    @Get(value = "/getWeComSendMsgToken")
    String getWeComSendMsgToken();

    @Get("/getWeComSendFileToken")
    String getWeComSendFileToken();

    @Get("/getLisDockSign")
    String[] getLisDockSign();

    @Get("/setLisDockSign?sign1={sign1}&sign2={sign2}")
    void setLisDockSign(@Var("sign1") String sign1, @Var("sign2") String sign2);

    @Get("/getThmzToken")
    String getThmzToken();

    @Post("/sendEmrSocketMessage")
    void sendEmrSocketMessage(@JSONBody JSONObject obj);

    @Get("/getCurrentDocumentUserCode?documentId={documentId}")
    ResultVo<String> getCurrentDocumentUserCode(@Var("documentId") String documentId);

    @Post("/forcedKickingOutOfPersonnelByDocumentId")
    ResultVo<String> forcedKickingOutOfPersonnelByDocumentId(@JSONBody JSONObject js);

    @Post("/emrSendAMessage")
    void emrSendAMessage(@JSONBody JSONObject obj);

    @Post(value = "/sendUserListMessage", async = true)
    void sendUserListMessage(@JSONBody SendUserList body);

    @Get("/hasCertainIpAndCode?ip={ip}&code={code}")
    ResultVo<String> hasCertainIpAndCode(@Var("ip") String ip, @Var("code") String code);
}
