- sku man.
This commit is contained in:
@@ -10,20 +10,23 @@ import (
|
||||
)
|
||||
|
||||
func NormalFilterMapByStructObject(mapData map[string]interface{}, obj interface{}) (valid map[string]interface{}, invalid map[string]interface{}) {
|
||||
return jxutils.FilterMapByStructObject(mapData, obj, []string{"id", "createdAt", "syncStatus", "lastOperator", "updatedAt", "finishedAt"})
|
||||
// 这里必须用首字母小写,因为是用于访问map,是用于访问map,是需要完全匹配的
|
||||
return jxutils.FilterMapByStructObject(mapData, obj, []string{"id", "createdAt", "updatedAt", "finishedAt", "deletedAt", "syncStatus", "lastOperator"})
|
||||
}
|
||||
|
||||
func NormalMakeMapByStructObject(mapData map[string]interface{}, obj interface{}, userName string) (retVal map[string]interface{}) {
|
||||
retVal, _ = NormalFilterMapByStructObject(mapData, obj)
|
||||
retVal["lastOperator"] = userName
|
||||
retVal["updatedAt"] = time.Now()
|
||||
if len(retVal) > 0 {
|
||||
WrapUpdateULEntity(retVal, userName)
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
func NormalMakeMapByFieldList(mapData map[string]interface{}, fields []string, userName string) (retVal map[string]interface{}) {
|
||||
retVal, _ = jxutils.FilterMapByFieldList(mapData, fields)
|
||||
retVal["lastOperator"] = userName
|
||||
retVal["updatedAt"] = time.Now()
|
||||
if len(retVal) > 0 {
|
||||
WrapUpdateULEntity(retVal, userName)
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ const (
|
||||
FieldVendorID = "VendorID"
|
||||
FieldStoreID = "StoreID"
|
||||
FieldVendorStoreID = "VendorStoreID"
|
||||
FieldNameID = "NameID"
|
||||
)
|
||||
|
||||
type ModelIDCUL struct {
|
||||
|
||||
@@ -80,13 +80,12 @@ type SkuCategory struct {
|
||||
Type int8 `json:"type"` // 类别类型,即是普通类别还是特殊用于做活动的类别
|
||||
Seq int `json:"seq"`
|
||||
|
||||
JdID int64 `orm:"column(jd_id);index" json:"jdID"` // 这个是指商家自己的商品类别在京东平台上的ID
|
||||
JdCategoryID int `orm:"column(jd_category_id)" json:"jdCategoryID"` // 这个是指对应的京东商品类别
|
||||
|
||||
JdCategoryID int `orm:"column(jd_category_id)" json:"jdCategoryID"` // 这个是指对应的京东商品类别
|
||||
ElmCategoryID int64 `orm:"column(elm_category_id)" json:"elmCategoryID"` // 这个是指对应的饿了么商品类别
|
||||
EbaiCategoryID int64 `orm:"column(ebai_category_id)" json:"ebaiCategoryID"` // 这个是指对应的饿百商品类别
|
||||
|
||||
JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"`
|
||||
JdID int64 `orm:"column(jd_id);index" json:"jdID"` // 这个是指商家自己的商品类别在京东平台上的ID
|
||||
JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"`
|
||||
}
|
||||
|
||||
func (*SkuCategory) TableUnique() [][]string {
|
||||
@@ -96,7 +95,7 @@ func (*SkuCategory) TableUnique() [][]string {
|
||||
}
|
||||
|
||||
type SkuName struct {
|
||||
ModelIDCUL
|
||||
ModelIDCULD
|
||||
|
||||
Prefix string `orm:"size(255)" json:"prefix"`
|
||||
Name string `orm:"size(255)" json:"name"`
|
||||
@@ -120,7 +119,7 @@ type SkuName struct {
|
||||
// }
|
||||
|
||||
type Sku struct {
|
||||
ModelIDCUL
|
||||
ModelIDCULD
|
||||
|
||||
CategoryID int `orm:"column(category_id)" json:"categoryID"` // 特殊类别,一般用于秒杀,特价之类的特殊类别
|
||||
NameID int `orm:"column(name_id)" json:"nameID"` // todo 这个索引应该要求唯一
|
||||
@@ -128,7 +127,8 @@ type Sku struct {
|
||||
SpecUnit string `orm:"size(8)" json:"specUnit"` // 质量或容量
|
||||
Weight int `json:"weight"` // 重量/质量,单位为克,当相应的SkuName的SpecUnit为g或kg时,必须等于SpecQuality
|
||||
|
||||
JdID int64 `orm:"column(jd_id)" json:"jdID"`
|
||||
JdID int64 `orm:"column(jd_id)" json:"jdID"`
|
||||
JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"`
|
||||
}
|
||||
|
||||
func (*Sku) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user