You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
3 years ago
|
package pintoto
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
2 years ago
|
"go.dtapp.net/library/gorequest"
|
||
3 years ago
|
)
|
||
|
|
||
2 years ago
|
type GetVersionResponse struct {
|
||
3 years ago
|
Code int `json:"code"`
|
||
|
Message string `json:"message"`
|
||
|
Data string `json:"data"`
|
||
|
Success bool `json:"success"`
|
||
|
}
|
||
|
|
||
2 years ago
|
type GetVersionResult struct {
|
||
|
Result GetVersionResponse // 结果
|
||
|
Body []byte // 内容
|
||
|
Http gorequest.Response // 请求
|
||
|
Err error // 错误
|
||
|
}
|
||
|
|
||
|
func NewGetVersionResult(result GetVersionResponse, body []byte, http gorequest.Response, err error) *GetVersionResult {
|
||
|
return &GetVersionResult{Result: result, Body: body, Http: http, Err: err}
|
||
|
}
|
||
|
|
||
3 years ago
|
// GetVersion 获取同步版本号 https://www.showdoc.com.cn/1154868044931571/6566701084841699
|
||
2 years ago
|
func (app *App) GetVersion() *GetVersionResult {
|
||
|
request, err := app.request("https://movieapi2.pintoto.cn/movieapi/movie-info/get-version", map[string]interface{}{})
|
||
|
// 定义
|
||
|
var response GetVersionResponse
|
||
|
err = json.Unmarshal(request.ResponseBody, &response)
|
||
|
return NewGetVersionResult(response, request.ResponseBody, request, err)
|
||
3 years ago
|
}
|