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.
go-library/service/pintoto/movie_info_get_city_list.go

40 lines
1.1 KiB

package pintoto
import (
"encoding/json"
)
type GetCityListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
List []GetCityListResponseDataList `json:"list"`
} `json:"data"`
Success bool `json:"success"`
}
type GetCityListResponseDataList struct {
PinYin string `json:"pinYin"` // 城市首字母
RegionName string `json:"regionName"` // 城市名
CityId int `json:"cityId"` // 城市id
}
type GetCityListResult struct {
Result GetCityListResponse // 结果
Body []byte // 内容
Err error // 错误
}
func NewGetCityListResult(result GetCityListResponse, body []byte, err error) *GetCityListResult {
return &GetCityListResult{Result: result, Body: body, Err: err}
}
// GetCityList 城市列表
// https://www.showdoc.com.cn/1154868044931571/5865562425538244
func (app *App) GetCityList() *GetCityListResult {
body, err := app.request("https://movieapi2.pintoto.cn/movieapi/movie-info/get-city-list", map[string]interface{}{})
var response GetCityListResponse
err = json.Unmarshal(body, &response)
return NewGetCityListResult(response, body, err)
}