Files
servicebase/pkg/req/app_user_order.go
2025-11-19 10:23:05 +08:00

61 lines
4.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package req
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/datasource/fields"
"github.com/shopspring/decimal"
)
type OrderInfoReq struct {
IDBody
}
type OrderCommitReq struct {
OrderType int32 `gorm:"column:order_type;type:int;not null;comment:订单类型 1=到店 2=邮寄" json:"order_type"`
OrderAmount decimal.Decimal `gorm:"column:order_amount;type:decimal(10,2);not null;comment:订单金额" json:"order_amount"`
OrderExtraAmount decimal.Decimal `gorm:"column:order_extra_amount;type:decimal(10,2);not null;comment:订单额外费用挂号信要2000其他0" json:"order_extra_amount"`
OrderPayAmount decimal.Decimal `gorm:"column:order_pay_amount;type:decimal(10,2);not null;comment:订单支付金额" json:"order_pay_amount"`
OrderPayType int32 `gorm:"column:order_pay_type;type:int;not null;comment:订单支付类型1=现金 2=银行汇款 3=挂号信" json:"order_pay_type"`
OrderPayTime fields.Time `gorm:"column:order_pay_time;type:datetime;not null;comment:订单支付时间" json:"order_pay_time"`
OrderPayNo string `gorm:"column:order_pay_no;type:varchar(255);not null;comment:订单支付流水号" json:"order_pay_no"`
OrderPayRemark string `gorm:"column:order_pay_remark;type:varchar(255);not null;comment:订单支付备注" json:"order_pay_remark"`
OrderRemark string `gorm:"column:order_remark;type:varchar(255);not null;comment:订单备注" json:"order_remark"`
ToShopID string `gorm:"column:to_shop_id;type:char(32);not null;comment:到店门店id" json:"to_shop_id"`
ToShopDate string `gorm:"column:to_shop_date;type:char(10);not null;comment:到店日期" json:"to_shop_date"`
ToShopTime string `gorm:"column:to_shop_time;type:char(20);not null;comment:到店时间" json:"to_shop_time"`
ExpressArriveDate string `gorm:"column:express_arrive_date;type:varchar(20);not null;comment:快递日期" json:"express_arrive_date"`
ExpressArriveTime string `gorm:"column:express_arrive_time;type:varchar(255);not null;comment:快递时间" json:"express_arrive_time"`
InvoiceType string `gorm:"column:invoice_type;type:char(1);not null;comment:发票类型1=需要发票 2=不需要" json:"invoice_type"`
InvoiceNo string `gorm:"column:invoice_no;type:varchar(255);comment:发票号码" json:"invoice_no"`
PersonalDocType string `gorm:"column:personal_doc_type;type:char(2);comment:身份类型" json:"personal_doc_type"`
PersonalDoc string `gorm:"column:personal_doc;type:varchar(255);comment:身份照片" json:"personal_doc"`
PersonalEndDate string `gorm:"column:personal_end_date;type:varchar(255);comment:身份照片有效期" json:"personal_end_date"`
OrderDetails []OrderDetailReq `json:"order_details"`
BankName string `json:"bank_name"`
BranchBankName string `json:"branch_bank_name"`
CardType string `json:"card_type"`
CardNo string `json:"card_no"`
CardUserName string `json:"card_user_name"`
PersonalDoc2 string `json:"personal_doc_2"`
}
func (d *OrderCommitReq) Check() error {
if len(d.OrderDetails) == 0 {
return errors.New("没有商品信息")
}
return nil
}
type OrderDetailReq struct {
OrderID int32 `gorm:"column:order_id;type:int;not null;comment:订单ID" json:"order_id"`
ProductID string `gorm:"column:product_id;type:char(32);not null;comment:商品ID" json:"product_id"`
ProductName string `gorm:"column:product_name;type:varchar(255);not null;comment:商品名称" json:"product_name"`
ProductPrice decimal.Decimal `gorm:"column:product_price;type:decimal(10,2);not null;comment:商品价格" json:"product_price"`
ProductNum int32 `gorm:"column:product_num;type:int;not null;comment:商品数量" json:"product_num"`
ProductTotal decimal.Decimal `gorm:"column:product_total;type:decimal(10,2);not null;comment:商品总价" json:"product_total"`
ProductPros string `gorm:"column:product_pros;type:varchar(255);not null;comment:属性" json:"product_pros"`
PriceType string `gorm:"column:price_type;type:char(50);not null;comment:价格类型" json:"price_type"`
}