import "../base.api"

type (
    LoginQRStatus {
        // 登陆二维码
        QRCode string `json:"qRCode,optional"`

        // 登陆二维码状态
        Status string `json:"status,optional"`

        // 登陆二维码状态描述
        StatusDesc string `json:"statusDesc,optional"`
    }

        // 刷新登陆二维码请求参数
    RefreshLoginQRReq {
        // 服务器id
        ServerId *uint64 `json:"serverId,optional"`

        // 端口号
        Port *string `json:"port,optional"`

        // 回调地址
        Callback *string `json:"callback,optional"`
    }

        // 刷新登陆二维码返回参数
    RefreshLoginQRResp {
        BaseDataInfo
        // 二维码Base64
        Data LoginQRStatus `json:"data,optional"`
    }

        // 发送微信文本消息请求参数
    SendTextMsgReq {

        // 属主微信id
        WxWxid *string `json:"senderWxId"`

        // 微信id 公众号微信ID
        Wxid *string `json:"receiverWxId"`

        // 微信文本消息内容
        Msg *string `json:"msg"`
    }

        // 发送微信图片消息请求参数
    SendPicMsgReq {

        // 属主微信id
        WxWxid *string `json:"wxWxid"`

        // 微信id 公众号微信ID
        Wxid *string `json:"wxid"`

        // 微信图片路径(本地或网络,本地需要上传操作,如:C:\\x.jpg)
        Picpath *string `json:"picpath"`

        // 微信图片自定义名称(此属性只有网络图片有)
        Diyfilename *string `json:"diyfilename,optional"`
    }

        // 发送微信图片(本地)请求参数
    SendPicMsgLocalReq {

        // 属主微信id
        WxWxid *string `json:"wxWxid"`

        // 微信id 公众号微信ID
        Wxid *string `json:"wxid"`

        // 微信图片路径(本地或网络,本地需要上传操作,如:C:\\x.jpg)
        Picpath *string `json:"picpath"`
    }
)

@server(
    group: Wxhook
)

service Wechat {
    // 发送微信文本消息
    @handler sendTextMsg
    post /wxhook/sendTextMsg (SendTextMsgReq) returns (BaseMsgResp)
}


@server(
    jwt: Auth
    group: Wxhook
    middleware: Authority
)

service Wechat {
    // Refresh login QR code | 刷新登陆二维码
    @handler refreshLoginQR
    post /wxhook/refreshLoginQR (RefreshLoginQRReq) returns (RefreshLoginQRResp)

    // 退出登陆
    @handler logout
    post /wxhook/logout (IDReq) returns (BaseMsgResp)

    // 结束微信
    @handler terminateThisWeChat
    post /wxhook/terminateThisWeChat (IDReq) returns (BaseMsgResp)

    // 获取好友和群信息
    @handler getFriendsAndGroups
    post /wxhook/getFriendsAndGroups (IDReq) returns (BaseMsgResp)

    // // 发送微信文本消息
    // @handler sendTextMsg
    // post /wxhook/sendTextMsg (SendTextMsgReq) returns (BaseMsgResp)

    // 发送微信图片
    @handler sendPicMsg
    post /wxhook/sendPicMsg (SendPicMsgReq) returns (BaseMsgResp)

    // 发送微信图片(本地)
    @handler sendPicMsgLocal
    post /wxhook/sendPicMsgLocal (SendPicMsgLocalReq) returns (BaseMsgResp)
}