tt/core/callapi_other.go
2024-05-28 08:47:31 +08:00

87 lines
2.4 KiB
Go

package core
import "github.com/goWxHook/goWxHook/utils/json"
type GetA8KeyRequest struct {
Url string `json:"url"`
Scene int `json:"scene"`
}
type GetA8KeyResponseData struct {
A8Key string `json:"a8Key"`
ActionCode int `json:"actionCode"`
AntispamTicket string `json:"antispamTicket"`
BaseResponse struct {
ErrMsg struct {
} `json:"errMsg"`
Ret int `json:"ret"`
} `json:"baseResponse"`
Content string `json:"content"`
Cookie struct {
Buffer string `json:"buffer"`
ILen int `json:"iLen"`
} `json:"cookie"`
DeepLinkBitSet struct {
BitValue string `json:"bitValue"`
} `json:"deepLinkBitSet"`
FullUrl string `json:"fullUrl"`
GeneralControlBitSet struct {
BitValue int `json:"bitValue"`
} `json:"generalControlBitSet"`
HeadImg string `json:"headImg"`
HttpHeaderCount int `json:"httpHeaderCount"`
HttpHeaderList []struct {
Key string `json:"key"`
Value string `json:"value"`
} `json:"httpHeaderList"`
JsapicontrolBytes struct {
Buffer string `json:"buffer"`
ILen int `json:"iLen"`
} `json:"jsapicontrolBytes"`
Jsapipermission struct {
BitValue int `json:"bitValue"`
BitValue2 int `json:"bitValue2"`
BitValue3 int `json:"bitValue3"`
BitValue4 int `json:"bitValue4"`
} `json:"jsapipermission"`
MenuWording string `json:"menuWording"`
Mid string `json:"mid"`
ScopeCount int `json:"scopeCount"`
ScopeList []interface{} `json:"scopeList"`
ShareUrl string `json:"shareUrl"`
Ssid string `json:"ssid"`
Title string `json:"title"`
UserName string `json:"userName"`
Wording string `json:"wording"`
}
type GetA8KeyResponse struct {
Data GetA8KeyResponseData `json:"data"`
Type int `json:"type"`
}
// GetA8Key 获取A8Key
func (w *WxApi) GetA8Key(request GetA8KeyRequest) (*GetA8KeyResponseData, error) {
resp, err := w.internalCall(MtGetA8KeyMsg, 60, MtGetA8KeyMsg, request, nil)
if err != nil {
return nil, err
}
var rdata GetA8KeyResponse
err = json.Unmarshal([]byte(resp), &rdata)
if err != nil {
return nil, WxError{-1, err.Error()}
}
return &rdata.Data, nil
}
type DecryptImgRequest struct {
SrcFile string `json:"src_file"`
DestFile string `json:"dest_file"`
}
// DecryptImg 解密图片
func (w *WxApi) DecryptImg(request DecryptImgRequest) error {
_, err := w.internalCall(0, -1, MtDecryptImgMsg, request, nil)
return err
}