feat: 代码生成

This commit is contained in:
Blizzard
2026-04-28 10:29:02 +08:00
parent 7e282b36d7
commit b343856b58
38 changed files with 2199 additions and 51 deletions
+13
View File
@@ -0,0 +1,13 @@
package order
import "sundynix-go/global"
// Order
type Order struct {
global.BaseModel
UserId string `gorm:"column:user_id;size:50" json:"userId"` //
}
func (Order) TableName() string {
return "sundynix_order"
}
+13
View File
@@ -0,0 +1,13 @@
package order
import "sundynix-go/global"
// Refund
type Refund struct {
global.BaseModel
UserId string `gorm:"column:user_id;size:50" json:"userId"` //
}
func (Refund) TableName() string {
return "sundynix_refund"
}
+41
View File
@@ -0,0 +1,41 @@
package request
// ---- ----
// SaveRefundReq 新增请求
type SaveRefundReq struct {
UserId string `json:"userId" form:"userId"` //
}
// UpdateRefundReq 更新请求
type UpdateRefundReq struct {
Id string `json:"id" binding:"required"` // ID
UserId string `json:"userId" form:"userId"` //
}
// ListRefundReq 分页查询请求
type ListRefundReq struct {
Current int `json:"current" form:"current"` // 页码
PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
Keyword string `json:"keyword" form:"keyword"` // 关键字搜索
}
// ---- ----
// SaveStockReq 新增请求
type SaveStockReq struct {
Amount int64 `json:"amount" form:"amount"` //
}
// UpdateStockReq 更新请求
type UpdateStockReq struct {
Id string `json:"id" binding:"required"` // ID
Amount int64 `json:"amount" form:"amount"` //
}
// ListStockReq 分页查询请求
type ListStockReq struct {
Current int `json:"current" form:"current"` // 页码
PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
Keyword string `json:"keyword" form:"keyword"` // 关键字搜索
}
+13
View File
@@ -0,0 +1,13 @@
package order
import "sundynix-go/global"
// Stock
type Stock struct {
global.BaseModel
Amount int64 `gorm:"column:amount" json:"amount"` //
}
func (Stock) TableName() string {
return "sundynix_stock"
}