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
b608d6c7
authored
Jul 29, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
d9df57c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
14 deletions
conf/local/config.ini.local
controller/quote_controller.go
service/quote_service.go
test/test.go
conf/local/config.ini.local
View file @
b608d6c7
...
...
@@ -11,6 +11,7 @@ api_md5_str = fh6y5t4rr351d2c3bryi
[goods]
api_url = http://192.168.2.232:60004
sz_api_url = http://192.168.2.232:60004
[es]
url = http://192.168.2.232:9200
...
...
controller/quote_controller.go
View file @
b608d6c7
...
...
@@ -152,5 +152,5 @@ func GetData(keyword, supplierName string) (res interface{}) {
}
func
QuoteTest
(
c
*
gin
.
Context
)
{
c
.
String
(
200
,
"测试"
)
c
.
String
(
200
,
"测试"
)
}
service/quote_service.go
View file @
b608d6c7
...
...
@@ -2,6 +2,7 @@ package service
import
(
"encoding/json"
"fmt"
"github.com/imroc/req"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
...
...
@@ -50,7 +51,9 @@ func (qs *QuoteService) GetGoodsBySupplierName(r requests.GetGoodsBySupplierRequ
if
err
!=
nil
{
return
}
fmt
.
Println
(
esResult
)
goodsIds
:=
GetGoodsIdsByEs
(
esResult
)
fmt
.
Println
(
goodsIds
)
goodsList
,
err
:=
GetGoodsInfo
(
goodsIds
)
dullData
,
err
:=
transformer
.
DullDataInfo
(
r
.
Keyword
,
goodsList
)
quoteTransformer
:=
transformer
.
QuoteTransformer
{}
...
...
test/test.go
View file @
b608d6c7
...
...
@@ -7,7 +7,7 @@ import (
"github.com/syyongx/php2go"
"reflect"
"search_server/boot"
"search_server/
pkg/common
"
"search_server/
service
"
)
func
StrRandom
(
lenNum
int
)
string
{
...
...
@@ -39,18 +39,8 @@ func main() {
if
err
:=
boot
.
Boot
(
path
);
err
!=
nil
{
fmt
.
Println
(
err
)
}
//log.SetFormatter(new(LogFormatter))
////设置output,默认为stderr,可以为任何io.Writer,比如文件*os.File
//str, _ := os.Getwd()
//file, _ := os.OpenFile(str+"/logs/search/1.log", os.O_CREATE|os.O_WRONLY, 0666)
//log.SetOutput(file)
//fmt.Println(str)
//log.Error("sadsadsadsa")
//log.Error("sadsadsadsa")
//log_report.WriteSearchErrorLog("sdasdasdas")
common
.
Output
(
1000
,
"ceshiceshi"
,
nil
)
//log.Error("sadsadsadsa")
//controller.GetData("LM358","arrow")
res
,
_
:=
service
.
GetGoodsInfo
([]
string
{
"74163"
,
"116492"
,
"74123"
,
"106095"
,
"116451"
,
"162774"
,
"74152"
,
"116078"
,
"74122"
,
"74132"
})
fmt
.
Println
(
len
(
res
))
}
...
...
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