From 31deb7ba5d918d6f82b724fc3a0eb4cd0bc469c0 Mon Sep 17 00:00:00 2001 From: RIceWqy <1840169763@qq.com> Date: Sun, 24 Dec 2023 17:07:58 +0800 Subject: [PATCH] init --- module/Coupon/Coupon.go | 27 ++++++++++++++++++++++ module/common/TimeRange.go | 6 +++++ module/goods/Goods.go | 46 +++++++++++++++++++++++++++++++++++++ module/goods/init.go | 1 + module/service/Service.go | 13 +++++++++++ module/skuPrice/SKUPrice.go | 22 ++++++++++++++++++ 6 files changed, 115 insertions(+) create mode 100644 module/Coupon/Coupon.go create mode 100644 module/common/TimeRange.go create mode 100644 module/goods/Goods.go create mode 100644 module/goods/init.go create mode 100644 module/service/Service.go create mode 100644 module/skuPrice/SKUPrice.go diff --git a/module/Coupon/Coupon.go b/module/Coupon/Coupon.go new file mode 100644 index 0000000..980017c --- /dev/null +++ b/module/Coupon/Coupon.go @@ -0,0 +1,27 @@ +package goods + +import "src/module/common" + +func (Coupon) TableName() string { + return "coupon" +} + +// Coupon 结构体表示优惠券信息 +type Coupon struct { + ID int `json:"id"` // 优惠券ID + Name string `json:"name"` // 优惠券名称 + Type string `json:"type"` // 优惠券类型 + GoodsIDs string `json:"goods_ids"` // 商品ID + Amount string `json:"amount"` // 优惠券金额 + Enough string `json:"enough"` // 满足条件金额 + Stock int `json:"stock"` // 库存数量 + Limit int `json:"limit"` // 领取限制 + GetTime common.TimeRange `json:"gettime"` // 领取时间范围 + UseTime common.TimeRange `json:"usetime"` // 使用时间范围 + Description string `json:"description"` // 优惠券描述 + StartTime int64 `json:"gettimestart"` // 领取开始时间 + EndTime int64 `json:"gettimeend"` // 领取结束时间 + Status string `json:"status_code"` // 优惠券状态代码 + StatusName string `json:"status_name"` // 优惠券状态名称 + UserCoupons []string `json:"user_coupons"` // 用户优惠券列表 +} diff --git a/module/common/TimeRange.go b/module/common/TimeRange.go new file mode 100644 index 0000000..f249d57 --- /dev/null +++ b/module/common/TimeRange.go @@ -0,0 +1,6 @@ +package common + +type TimeRange struct { + Start int64 `json:"start"` // 开始时间 + End int64 `json:"end"` // 结束时间 +} diff --git a/module/goods/Goods.go b/module/goods/Goods.go new file mode 100644 index 0000000..a086edb --- /dev/null +++ b/module/goods/Goods.go @@ -0,0 +1,46 @@ +package goods + +import service "src/module/service" +import skuPrice "src/module/skuPrice" + +func (Goods) TableName() string { + return "goods" +} + +// Product 结构体表示产品信息 +type Goods struct { + ID int `json:"id"` // 产品ID + Type string `json:"type"` // 产品类型 + Title string `json:"title"` // 产品标题 + Subtitle string `json:"subtitle"` // 产品副标题 + Weigh int `json:"weigh"` // 产品权重 + CategoryIDs string `json:"category_ids"` // 类别ID + Image string `json:"image"` // 产品图片 + Images []string `json:"images"` // 产品图片数组 + Params []string `json:"params"` // 产品参数 + Content string `json:"content"` // 产品内容 + Price string `json:"price"` // 产品价格 + OriginalPrice string `json:"original_price"` // 产品原价 + IsSKU int `json:"is_sku"` // 是否有SKU + Likes int `json:"likes"` // 喜欢数 + Views int `json:"views"` // 浏览数 + Sales int `json:"sales"` // 销售数 + ShowSales int `json:"show_sales"` // 展示销售数 + ServiceIDs string `json:"service_ids"` // 服务ID + DispatchType string `json:"dispatch_type"` // 派送类型 + DispatchIDs string `json:"dispatch_ids"` // 派送ID + DeleteTime interface{} `json:"deletetime"` // 删除时间 + Activity interface{} `json:"activity"` // 活动 + ActivityType interface{} `json:"activity_type"` // 活动类型 + Buyers []string `json:"buyers"` // 购买者列表 + SKUPrice []skuPrice.SKUPrice `json:"sku_price"` // SKU价格列表 + Stock int `json:"stock"` // 库存 + ActivityDiscounts []string `json:"activity_discounts"` // 活动折扣列表 + ActivityDiscountsTypes string `json:"activity_discounts_types"` // 活动折扣类型 + ActivityDiscountsTags []string `json:"activity_discounts_tags"` // 活动折扣标签 + Favorite interface{} `json:"favorite"` // 收藏 + DispatchTypeArr []string `json:"dispatch_type_arr"` // 派送类型数组 + Service []service.Service `json:"service"` // 服务列表 + SKU []string `json:"sku"` // SKU列表 + Coupons []Coupon `json:"coupons"` // 优惠券列表 +} diff --git a/module/goods/init.go b/module/goods/init.go new file mode 100644 index 0000000..81d4951 --- /dev/null +++ b/module/goods/init.go @@ -0,0 +1 @@ +package goods diff --git a/module/service/Service.go b/module/service/Service.go new file mode 100644 index 0000000..85083c4 --- /dev/null +++ b/module/service/Service.go @@ -0,0 +1,13 @@ +package goods + +func (Service) TableName() string { + return "service" +} + +// Service 结构体表示服务信息 +type Service struct { + ID int `json:"id"` // 服务ID + Name string `json:"name"` // 服务名称 + Image string `json:"image"` // 服务图片 + Description string `json:"description"` // 服务描述 +} diff --git a/module/skuPrice/SKUPrice.go b/module/skuPrice/SKUPrice.go new file mode 100644 index 0000000..fb1645f --- /dev/null +++ b/module/skuPrice/SKUPrice.go @@ -0,0 +1,22 @@ +package goods + +func (SKUPrice) TableName() string { + return "sku_price" +} + +// SKUPrice 结构体表示SKU价格信息 +type SKUPrice struct { + ID int `json:"id"` // SKU价格ID + GoodsID int `json:"goods_id"` // 商品ID + Weigh int `json:"weigh"` // 重量 + Image string `json:"image"` // 图片 + Stock int `json:"stock"` // 库存 + StockWarning string `json:"stock_warning"` // 库存警告 + Sales int `json:"sales"` // 销售数量 + SN string `json:"sn"` // 序列号 + Weight int `json:"weight"` // 重量 + Price string `json:"price"` // 价格 + GoodsSKUText string `json:"goods_sku_text"` // 商品SKU文本 + Status string `json:"status"` // 状态 + GoodsSKUIDArr []string `json:"goods_sku_id_arr"` // 商品SKU ID数组 +}