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 java.util.List;

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

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

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

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

    @Post("/sendFloorTriageMessage")
    ResultVo<String> 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);

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

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

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


    @Get(value = "/getWeComAddressBookToken", timeout = 1000)
    String getWeComAddressBookToken();

    @Get(value = "/getWeComClockInToken", timeout = 1000)
    String getWeComClockInToken();

    @Get(value = "/getWeComSendMsgToken", timeout = 1000)
    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);

    @Get("/emrSendAMessage?sid={sid}&msg={msg}")
    ResultVo<String> emrSendAMessage(@Var("sid") String sid, @Var("msg") String msg);
}
