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.

52 lines
1.5 KiB

package model
import (
"database/sql/driver"
"encoding/json"
)
type PayRequests []PayRequest
type PayRequest struct {
Field string `json:"field"`
Host string `json:"host"` // 域名
Status bool `json:"status"` // 是否启用
CustomPool []HttpParams `json:"customPool"` // 自定义参数池 //map[string]HttpParams
PayFuncs PayFuncs `json:"payFuncs"` // 请求集合
White ArryString `json:"white"` // 白名单
}
type PayFuncs []PayFunc
func (j *PayRequests) Scan(value interface{}) error {
return json.Unmarshal(value.([]byte), &j)
}
func (j PayRequests) Value() (driver.Value, error) {
return json.Marshal(j)
}
type PayFunc struct {
Name string `json:"name"` // 名称
Field string `json:"field"`
Http Http `json:"http"` // http请求
Sort int `json:"sort"` // 序号
}
/*
支付渠道
*/
type PayChannel struct {
Id int64 `gorm:"primary_key;column:id" json:"id"` // 渠道ID
Name string `gorm:"column:name" json:"name"` // 渠道名称
Logo string `gorm:"column:logo" json:"logo"` // 渠道Logo
Request PayRequests `gorm:"column:pay_requests" json:"payRequests"` // 接入
Status bool `gorm:"column:status" json:"status"` // 是否启用
CreateTime int64 `gorm:"column:create_time" json:"createTime"` // 创建时间
}
func (PayChannel) TableName() string {
return "pay_channel"
}