feat: integrated Alipay payment module

This commit is contained in:
RockYang
2023-11-06 17:55:46 +08:00
parent da9d0dc3bc
commit 85c12aa322
26 changed files with 1599 additions and 0 deletions

21
api/store/model/order.go Normal file
View 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
}

View 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
}

View File

@@ -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
View 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
View 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"`
}

View File

@@ -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
}