mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 20:23:46 +08:00
feat: integrated Alipay payment module
This commit is contained in:
21
api/store/model/order.go
Normal file
21
api/store/model/order.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"chatplus/core/types"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Order 充值订单
|
||||
type Order struct {
|
||||
BaseModel
|
||||
UserId uint
|
||||
ProductId uint
|
||||
Mobile string
|
||||
OrderNo string
|
||||
Subject string
|
||||
Amount float64
|
||||
Status types.OrderStatus
|
||||
Remark string
|
||||
PayTime int64
|
||||
DeletedAt gorm.DeletedAt
|
||||
}
|
||||
14
api/store/model/product.go
Normal file
14
api/store/model/product.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
// Product 充值产品
|
||||
type Product struct {
|
||||
BaseModel
|
||||
Name string
|
||||
Price float64
|
||||
Discount float64
|
||||
Days int
|
||||
Calls int
|
||||
Enabled bool
|
||||
Sales int
|
||||
SortNum int
|
||||
}
|
||||
@@ -16,4 +16,6 @@ type User struct {
|
||||
Status bool `gorm:"default:true"` // 当前状态
|
||||
LastLoginAt int64 // 最后登录时间
|
||||
LastLoginIp string // 最后登录 IP
|
||||
Vip bool // 是否 VIP 会员
|
||||
Tokens int
|
||||
}
|
||||
|
||||
18
api/store/vo/order.go
Normal file
18
api/store/vo/order.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package vo
|
||||
|
||||
import (
|
||||
"chatplus/core/types"
|
||||
)
|
||||
|
||||
type Order struct {
|
||||
BaseVo
|
||||
UserId uint `json:"user_id"`
|
||||
ProductId uint `json:"product_id"`
|
||||
Mobile string `json:"mobile"`
|
||||
OrderNo string `json:"order_no"`
|
||||
Subject string `json:"subject"`
|
||||
Amount float64 `json:"amount"`
|
||||
Status types.OrderStatus `json:"status"`
|
||||
PayTime int64 `json:"pay_time"`
|
||||
Remark types.OrderRemark `json:"remark"`
|
||||
}
|
||||
13
api/store/vo/product.go
Normal file
13
api/store/vo/product.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package vo
|
||||
|
||||
type Product struct {
|
||||
BaseVo
|
||||
Name string `json:"name"`
|
||||
Price float64 `json:"price"`
|
||||
Discount float64 `json:"discount"`
|
||||
Days int `json:"days"`
|
||||
Calls int `json:"calls"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Sales int `json:"sales"`
|
||||
SortNum int `json:"sort_num"`
|
||||
}
|
||||
@@ -17,4 +17,6 @@ type User struct {
|
||||
Status bool `json:"status"` // 当前状态
|
||||
LastLoginAt int64 `json:"last_login_at"` // 最后登录时间
|
||||
LastLoginIp string `json:"last_login_ip"` // 最后登录 IP
|
||||
Vip bool `json:"vip"`
|
||||
Tokens int `json:"token"` // 当月消耗的 fee
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user