🎨 新增订单模块

This commit is contained in:
2025-07-19 06:18:44 +08:00
parent aac13d369c
commit 8106282c8b
2 changed files with 30 additions and 0 deletions

22
model/app/order.go Normal file
View File

@@ -0,0 +1,22 @@
package app
import "git.echol.cn/loser/lckt/global"
type Order struct {
global.GVA_MODEL
OrderNo string `gorm:"column:order_no;type:varchar(24);comment:订单编号;NOT NULL" json:"order_no"`
UserId uint64 `gorm:"column:user_id;type:bigint(20) unsigned;comment:用户ID;NOT NULL" json:"user_id"`
OrderType int `gorm:"column:order_type;type:int(11);comment:订单类型 |1 课程|2 vip|;NOT NULL" json:"order_type"`
ArticleId uint `gorm:"column:article_id;type:bigint(20) unsigned;default:0;comment:文章ID;NOT NULL" json:"article_id"`
Name string `gorm:"column:name;type:varchar(255);comment:名称;NOT NULL" json:"name"`
Price int64 `gorm:"column:price;type:int(11) unsigned;default:0;comment:订单价格;NOT NULL" json:"price"`
Phone string `gorm:"column:phone;type:varchar(11);comment:手机号;NOT NULL" json:"phone"`
TeacherId uint64 `gorm:"column:teacher_Id;type:bigint(20);comment:教师Id;NOT NULL" json:"teacher_Id"`
Status int `gorm:"column:status;type:int(11);default:1;comment:订单状态 |1 未付款|2 已付款|3 已过期|;NOT NULL" json:"status"`
Desc string `gorm:"column:desc;type:varchar(24);comment:订单描述;NOT NULL" json:"desc"`
}
// TableName Order表
func (Order) TableName() string {
return "app_order"
}

8
service/app/order.go Normal file
View File

@@ -0,0 +1,8 @@
package app
type OrderService struct{}
// Pay 发起支付
func (s *OrderService) Pay(orderId string, userId int64) (string, error) {
return "", nil
}