diff --git a/data/card.go b/data/card.go new file mode 100644 index 0000000..e7ed8f2 --- /dev/null +++ b/data/card.go @@ -0,0 +1,24 @@ +package data + +import "time" + +type Card struct { + OrderNumber string + ResellerId int + ResellerOrderNumber string + OursProductId int + Price float32 + Quantity int + Amount float32 + PayStatus int + Status int + Profit float32 + NotifyUrl string + NotifyTime time.Time + CreateIp int + CreateTime time.Time + CardCode string + FinishTime time.Time + Message string + Mobile string +} diff --git a/data/direct.go b/data/direct.go new file mode 100644 index 0000000..95415c6 --- /dev/null +++ b/data/direct.go @@ -0,0 +1,35 @@ +package data + +import "time" + +type PlatformProduct struct { + Id int64 + Name string +} + +func (p PlatformProduct) TableName() string { + return "platform_product" +} + +type Direct struct { + SerialNumber string `gorm:"primaryKey;column:serial_number"` + OrderOrderNumber string `gorm:"column:order_order_number"` + TerminalAccount string `gorm:"column:terminal_account"` + OursProductId int `gorm:"column:ours_product_id"` + Status int `gorm:"column:status"` + TradePrice float32 `gorm:"column:trade_price"` + PlatformProductId int `gorm:"column:platform_product_id"` + PlatformPrice float32 `gorm:"column:platform_price"` + CreateTime time.Time `gorm:"column:create_time"` + ExecuteTime time.Time `gorm:"column:execute_time"` + Identifier int `gorm:"column:identifier"` + Version int `gorm:"column:version"` + Type int `gorm:"column:type"` + Position int `gorm:"column:position"` + OrderItem OrderItem `gorm:"foreignkey:order_order_number;references:order_order_number"` + PlatformProduct PlatformProduct `gorm:"foreignkey:id;references:platform_product_id"` +} + +func (d Direct) TableName() string { + return "order_direct" +} diff --git a/export/excel_test.go b/export/excel_test.go index 91f74a0..687d9f4 100644 --- a/export/excel_test.go +++ b/export/excel_test.go @@ -1,8 +1,8 @@ package export import ( + "excel_export/data" "fmt" - "lsxd_excel/data" "os" "testing" ) diff --git a/export/order.go b/export/order.go index 84603df..f5e60ca 100644 --- a/export/order.go +++ b/export/order.go @@ -1,7 +1,7 @@ package export import ( - "lsxd_excel/data" + "excel_export/data" "time" ) diff --git a/go.mod b/go.mod index 00cd312..d5bdd67 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,12 @@ module excel_export -go 1.18 +go 1.17 + +require ( + github.com/tealeg/xlsx/v3 v3.2.4 // direct + gorm.io/driver/mysql v1.4.5 // direct + gorm.io/gorm v1.24.3 // direct +) require ( github.com/frankban/quicktest v1.11.2 // indirect @@ -14,9 +20,6 @@ require ( github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/rogpeppe/fastuuid v1.2.0 // indirect github.com/shabbyrobe/xmlwriter v0.0.0-20200208144257-9fca06d00ffa // indirect - github.com/tealeg/xlsx/v3 v3.2.4 // direct golang.org/x/text v0.3.3 // indirect golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect - gorm.io/driver/mysql v1.4.5 // direct - gorm.io/gorm v1.24.3 // direct )