From 2ede3679d8e511ace01313fde059ab5cb89fdac5 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 26 Mar 2024 14:27:17 +0800 Subject: [PATCH] update --- app/db/model/goods.go | 16 ++++++++++++++++ app/db/model/sku.go | 12 ++++++++++++ etc/cfg.yml | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/db/model/goods.go create mode 100644 app/db/model/sku.go diff --git a/app/db/model/goods.go b/app/db/model/goods.go new file mode 100644 index 0000000..6bb8f4d --- /dev/null +++ b/app/db/model/goods.go @@ -0,0 +1,16 @@ +package model + +type Goods struct { + GoodsId int64 `json:"goods_id" xorm:"not null pk comment('商品id') unique BIGINT(20)"` + Title string `json:"title" xorm:"not null default '' comment('商品标题') VARCHAR(1024)"` + CategoryId int `json:"category_id" xorm:"not null default 0 comment('类目ID') INT(11)"` + ImageList string `json:"image_list" xorm:"comment('商品图json') TEXT"` + SaleState int `json:"sale_state" xorm:"not null default 0 comment('销售状态 1销售中 2下架') TINYINT(1)"` + Spe string `json:"spe" xorm:"not null default '' comment('所有规格属性json') VARCHAR(5012)"` + Detail string `json:"detail" xorm:"comment('商品详情') TEXT"` + Price string `json:"price" xorm:"comment('起底价') DECIMAL(10,2)"` + Sort int `json:"sort" xorm:"not null default 0 comment('排序') INT(11)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` + DeleteAt string `json:"delete_at" xorm:"comment('商品删除字段,不为null时,表示删除') DATETIME"` +} diff --git a/app/db/model/sku.go b/app/db/model/sku.go new file mode 100644 index 0000000..1724489 --- /dev/null +++ b/app/db/model/sku.go @@ -0,0 +1,12 @@ +package model + +type Sku struct { + SkuId int64 `json:"sku_id" xorm:"not null pk unique BIGINT(30)"` + SkuCode string `json:"sku_code" xorm:"not null comment('sku编码') VARCHAR(255)"` + GoodsId int64 `json:"goods_id" xorm:"not null comment('商品id') index BIGINT(20)"` + Price string `json:"price" xorm:"not null default 0.00 comment('价格') DECIMAL(12,2)"` + Indexes string `json:"indexes" xorm:"not null default '' comment('规格值组合的下标') VARCHAR(100)"` + Sku string `json:"sku" xorm:"not null comment('规格组合json') VARCHAR(2048)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` +} diff --git a/etc/cfg.yml b/etc/cfg.yml index 36f60f1..a47c022 100644 --- a/etc/cfg.yml +++ b/etc/cfg.yml @@ -6,7 +6,7 @@ local: true # 服务器参数 srv_addr: ':4001' # 缓存 -redis_addr: '127.0.0.1:6379' +redis_addr: '120.24.28.6:32572' redis_password: '' # 连接官网数据库获取db mapping