- rough sku.
This commit is contained in:
@@ -3,7 +3,7 @@ package model
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type ModelO struct {
|
type ModelO struct {
|
||||||
ID uint `gorm:"primary_key"`
|
ID int `gorm:"primary_key"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
DeletedAt *time.Time `sql:"index"`
|
DeletedAt *time.Time `sql:"index"`
|
||||||
@@ -11,13 +11,13 @@ type ModelO struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ModelIDCU struct {
|
type ModelIDCU struct {
|
||||||
ID uint `gorm:"primary_key"`
|
ID int `gorm:"primary_key"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type ModelIDCUO struct {
|
type ModelIDCUO struct {
|
||||||
ID uint `gorm:"primary_key"`
|
ID int `gorm:"primary_key"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time
|
||||||
LastOperator string `gorm:"type:varchar(32)"` // 最后操作员
|
LastOperator string `gorm:"type:varchar(32)"` // 最后操作员
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Place struct {
|
type Place struct {
|
||||||
ID uint
|
ID int
|
||||||
Code int `gorm:"unique_index"` // 国家标准代码
|
Code int `gorm:"unique_index"` // 国家标准代码
|
||||||
Name string `gorm:"type:varchar(16);index"` // 如果是直辖市,省的概念不加“市”来区别
|
Name string `gorm:"type:varchar(16);index"` // 如果是直辖市,省的概念不加“市”来区别
|
||||||
ParentCode int // 上级代码
|
ParentCode int // 上级代码
|
||||||
|
|||||||
@@ -47,6 +47,15 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 这个指的是京东自已的商品分类,与商家自己的商品分类是两回事
|
||||||
|
type SkuJdCategory struct {
|
||||||
|
ModelIDCUO
|
||||||
|
Name string `gorm:"type:varchar(255);unique_index"`
|
||||||
|
Status int
|
||||||
|
Level int
|
||||||
|
ParentID int64
|
||||||
|
}
|
||||||
|
|
||||||
type SkuCategory struct {
|
type SkuCategory struct {
|
||||||
ModelIDCUO
|
ModelIDCUO
|
||||||
Name string `gorm:"type:varchar(255);unique_index"`
|
Name string `gorm:"type:varchar(255);unique_index"`
|
||||||
@@ -55,10 +64,11 @@ type SkuCategory struct {
|
|||||||
Type int8 // 类别类型
|
Type int8 // 类别类型
|
||||||
Seq int
|
Seq int
|
||||||
|
|
||||||
JdID string `gorm:"type:varchar(48)"`
|
JdID int64 `gorm:"index"` // 这个是指商家自己的商品类别在京东平台上的ID
|
||||||
ElmID string `gorm:"type:varchar(48)"`
|
JdCategoryID int64 // 这个是指对应的京东商品类别
|
||||||
MtID string `gorm:"type:varchar(48)"`
|
ElmID string `gorm:"type:varchar(48);index"`
|
||||||
DidiID string `gorm:"type:varchar(48)"`
|
MtID string `gorm:"type:varchar(48);index"`
|
||||||
|
DidiID string `gorm:"type:varchar(48);index"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoreSkuCategoryMap struct {
|
type StoreSkuCategoryMap struct {
|
||||||
|
|||||||
13
business/partner/purchase/jd/sku.go
Normal file
13
business/partner/purchase/jd/sku.go
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package jd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) AddSku(sku *model.Sku) error {
|
||||||
|
// params := map[string]interface{}{
|
||||||
|
// "outSkuId": utils.Int2Str(int(sku.ID)),
|
||||||
|
// "categoryId":
|
||||||
|
// }
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ func (p *PurchaseHandler) GetStoreFromRemote(vendorStoreID string) (*model.Store
|
|||||||
CloseTime2: JdOperationTime2JxOperationTime(result["serviceTimeEnd2"]),
|
CloseTime2: JdOperationTime2JxOperationTime(result["serviceTimeEnd2"]),
|
||||||
Status: JdStoreStatus2JxStatus(result["yn"], result["closeStatus"]),
|
Status: JdStoreStatus2JxStatus(result["yn"], result["closeStatus"]),
|
||||||
}
|
}
|
||||||
retVal.ID = uint(utils.Str2Int64WithDefault(utils.Interface2String(result["outSystemId"]), 0))
|
retVal.ID = int(utils.Str2Int64WithDefault(utils.Interface2String(result["outSystemId"]), 0))
|
||||||
return retVal, nil
|
return retVal, nil
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user