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
68d376ad
authored
Dec 21, 2020
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
自营完成
parent
b18fc6e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
conf/dev/config.ini
service/service_ly_save.go
conf/dev/config.ini
View file @
68d376ad
...
...
@@ -14,4 +14,5 @@ SEARCH_API_MONITOR = 6d0fa85e01a02c39347d011ae973fd21b76c6c7ce582d3ea470c6b65a31
[spu_server]
api_domain
=
http://192.168.2.72:8005
;api_domain = http://192.168.2.72:8005
api_domain
=
http://localhost:8005
service/service_ly_save.go
View file @
68d376ad
...
...
@@ -10,6 +10,7 @@ import (
"go_sku_server/model"
"go_sku_server/model/saveModel"
"go_sku_server/pkg/common"
"go_sku_server/pkg/config"
"go_sku_server/pkg/e"
"go_sku_server/pkg/logger"
"go_sku_server/pkg/mysql"
...
...
@@ -184,8 +185,9 @@ func (S *LySaveService) spuHandle(lySpuRequest saveModel.LySpuRequest,lySkuEntit
lySpuResponse
:=
saveModel
.
LySpuResponse
{}
//err:=gout.POST(config.Get("spu_server.api_domain").String()+"/saveSpu1").Debug(false).SetJSON(&lySpuRequest).BindJSON(&lySpuResponse).Do()
err
:=
gout
.
POST
(
"http://192.168.1.237:8005/saveSpu"
)
.
Debug
(
false
)
.
SetJSON
(
&
lySpuRequest
)
.
BindJSON
(
&
lySpuResponse
)
.
Do
()
fmt
.
Println
(
"调用接口之前"
)
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()
if
(
err
!=
nil
){
return
e
.
NewApiError
(
"调用spu server saveSpu接口报错"
+
err
.
Error
())
...
...
@@ -193,7 +195,7 @@ func (S *LySaveService) spuHandle(lySpuRequest saveModel.LySpuRequest,lySkuEntit
if
(
lySpuResponse
.
ErrorCode
==
0
){
lySkuEntity
.
SpuId
=
lySpuResponse
.
Data
.
SpuId
}
else
{
return
e
.
NewApiError
(
"s
p
u Throw out"
+
lySpuResponse
.
ErrMsg
)
return
e
.
NewApiError
(
"s
k
u Throw out"
+
lySpuResponse
.
ErrMsg
)
}
return
nil
}
...
...
@@ -205,7 +207,7 @@ func (S *LySaveService) spuHandle(lySpuRequest saveModel.LySpuRequest,lySkuEntit
stock 库存
ladder_price 阶梯价
处理流程
满足 字段 moq stock ladder_price都有值 ,并且 moq
>
stock ; 那么 sku状态 就是 审核通过(status=1)
满足 字段 moq stock ladder_price都有值 ,并且 moq
< =
stock ; 那么 sku状态 就是 审核通过(status=1)
否则 就是下架状态(status=3)
*/
func
(
S
*
LySaveService
)
statusHandle
(
lySkuEntity
*
saveModel
.
LySkuEntity
)
{
...
...
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