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
15cfd232
authored
Dec 04, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
c94f6e6b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
controller/parity_controller.go
service/optimum_service.go
controller/parity_controller.go
View file @
15cfd232
...
...
@@ -2,10 +2,7 @@ package controller
import
(
"github.com/gin-gonic/gin"
"search_server/model"
"search_server/pkg/common"
"search_server/service"
"search_server/service/ly"
)
/*
...
...
@@ -17,9 +14,9 @@ import (
func
GetParityData
(
ctx
*
gin
.
Context
)
{
common
.
PrintDebugHeader
(
ctx
)
//debug
//调外链拿数据
optimumservice
:=
service
.
OptimumService
{}
apiData
:=
optimumservice
.
GetOptimumAttr
(
ctx
)
common
.
PrintDebugHtml
(
ctx
,
"-----执行结束----"
)
//debug
common
.
Output
(
ctx
,
errCode
,
"查询成功"
,
""
)
//
optimumservice := service.OptimumService{}
//
apiData := optimumservice.GetOptimumAttr(ctx)
//
//
common.PrintDebugHtml(ctx,"-----执行结束----") //debug
//
common.Output(ctx,errCode, "查询成功", "")
}
service/optimum_service.go
View file @
15cfd232
...
...
@@ -228,6 +228,7 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
GoodsUrl
:=
""
BrandUrl
:=
""
Multiple
:=
0
referer
:=
ctx
.
GetHeader
(
"Referer"
)
if
referer
!=
""
{
dome
:=
strings
.
Split
(
referer
,
".com"
)
...
...
@@ -238,6 +239,11 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
}
else
{
GoodsUrl
=
dome
[
0
]
+
".com/goods_"
+
v
.
GoodsId
+
".html"
BrandUrl
=
dome
[
0
]
+
".com/v3/brand/list/"
+
strconv
.
Itoa
(
v
.
BrandId
)
+
".html"
//联营倍数
Multiple
=
v
.
Mpq
if
v
.
Mpq
>
v
.
Moq
{
Multiple
=
v
.
Moq
}
}
}
}
...
...
@@ -247,6 +253,7 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
GoodsUrl
:
GoodsUrl
,
BrandUrl
:
BrandUrl
,
Attrs
:
attrs
[
v
.
GoodsId
],
MultipleStr
:
Multiple
,
})
}
...
...
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