first commit
This commit is contained in:
121
pkg/res/app_user_content.go
Normal file
121
pkg/res/app_user_content.go
Normal file
@ -0,0 +1,121 @@
|
||||
package res
|
||||
|
||||
import (
|
||||
"servicebase/pkg/datasource/fields"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type CategoryRes struct {
|
||||
IDBody
|
||||
CatName string `gorm:"column:cat_name;type:varchar(60);not null" json:"cat_name"`
|
||||
IconImg string `gorm:"column:icon_img;type:varchar(255);not null" json:"icon_img"`
|
||||
ParentID string `gorm:"column:parent_id;type:int;not null" json:"parent_id"`
|
||||
Level int32 `gorm:"column:level;type:int;not null" json:"level"`
|
||||
Status int32 `gorm:"column:status;type:int;not null" json:"status"`
|
||||
IsHot string `gorm:"column:is_hot;type:char(1);not null;default:0" json:"is_hot"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type ShopRes struct {
|
||||
IDBody
|
||||
ShopName string `gorm:"column:shop_name;type:varchar(255);not null" json:"shop_name"`
|
||||
BgColor string `gorm:"column:bg_color;type:varchar(20);not null" json:"bg_color"`
|
||||
Lng string `gorm:"column:lng;type:varchar(50);not null" json:"lng"`
|
||||
Lat string `gorm:"column:lat;type:varchar(50);not null" json:"lat"`
|
||||
Address string `gorm:"column:address;type:varchar(255);not null" json:"address"`
|
||||
PostCode string `gorm:"column:post_code;type:varchar(20);not null" json:"post_code"`
|
||||
Phone string `gorm:"column:phone;type:varchar(20);not null" json:"phone"`
|
||||
OpenTime string `gorm:"column:open_time;type:varchar(255);not null" json:"open_time"`
|
||||
Traffic string `gorm:"column:traffic;type:varchar(255);not null" json:"traffic"`
|
||||
Status string `gorm:"column:status;type:char(1);not null" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type SpuRes struct {
|
||||
IDBody
|
||||
SpuCode string `gorm:"column:spu_code;type:varchar(60);not null;comment:商品编码" json:"spu_code"`
|
||||
TopCatID string `gorm:"column:top_cat_id;type:int;not null;comment:一级分类ID" json:"top_cat_id"`
|
||||
TopCatName string `gorm:"column:top_cat_name;type:varchar(60);not null;comment:一级分类ID" json:"top_cat_name"`
|
||||
SecondCatID string `gorm:"column:second_cat_id;type:int;not null;comment:二级分类ID" json:"second_cat_id"`
|
||||
SecondCatName string `gorm:"column:second_cat_name;type:varchar(60);not null;comment:二级分类ID" json:"second_cat_name"`
|
||||
ThirdCatID string `gorm:"column:third_cat_id;type:int;not null;comment:三级分类ID" json:"third_cat_id"`
|
||||
ThirdCatName string `gorm:"column:third_cat_name;type:varchar(60);not null;comment:三级分类ID" json:"third_cat_name"`
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:商品名称" json:"title"`
|
||||
HeadImg string `gorm:"column:head_img;type:varchar(255);not null;comment:商品图片" json:"head_img"`
|
||||
Tag string `gorm:"column:tag;type:varchar(100);not null;comment:标签" json:"tag"`
|
||||
NewPrice string `gorm:"column:new_price;type:varchar(30);not null;comment:新品价格" json:"new_price"`
|
||||
NewPriceProps string `gorm:"column:new_price_props;type:json;not null;comment:新品价格属性" json:"new_price_props"`
|
||||
AllowOld string `gorm:"column:allow_old;type:char(1);not null;comment:允许卖二手" json:"allow_old"`
|
||||
OldPrice string `gorm:"column:old_price;type:varchar(30);not null;comment:二手价" json:"old_price"`
|
||||
OldPriceProps string `gorm:"column:old_price_props;type:json;not null;comment:二手价属性\n" json:"old_price_props"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;comment:1=上架 2=下架" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
SortNo string `gorm:"column:sort_no;type:int;not null" json:"sort_no"`
|
||||
}
|
||||
|
||||
type SkuRes struct {
|
||||
IDBody
|
||||
SpuID string `gorm:"column:spu_id;type:int(11);not null;comment:SPUID" json:"spu_id"`
|
||||
SkuCode string `gorm:"column:sku_code;type:varchar(30);not null" json:"sku_code"`
|
||||
SkuName string `gorm:"column:sku_name;type:varchar(255);not null" json:"sku_name"`
|
||||
Attrs string `gorm:"column:attrs;type:json;not null" json:"attrs"`
|
||||
AttrsName string `gorm:"column:attrs_name;type:varchar(255);not null;comment:属性字符串" json:"attrs_name"`
|
||||
MarketPrice decimal.Decimal `gorm:"column:market_price;type:decimal(9,2);not null;comment:市场价" json:"market_price"`
|
||||
SalePrice decimal.Decimal `gorm:"column:sale_price;type:decimal(9,2);not null;comment:销售价" json:"sale_price"`
|
||||
SaleCount int32 `gorm:"column:sale_count;type:int(11);not null;comment:销量" json:"sale_count"`
|
||||
SaleStatus string `gorm:"column:sale_status;type:char(1);not null;comment:1=上架 2=下架" json:"sale_status"`
|
||||
StockNum int32 `gorm:"column:stock_num;type:int(11);not null;comment:库存" json:"stock_num"`
|
||||
}
|
||||
|
||||
type CommodityRes struct {
|
||||
IDBody
|
||||
SpuCode string `gorm:"column:spu_code;type:varchar(60);not null;comment:商品编码" json:"spu_code"`
|
||||
TopCatID string `gorm:"column:top_cat_id;type:int;not null;comment:一级分类ID" json:"top_cat_id"`
|
||||
SecondCatID string `gorm:"column:second_cat_id;type:int;not null;comment:二级分类ID" json:"second_cat_id"`
|
||||
ThirdCatID string `gorm:"column:third_cat_id;type:int;not null;comment:三级分类ID" json:"third_cat_id"`
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:商品名称" json:"title"`
|
||||
HeadImg string `gorm:"column:head_img;type:varchar(255);not null;comment:商品图片" json:"head_img"`
|
||||
Tag string `gorm:"column:tag;type:varchar(100);not null;comment:标签" json:"tag"`
|
||||
NewPrice string `gorm:"column:new_price;type:varchar(30);not null;comment:新品价格" json:"new_price"`
|
||||
NewPriceProps string `gorm:"column:new_price_props;type:json;not null;comment:新品价格属性" json:"new_price_props"`
|
||||
AllowOld string `gorm:"column:allow_old;type:char(1);not null;comment:允许卖二手" json:"allow_old"`
|
||||
OldPrice string `gorm:"column:old_price;type:varchar(30);not null;comment:二手价" json:"old_price"`
|
||||
OldPriceProps string `gorm:"column:old_price_props;type:json;not null;comment:二手价属性\n" json:"old_price_props"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;comment:1=上架 2=下架" json:"status"`
|
||||
}
|
||||
|
||||
type BannerRes struct {
|
||||
IDBody
|
||||
ImgURL string `gorm:"column:img_url;type:varchar(255);not null;comment:图片地址" json:"img_url"`
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:标题" json:"title"`
|
||||
LinkURL string `gorm:"column:link_url;type:varchar(255);not null;comment:链接" json:"link_url"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;comment:状态 1=正常 0=作废" json:"status"`
|
||||
ViewPos string `gorm:"column:view_pos;type:varchar(60);not null;comment:HOME_TOP 首页顶部 SPU_TOP 商品页顶部" json:"view_pos"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type FAQRes struct {
|
||||
IDBody
|
||||
Question string `gorm:"column:question;type:varchar(255);not null;comment:问题" json:"question"`
|
||||
Answer string `gorm:"column:answer;type:longtext;not null;comment:答案" json:"answer"`
|
||||
Status string `gorm:"column:status;type:char(1);not null" json:"status"`
|
||||
OrderNo int32 `gorm:"column:order_no;type:int;not null;default:1000;comment:序号" json:"order_no"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type ArticleRes struct {
|
||||
IDBody
|
||||
Title string `gorm:"column:title;type:varchar(255);comment:文章标题" json:"title"`
|
||||
Content string `gorm:"column:content;type:text;comment:文章内容" json:"content"`
|
||||
ImgURL string `gorm:"column:img_url;type:varchar(255);comment:文章图片" json:"img_url"`
|
||||
ArticleType string `gorm:"column:article_type;type:char(1);comment:文章类型 1=首页特色介绍 2=网站条款" json:"article_type"`
|
||||
Status string `gorm:"column:status;type:char(1);comment:文章状态 0=作废 1=正常" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user