package tool import "github.com/go-resty/resty/v2" type API interface { CheckDatabaseOK() (running bool, err error) // 检查数据库是否正常 IsRunning() (flag bool, err error) // 是否在运行 CdnDownloadImg(aesKey, cdnMidImgUrl string) (dataBase64Str string, err error) // 下载图片 DownloadAttach(attachId string) (dataBase64Str string, err error) // 下载附件 DownloadVideo(msgId int) (dataBase64Str string, err error) // 下载视频 DownloadVoice(msgId int, voiceUrl string, length int) (dataBase64Str string, err error) // 下载语音 SetProxy(param SetProxyRequest) (err error) // 设置代理 SetStep(stepCount int) (err error) // 设置步数 } type service struct { client *resty.Client } func New(client *resty.Client) API { return &service{client: client} }