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.
43 lines
1.3 KiB
43 lines
1.3 KiB
package pintoto
|
|
|
|
import (
|
|
"encoding/json"
|
|
"go.dtapp.net/library/utils/gorequest"
|
|
)
|
|
|
|
type GetShowDateResponse struct {
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Data struct {
|
|
DateList []string `json:"dateList"`
|
|
} `json:"data"`
|
|
Success bool `json:"success"`
|
|
}
|
|
|
|
type GetShowDateResult struct {
|
|
Result GetShowDateResponse // 结果
|
|
Body []byte // 内容
|
|
Http gorequest.Response // 请求
|
|
Err error // 错误
|
|
}
|
|
|
|
func NewGetShowDateResult(result GetShowDateResponse, body []byte, http gorequest.Response, err error) *GetShowDateResult {
|
|
return &GetShowDateResult{Result: result, Body: body, Http: http, Err: err}
|
|
}
|
|
|
|
// GetShowDate 包含某电影的日期 https://www.showdoc.com.cn/1154868044931571/6091788579441818
|
|
func (app *App) GetShowDate(cityId, filmId int) *GetShowDateResult {
|
|
// 参数
|
|
param := NewParams()
|
|
param.Set("cityId", cityId)
|
|
param.Set("filmId", filmId)
|
|
// 转换
|
|
params := app.NewParamsWith(param)
|
|
// 请求
|
|
request, err := app.request("https://movieapi2.pintoto.cn/movieapi/movie-info/get-show-date", params)
|
|
// 定义
|
|
var response GetShowDateResponse
|
|
err = json.Unmarshal(request.ResponseBody, &response)
|
|
return NewGetShowDateResult(response, request.ResponseBody, request, err)
|
|
}
|