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
18fabaf1
authored
Jul 02, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
204e81fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
service/goods_service.go
service/goods_service.go
View file @
18fabaf1
package
service
import
(
"fmt"
"github.com/imroc/req"
"github.com/tidwall/gjson"
"github.com/uniplaces/carbon"
"gopkg.in/olivere/elastic.v5"
"regexp"
"search_server/pkg/config"
"search_server/pkg/es"
"search_server/protopb/bom"
"search_server/requests"
"strings"
...
...
@@ -73,22 +71,23 @@ func GetGoodsInfo(goodsIdsStr string) (goodsList []*bom.GoodsModel, err error) {
}
//根据供应商获取商品信息
func
GetGoodsInfoBySupplier
(
req
requests
.
QuoteIndexRequest
)
error
{
supplierIndex
:=
config
.
Get
(
"es.search_supplier"
)
.
String
()
//获取查询条件
queryString
:=
getSupplierQuery
(
req
)
res
,
err
:=
es
.
CurlES
(
supplierIndex
,
queryString
)
if
err
!=
nil
{
return
err
}
fmt
.
Println
(
supplierIndex
)
func
GetGoodsInfoBySupplier
(
req
requests
.
QuoteIndexRequest
)
error
{
//supplierIndex := config.Get("es.search_supplier").String()
////获取查询条件
//queryString := getSupplierQuery(req)
//res, err := es.CurlES(supplierIndex, queryString)
//if err != nil {
// return err
//}
//fmt.Println(supplierIndex)
return
nil
}
func
getSupplierIndex
(
supplierId
string
)
string
{
return
"temp"
}
func
getSupplierQuery
(
req
requests
.
QuoteIndexRequest
)
string
{
func
getSupplierQuery
(
req
requests
.
QuoteIndexRequest
)
(
string
,
error
)
{
req
.
SupplierId
=
strings
.
TrimSpace
(
req
.
SupplierId
)
source
:=
elastic
.
NewSearchSource
()
query
:=
elastic
.
NewBoolQuery
()
...
...
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