pintoto

package module
v0.0.0-...-05c9766 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiOrderCreate

type ApiOrderCreate struct {
	ShowId           string `json:"showId"`                  // 排期的showId,由影院接口得来
	Seat             string `json:"seat"`                    // 用户所选的座位,例:1排1座,1排2座 以英文的逗号 “ , “隔开。 如果座位是情侣座,请传入 : 1排1座(情侣座),1排2座(情侣座)
	ReservedPhone    string `json:"reservedPhone,omitempty"` // 下单时预留的手机号,方便问题沟通
	ThirdOrderId     string `json:"thirdOrderId"`            // 接入方的订单号, 接入方须保证此订单号唯一性
	NotifyUrl        string `json:"notifyUrl"`               // 回调地址,各个场景发生时,将通过此地址通知接入方,详情请看【回调api】
	AcceptChangeSeat int    `json:"acceptChangeSeat"`        // 是否允许调座,1-允许,0-不允许
	SeatId           string `json:"seatId,omitempty"`        // 座位接口的seatId字段, 如果有多个,则以竖线分割
	SeatNo           string `json:"seatNo,omitempty"`        // 座位接口的seatNo字段,如果有多个,则以竖线分割
}

type ApiOrderCreateResult

type ApiOrderCreateResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Success bool   `json:"success"`
}

type ApiOrderCreateSoonOrder

type ApiOrderCreateSoonOrder struct {
	ShowId           string `json:"showId"`                  // 排期的showId,由影院接口得来
	Seat             string `json:"seat"`                    // 用户所选的座位,例:1排1座,1排2座 以英文的逗号 “ , “隔开。 如果座位是情侣座,请传入 : 1排1座(情侣座),1排2座(情侣座)
	ReservedPhone    string `json:"reservedPhone,omitempty"` // 下单时预留的手机号,方便问题沟通
	ThirdOrderId     string `json:"thirdOrderId"`            // 接入方的订单号, 接入方须保证此订单号唯一性
	NotifyUrl        string `json:"notifyUrl"`               // 回调地址,各个场景发生时,将通过此地址通知接入方,详情请看【回调api】
	AcceptChangeSeat int    `json:"acceptChangeSeat"`        // 是否允许调座,1-允许,0-不允许
	SeatId           string `json:"seatId,omitempty"`        // 座位接口的seatId字段, 如果有多个,则以竖线分割
	SeatNo           string `json:"seatNo,omitempty"`        // 座位接口的seatNo字段,如果有多个,则以竖线分割
	NetPrice         int    `json:"netPrice"`                // 所下单所有座位的市场总价单位:分,不可随意乱传,必须是真实价格,如座位有分区定价,也许一一计算后得到总价,否则自动出票失败。由于场次价格延迟问题,有可能造成场次价格和最终价格不一致,此时会出票失败。
	TestType         int    `json:"testType"`                // 仅当为调用测试环境时候,此字段有用, 可模拟秒出票结果。 200 模拟出票成功结果 201 模拟正在出票中结果 500模拟出票失败结果
}

type ApiOrderCreateSoonOrderResult

type ApiOrderCreateSoonOrderResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		ThirdOrderId string `json:"third_order_id"` // 接入方的订单号
		Ticket       string `json:"ticket"`
		TicketStatus int    `json:"ticketStatus"`
		OrderId      string `json:"order_id"`
	} `json:"data"`
	Success bool `json:"success"`
}

type ApiOrderQuery

type ApiOrderQuery struct {
	ThirdOrderId string `json:"thirdOrderId"` // 接入方的订单号
}

type ApiOrderQueryResult

type ApiOrderQueryResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    struct {
		AppKey          string      `json:"appKey"`          // 下单appKey
		ThirdOrderId    string      `json:"thirdOrderId"`    // 接入方的订单号
		OrderStatus     int         `json:"orderStatus"`     // 订单状态:2-受理中,3-待出票,4-已出票待结算,5-已结算,10-订单关闭
		OrderStatusStr  string      `json:"orderStatusStr"`  // 订单状态说明
		InitPrice       int         `json:"initPrice"`       // 订单市场价:分
		OrderPrice      int         `json:"orderPrice"`      // 订单成本价:分,接入方可拿次字段作为下单成本价
		Seat            string      `json:"seat"`            // 座位:英文逗号隔开
		OrderNum        int         `json:"orderNum"`        // 座位数
		ReservedPhone   string      `json:"reservedPhone"`   // 下单预留手机号码
		CreateTime      string      `json:"createTime"`      // 下单时间
		ReadyTicketTime string      `json:"readyTicketTime"` // 待出票时间
		TicketTime      string      `json:"ticketTime"`      // 出票时间
		NotifyUrl       string      `json:"notifyUrl"`       // 回调通知地址
		CloseTime       interface{} `json:"closeTime"`       // 关闭时间
		CloseCause      interface{} `json:"closeCause"`      // 关闭原因
		TicketCode      []struct {
			Code string `json:"code"`
			Type int    `json:"type"`
			Url  string `json:"url"`
		} `json:"ticketCode"` // 取票码,type为1时,为字符串,type为2时,为取票码原始截图。 理论上一个取票码包含各字符串和原始截图, 原始截图可能不和字符串同步返回,有滞后性。
	} `json:"data"`
	Code int `json:"code"`
}

type ApiUserInfoResult

type ApiUserInfoResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    struct {
		Nickname     string  `json:"nickname"`      // 用户昵称
		Mobile       int64   `json:"mobile"`        // 注册号码
		Balance      float64 `json:"balance"`       // 账户余额
		FreezeAmount float64 `json:"freeze_amount"` // 冻结金额
	} `json:"data"`
	Code int `json:"code"`
}

type App

type App struct {
	AppKey    string
	AppSecret string
	ZapLog    *zap.Logger   // 日志服务
	Db        *gorm.DB      // 关系数据库服务
	RDb       *redis.Client // 缓存数据库服务
	MDb       *mongo.Client // 非关系数据库服务
}

App 电影票服务

func (*App) ApiOrderCreate

func (app *App) ApiOrderCreate(param ApiOrderCreate) (result ApiOrderCreateResult, err error)

ApiOrderCreate 下单api https://www.showdoc.com.cn/1154868044931571/5891022916496848

func (*App) ApiOrderCreateSoonOrder

func (app *App) ApiOrderCreateSoonOrder(param ApiOrderCreateSoonOrder) (result ApiOrderCreateSoonOrderResult, err error)

ApiOrderCreateSoonOrder 秒出单下单 https://www.showdoc.com.cn/1154868044931571/6437295495912025

func (*App) ApiOrderQuery

func (app *App) ApiOrderQuery(param ApiOrderQuery) (result ApiOrderQueryResult, err error)

ApiOrderQuery 订单查询 https://www.showdoc.com.cn/1154868044931571/5965244588489845

func (*App) ApiUserInfo

func (app *App) ApiUserInfo() (result ApiUserInfoResult, err error)

ApiUserInfo 账号信息查询 https://www.showdoc.com.cn/1154868044931571/6269224958928211

func (*App) GetCinemaList

func (app *App) GetCinemaList(param GetCinemaList) (result GetCinemaListResult, err error)

GetCinemaList 影院列表 https://www.showdoc.com.cn/1154868044931571/5866426126744792

func (*App) GetCityArea

func (app *App) GetCityArea(param GetCityArea) (result GetCityAreaResult, err error)

GetCityArea 城市下区域 https://www.showdoc.com.cn/1154868044931571/6243539682553126

func (*App) GetCityList

func (app *App) GetCityList() (result GetCityListResult, err error)

GetCityList 城市列表 https://www.showdoc.com.cn/1154868044931571/5865562425538244

func (*App) GetHotList

func (app *App) GetHotList(param GetHotList) (result GetHotListResult, err error)

GetHotList 正在热映 https://www.showdoc.com.cn/1154868044931571/5866125707634369

func (*App) GetScheduleList

func (app *App) GetScheduleList(param GetScheduleList) (result GetScheduleListResult, err error)

GetScheduleList 场次排期 https://www.showdoc.com.cn/1154868044931571/5866708808899217

func (*App) GetSeat

func (app *App) GetSeat(param GetSeat) (result GetSeatResult, err error)

GetSeat 座位 https://www.showdoc.com.cn/1154868044931571/5866824368760475

func (*App) GetShowDate

func (app *App) GetShowDate(param GetShowDate) (result GetShowDateResult, err error)

GetShowDate 包含某电影的日期 https://www.showdoc.com.cn/1154868044931571/6091788579441818

func (*App) GetShowList

func (app *App) GetShowList(param GetShowList) (result GetShowListResult, err error)

GetShowList 包含某电影的影院 https://www.showdoc.com.cn/1154868044931571/6067372188376779

func (*App) GetSoonList

func (app *App) GetSoonList(param GetSoonList) (result GetSoonListResult, err error)

GetSoonList 即将上映 https://www.showdoc.com.cn/1154868044931571/5866125707634369

func (*App) GetVersion

func (app *App) GetVersion() (result GetVersionResult, err error)

GetVersion 获取同步版本号 https://www.showdoc.com.cn/1154868044931571/6566701084841699

func (*App) GradeToFloat64

func (app *App) GradeToFloat64(i interface{}) float64

type ErrResp

type ErrResp struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
	Code    int         `json:"code"`
}

type GetCinemaList

type GetCinemaList struct {
	CityId int `json:"cityId"` // 城市id
}

type GetCinemaListResult

type GetCinemaListResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		List []struct {
			CinemaId          int     `json:"cinemaId"`          // 影院id
			CityId            int     `json:"cityId"`            // 城市id
			CinemaName        string  `json:"cinemaName"`        // 影院名称
			Address           string  `json:"address"`           // 影院地址
			Latitude          float64 `json:"latitude"`          // 纬度
			Longitude         float64 `json:"longitude"`         // 经度
			Phone             string  `json:"phone"`             // 影院电话
			RegionName        string  `json:"regionName"`        // 地区名称
			IsAcceptSoonOrder int     `json:"isAcceptSoonOrder"` // 是否支持秒出票,0为不支持,1为支持
			NetPrice          int     `json:"netPrice"`          // 当前影院最低价的排期
		} `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetCityArea

type GetCityArea struct {
	CityId int `json:"cityId"` // 城市id
}

type GetCityAreaResult

type GetCityAreaResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		List []struct {
			AreaId   int    `json:"areaId"`   // 区域id
			AreaName string `json:"areaName"` // 区域名
		} `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetCityListResult

type GetCityListResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		List []struct {
			PinYin     string `json:"pinYin"`     // 城市首字母
			RegionName string `json:"regionName"` // 城市名
			CityId     int    `json:"cityId"`     // 城市id
		} `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetHotList

type GetHotList struct {
	CityId int `json:"cityId,omitempty"` // 传入cityId时,会显示当前城市下的相关电影。 如果不传,则默认显示北京的电影
}

type GetHotListResult

type GetHotListResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		HasMore int `json:"hasMore"`
		List    []struct {
			Director     string `json:"director"`     // 导演
			PublishDate  string `json:"publishDate"`  // 影片上映日期
			VersionTypes string `json:"versionTypes"` // 上映类型
			Language     string `json:"language"`     // 语言
			ShowStatus   int    `json:"showStatus"`   // 放映状态:1 正在热映。2 即将上映
			Pic          string `json:"pic"`          // 海报URL地址
			FilmTypes    string `json:"filmTypes"`    // 影片类型
			LikeNum      int    `json:"likeNum"`      // 想看人数
			Duration     int    `json:"duration"`     // 时长,分钟
			Cast         string `json:"cast"`         // 主演
			FilmId       int    `json:"filmId"`       // 影片id
			Grade        string `json:"grade"`        // 评分
			Intro        string `json:"intro"`        // 简介
			Name         string `json:"name"`         // 影片名
		} `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetScheduleList

type GetScheduleList struct {
	CinemaId int `json:"cinemaId"` // 影院id
}

type GetScheduleListResult

type GetScheduleListResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		List []struct {
			PlanType        string `json:"planType"`        // 影厅类型 2D 3D
			ShowTime        string `json:"showTime"`        // 放映时间
			NetPrice        int    `json:"netPrice"`        // 参考价,单位:分
			Language        string `json:"language"`        // 语言
			ShowDate        string `json:"showDate"`        //
			Duration        int    `json:"duration"`        // 时长,分钟
			ShowId          string `json:"showId"`          // 场次标识
			StopSellTime    string `json:"stopSellTime"`    // 停售时间
			CinemaId        int    `json:"cinemaId"`        // 影院id
			CinemaName      string `json:"cinemaName"`      //
			FilmId          int    `json:"filmId"`          // 影片id
			ScheduleArea    string `json:"scheduleArea"`    // 该排期的分区座位价格信息,当此字段有值的时候,代表座位里面支持分区价格。 如果调用的是秒出票下单, 那价格必须计算正确,才能正确出票成功,即必须处理好座位分区价格
			FilmName        string `json:"filmName"`        // 影片名字
			HallName        string `json:"hallName"`        // 影厅名
			ShowVersionType string `json:"showVersionType"` // 场次类型
		} `json:"list"`
		DiscountRule struct {
			UpDiscountRate   float64 `json:"upDiscountRate"`   // 影院最高成本折扣,当价格大于等于39元时候,可取此字段
			DownDiscountRate float64 `json:"downDiscountRate"` // 影院最高成本折扣,当价格小于39元时候,可取此字段
		} `json:"discountRule"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetSeat

type GetSeat struct {
	ShowId string `json:"showId"` // 场次标识
}

type GetSeatResult

type GetSeatResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		SeatData struct {
			Restrictions int            `json:"restrictions"`
			Seats        []GetSeatSeats `json:"seats"`
		} `json:"seatData"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetSeatSeats

type GetSeatSeats struct {
	Area       string `json:"area"`       // 本座位所在的区域,根据场次排期接口的 scheduleArea 字段, 可得到当前座位的分区价格
	ColumnNo   string `json:"columnNo"`   // 列
	Lovestatus int    `json:"lovestatus"` // 0为非情侣座;1为情侣座左;2为情侣座右
	RowNo      string `json:"rowNo"`      // 行
	SeatId     string `json:"seatId"`     // 座位标识符,锁座位和秒出票的时候需要用到
	SeatNo     string `json:"seatNo"`     // 座位名
	Status     string `json:"status"`     // N可售,LK不可售
}

type GetShowDate

type GetShowDate struct {
	FilmId int `json:"filmId"` // 影片id,由热映/即将上映接口获得
	CityId int `json:"cityId"` // 城市id,由城市列表接口获得
}

type GetShowDateResult

type GetShowDateResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		DateList []string `json:"dateList"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetShowList

type GetShowList struct {
	Page      int     `json:"page,omitempty"`      // 页码,默认1
	Limit     int     `json:"limit,omitempty"`     // 条数,默认 10
	FilmId    int     `json:"filmId"`              // 影片id,由热映/即将上映接口获得
	CityId    int     `json:"cityId"`              // 城市id,由城市列表接口获得
	Area      string  `json:"area,omitempty"`      // 区域名,由区域列表接口获得
	Date      string  `json:"date,omitempty"`      // 日期,例:2020-01-01,不传默认当天
	Latitude  float64 `json:"latitude,omitempty"`  // 纬度,不传则无距离排序
	Longitude float64 `json:"longitude,omitempty"` // 经度,不传则无距离排序
}

type GetShowListResult

type GetShowListResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		HasMore int `json:"hasMore"`
		List    []struct {
			Address    string  `json:"address"`
			ShowId     string  `json:"showId"`
			Distance   string  `json:"distance"`
			CinemaId   int     `json:"cinemaId"`
			CinemaName string  `json:"cinemaName"`
			Latitude   float64 `json:"latitude"`
			ShowTime   string  `json:"showTime"`
			HallName   string  `json:"hallName"`
			Longitude  float64 `json:"longitude"`
		} `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetSoonList

type GetSoonList struct {
	CityId int `json:"cityId,omitempty"` // 传入cityId时,会显示当前城市下的相关电影。 如果不传,则默认显示北京的电影
}

type GetSoonListResult

type GetSoonListResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		HasMore int `json:"hasMore"`
		List    []struct {
			Director     string      `json:"director"`     // 导演
			PublishDate  string      `json:"publishDate"`  // 影片上映日期
			VersionTypes string      `json:"versionTypes"` // 上映类型
			Language     string      `json:"language"`     // 语言
			ShowStatus   int         `json:"showStatus"`   // 放映状态:1 正在热映。2 即将上映
			Pic          string      `json:"pic"`          // 海报URL地址
			FilmTypes    string      `json:"filmTypes"`    // 影片类型
			LikeNum      int         `json:"likeNum"`      // 想看人数
			Duration     int         `json:"duration"`     // 时长,分钟
			Cast         string      `json:"cast"`         // 主演
			FilmId       int         `json:"filmId"`       // 影片id
			Grade        interface{} `json:"grade"`        // 评分
			Intro        string      `json:"intro"`        // 简介
			Name         string      `json:"name"`         // 影片名
		} `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type GetVersionResult

type GetVersionResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data"`
	Success bool   `json:"success"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL