Files
kami_script/models/model.go
sunxiaolong b36783ac34 初次提交
2023-12-10 22:39:16 +08:00

47 lines
1.1 KiB
Go

package models
import (
"encoding/json"
"net/url"
)
type Data struct {
ExValue ExValue `json:"exValue"`
OrderNo string `json:"orderNo"`
OrderPeriod string `json:"orderPeriod"`
OrderPrice string `json:"orderPrice"`
PayWayCode string `json:"payWayCode"`
OsType string `json:"osType"`
NotifyUrl string `json:"notifyUrl"`
AppKey string `json:"payKey"`
TimeStamp string `json:"timestamp"`
Sign string `json:"sign"`
}
func (d *Data) Url() url.Values {
return url.Values{
"exValue": {d.ExValue.Json()},
"orderNo": {d.OrderNo},
"orderPeriod": {d.OrderPeriod},
"orderPrice": {d.OrderPrice},
"payWayCode": {d.PayWayCode},
"osType": {d.OsType},
"notifyUrl": {d.NotifyUrl},
"payKey": {d.AppKey},
"timestamp": {d.TimeStamp},
"sign": {d.Sign},
}
}
type ExValue struct {
Data string `json:"data"`
CardNo string `json:"cardNo"`
FaceType string `json:"faceType"`
RecoveryType string `json:"recoveryType"`
}
func (v *ExValue) Json() string {
data, _ := json.Marshal(v)
return string(data)
}