Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3b6ac6e0
authored
Dec 22, 2020
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改一些注释
parent
68d376ad
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
model/saveModel/ly_sku_entity.go
model/saveModel/save_request.go
model/sku_redis.go
service/service_ly_save.go
model/saveModel/ly_sku_entity.go
View file @
3b6ac6e0
...
@@ -22,7 +22,7 @@ type LySkuEntity struct {
...
@@ -22,7 +22,7 @@ type LySkuEntity struct {
GoodsId
string
`json:"goods_id"`
GoodsId
string
`json:"goods_id"`
SpuId
string
`json:"spu_id"`
SpuId
string
`json:"spu_id"`
GoodsType
int
`json:"goods_type"`
//'0:自营 1:联营 2:专卖',
GoodsType
int
`json:"goods_type"`
//'0:自营 1:联营 2:专卖',
Encoded
int
`json:"encoded"`
//
供应商
编码
Encoded
int
`json:"encoded"`
//
内部
编码
Canal
string
`json:"canal" form:"canal" `
//供应商编码-渠道标签
Canal
string
`json:"canal" form:"canal" `
//供应商编码-渠道标签
BatchSn
string
`json:"batch_sn" form:"batch_sn" `
//批次
BatchSn
string
`json:"batch_sn" form:"batch_sn" `
//批次
...
...
model/saveModel/save_request.go
View file @
3b6ac6e0
...
@@ -57,6 +57,10 @@ func (LR *LySaveRequest)ToLySpuRequest() LySpuRequest{
...
@@ -57,6 +57,10 @@ func (LR *LySaveRequest)ToLySpuRequest() LySpuRequest{
/*func (L * LySaveRequest)GetAttrsJson() map[string]interface{} {
/*func (L * LySaveRequest)GetAttrsJson() map[string]interface{} {
if AttrsMap,ok:=L.Attrs.(map[string]interface{});ok{
if AttrsMap,ok:=L.Attrs.(map[string]interface{});ok{
...
...
model/sku_redis.go
View file @
3b6ac6e0
...
@@ -2,7 +2,7 @@ package model
...
@@ -2,7 +2,7 @@ package model
/**
/**
@author wangsong
@author wangsong
redis hash sku 结构,主要是用作新增插入用
联营
redis hash sku 结构,主要是用作新增插入用
poolSkuSave 插入redis就是这些字段
poolSkuSave 插入redis就是这些字段
*/
*/
type
SkuRedisInfo
struct
{
type
SkuRedisInfo
struct
{
...
@@ -18,7 +18,7 @@ type SkuRedisInfo struct {
...
@@ -18,7 +18,7 @@ type SkuRedisInfo struct {
Stock
int
`json:"stock" form:"stock" `
//库存
Stock
int
`json:"stock" form:"stock" `
//库存
HkDeliveryTime
string
`json:"hk_delivery_time" form:"hk_delivery_time" `
//香港货期
HkDeliveryTime
string
`json:"hk_delivery_time" form:"hk_delivery_time" `
//香港货期
CnDeliveryTime
string
`json:"cn_delivery_time" form:"cn_delivery_time" `
//大陆货期
CnDeliveryTime
string
`json:"cn_delivery_time" form:"cn_delivery_time" `
//大陆货期
LadderPrice
interface
{}
`json:"ladder_price" form:"ladder_price" `
//阶梯价钱
用 string json化会出现斜划线,所以用interface{}
LadderPrice
interface
{}
`json:"ladder_price" form:"ladder_price" `
//阶梯价钱
UpdateTime
int
`json:"update_time" xorm:"created"`
UpdateTime
int
`json:"update_time" xorm:"created"`
GoodsImages
string
`json:"goods_images" form:"goods_images" `
//商品图片 所属spu
GoodsImages
string
`json:"goods_images" form:"goods_images" `
//商品图片 所属spu
Canal
string
`json:"canal" form:"canal" `
//渠道开发员ID
Canal
string
`json:"canal" form:"canal" `
//渠道开发员ID
...
...
service/service_ly_save.go
View file @
3b6ac6e0
...
@@ -131,7 +131,7 @@ func (S *LySaveService) supplierHandle(SupplierId int,Canal string,lySkuEntity *
...
@@ -131,7 +131,7 @@ func (S *LySaveService) supplierHandle(SupplierId int,Canal string,lySkuEntity *
errmsg
:=
fmt
.
Sprintf
(
"没有获取到渠道%s的内部编码"
,
Canal
)
errmsg
:=
fmt
.
Sprintf
(
"没有获取到渠道%s的内部编码"
,
Canal
)
return
e
.
NewApiError
(
errmsg
)
return
e
.
NewApiError
(
errmsg
)
}
}
lySkuEntity
.
Encoded
=
poolSupplierInfo
.
ChannelUid
//渠道编码赋值给sku
lySkuEntity
.
Encoded
=
poolSupplierInfo
.
ChannelUid
//渠道
开发员 内部
编码赋值给sku
}
}
lySkuEntity
.
GoodsType
=
supplierInfo
.
TypeId
lySkuEntity
.
GoodsType
=
supplierInfo
.
TypeId
...
@@ -185,7 +185,6 @@ func (S *LySaveService) spuHandle(lySpuRequest saveModel.LySpuRequest,lySkuEntit
...
@@ -185,7 +185,6 @@ func (S *LySaveService) spuHandle(lySpuRequest saveModel.LySpuRequest,lySkuEntit
lySpuResponse
:=
saveModel
.
LySpuResponse
{}
lySpuResponse
:=
saveModel
.
LySpuResponse
{}
fmt
.
Println
(
"调用接口之前"
)
err
:=
gout
.
POST
(
config
.
Get
(
"spu_server.api_domain"
)
.
String
()
+
"/saveSpu"
)
/*.Debug(true)*/
.
SetJSON
(
&
lySpuRequest
)
.
BindJSON
(
&
lySpuResponse
)
.
Do
()
err
:=
gout
.
POST
(
config
.
Get
(
"spu_server.api_domain"
)
.
String
()
+
"/saveSpu"
)
/*.Debug(true)*/
.
SetJSON
(
&
lySpuRequest
)
.
BindJSON
(
&
lySpuResponse
)
.
Do
()
//err:=gout.POST("http://192.168.1.237:8005/saveSpu").Debug(false).SetJSON(&lySpuRequest).BindJSON(&lySpuResponse).Do()
//err:=gout.POST("http://192.168.1.237:8005/saveSpu").Debug(false).SetJSON(&lySpuRequest).BindJSON(&lySpuResponse).Do()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment