Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
c332febd
authored
Nov 27, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
c7672236
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
controller/ly_sourceability_controller.go
service/ly/sourceability.go
controller/ly_sourceability_controller.go
View file @
c332febd
...
@@ -10,6 +10,10 @@ import (
...
@@ -10,6 +10,10 @@ import (
func
GetSourceabilityData
(
ctx
*
gin
.
Context
)
{
func
GetSourceabilityData
(
ctx
*
gin
.
Context
)
{
goodsName
:=
ctx
.
Request
.
FormValue
(
"k"
)
//关键词
goodsName
:=
ctx
.
Request
.
FormValue
(
"k"
)
//关键词
common
.
PrintDebugHeader
(
ctx
)
//debug
common
.
PrintDebugHeader
(
ctx
)
//debug
if
ctx
.
Request
.
FormValue
(
"flag"
)
==
"1"
{
ctx
.
String
(
200
,
`{"error_code":0,"err_msg":"","data":{"LM358AD-1438416474":{"goods_sn":"LM358AD-1438416474","goods_name":"LM358AD","brand_name":"STMICROELECTRONICS","desc":"Low input bias current","docurl":"","url":"","goods_img":"","cat":"","stock":[1613,19924],"increment":1,"price_temp":[[1613,0.13307],[10000,0.12621]],"tiered":[{"purchases":1613,"price_us":0.13307,"price_cn":0,"price_ac":0},{"purchases":10000,"price_us":0.12621,"price_cn":0,"price_ac":0}],"single_price":0.12621},"LM358MX-1840114430":{"goods_sn":"LM358MX-1840114430","goods_name":"LM358MX","brand_name":"Texas Instruments Incorporated","desc":"Operational Amplifier, 2 Func, 7000uV Offset-Max, BIPolar, PDSO8","docurl":"","url":"","goods_img":"","cat":"","stock":[782,2187],"increment":1,"price_temp":[[782,0.4928],[790,0.48752],[1600,0.47608]],"tiered":[{"purchases":782,"price_us":0.4928,"price_cn":0,"price_ac":0},{"purchases":790,"price_us":0.48752,"price_cn":0,"price_ac":0},{"purchases":1600,"price_us":0.47608,"price_cn":0,"price_ac":0}],"single_price":0.47608},"LM358H-1840114428":{"goods_sn":"LM358H-1840114428","goods_name":"LM358H","brand_name":"Texas Instruments Incorporated","desc":"Operational Amplifier, 2 Func, 9000uV Offset-Max, BIPolar, MBCY8","docurl":"","url":"","goods_img":"","cat":"","stock":[68,2736],"increment":1,"price_temp":[[68,5.7134],[70,5.65219],[140,5.51956],[340,5.40733],[680,5.3053]],"tiered":[{"purchases":68,"price_us":5.7134,"price_cn":0,"price_ac":0},{"purchases":70,"price_us":5.65219,"price_cn":0,"price_ac":0},{"purchases":140,"price_us":5.51956,"price_cn":0,"price_ac":0},{"purchases":340,"price_us":5.40733,"price_cn":0,"price_ac":0},{"purchases":680,"price_us":5.3053,"price_cn":0,"price_ac":0}],"single_price":5.3053},"LM358P-1503747557":{"goods_sn":"LM358P-1503747557","goods_name":"LM358P","brand_name":"Texas Instruments Incorporated","desc":"Operational Amplifier, 2 Func, 7000uV Offset-Max, BIPolar, PDIP8","docurl":"","url":"","goods_img":"","cat":"","stock":[709,1520],"increment":1,"price_temp":[[709,0.07768]],"tiered":[{"purchases":709,"price_us":0.07768,"price_cn":0,"price_ac":0}],"single_price":0.07768},"LM358ST-1932800621":{"goods_sn":"LM358ST-1932800621","goods_name":"LM358ST","brand_name":"STMICROELECTRONICS","desc":"Low-power dual op-amps with low input bias current","docurl":"","url":"","goods_img":"","cat":"","stock":[4000,20000],"increment":1,"price_temp":[[4000,0.09544],[8000,0.09471],[16000,0.09398]],"tiered":[{"purchases":4000,"price_us":0.09544,"price_cn":0,"price_ac":0},{"purchases":8000,"price_us":0.09471,"price_cn":0,"price_ac":0},{"purchases":16000,"price_us":0.09398,"price_cn":0,"price_ac":0}],"single_price":0.09398},"LM358DR-1503747545":{"goods_sn":"LM358DR-1503747545","goods_name":"LM358DR","brand_name":"Texas Instruments Incorporated","desc":"Operational Amplifier, 2 Func, 7000uV Offset-Max, BIPolar, PDSO8","docurl":"","url":"","goods_img":"","cat":"","stock":[1021,5190],"increment":1,"price_temp":[[1021,0.0539]],"tiered":[{"purchases":1021,"price_us":0.0539,"price_cn":0,"price_ac":0}],"single_price":0.0539}}}`
)
return
}
if
goodsName
==
""
{
if
goodsName
==
""
{
common
.
Output
(
ctx
,
1001
,
"查询关键词不得为空"
,
""
)
common
.
Output
(
ctx
,
1001
,
"查询关键词不得为空"
,
""
)
...
...
service/ly/sourceability.go
View file @
c332febd
...
@@ -84,7 +84,7 @@ func OutLinkSource(ctx *gin.Context,goodsName *string) *orderedmap.OrderedMap {
...
@@ -84,7 +84,7 @@ func OutLinkSource(ctx *gin.Context,goodsName *string) *orderedmap.OrderedMap {
//协程并发请求
//协程并发请求
//接收通道所有的值
//接收通道所有的值
A
:=
orderedmap
.
New
()
A
:=
orderedmap
.
New
()
ch
:=
make
(
chan
bool
,
2
)
ch
:=
make
(
chan
bool
,
10
)
p
:=
0
;
p
:=
0
;
for
_
,
a
:=
range
skuRsults
{
for
_
,
a
:=
range
skuRsults
{
goods_sn
:=
a
.
Get
(
"sku"
)
.
String
()
//goods_sn
goods_sn
:=
a
.
Get
(
"sku"
)
.
String
()
//goods_sn
...
...
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