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
0773d030
authored
Jun 17, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复
parent
87928310
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
46 deletions
cmd/search_server.go
test/test.go
cmd/search_server.go
0 → 100644
View file @
0773d030
package
main
import
(
"github.com/micro/go-micro/v2"
"search_server/protopb/bom"
"search_server/service"
"log"
)
func
main
()
{
cService
:=
micro
.
NewService
(
micro
.
Name
(
"go.micro.server.search"
))
cService
.
Init
()
err
:=
bom
.
RegisterBomServiceHandler
(
cService
.
Server
(),
service
.
NewBomServiceImpl
())
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
if
err
=
cService
.
Run
();
err
!=
nil
{
log
.
Println
(
err
)
}
}
\ No newline at end of file
test/test.go
View file @
0773d030
package
main
import
(
"flag"
"github.com/go-kratos/kratos/pkg/log"
"search_server/boot"
"search_server/service"
)
func
main
()
{
var
path
string
flag
.
StringVar
(
&
path
,
"config"
,
"conf/config.ini"
,
"配置文件"
)
flag
.
Parse
()
if
err
:=
boot
.
Boot
(
path
);
err
!=
nil
{
log
.
Error
(
"%s"
,
err
)
}
service
.
AutoSpu
(
"a"
)
//logger.Warn("test")
//logger.Warn("warn555555555555555555555555555555")
//logger.Info("info记录日志555555555555555555555555555555")
//logger.Error("Error记录日志555555555555555555555555555555")
//logger.Fatal("Fatal记录日志555555555555555555555555555555")
//var path string
//flag.StringVar(&path, "config", "conf/config.ini", "配置文件")
//flag.Parse()
//if err := boot.Boot(path); err != nil {
// log.Error("%s", err)
//}
//client := client.
//c := course.NewCourseService("go.micro.api.jtthink.course", client)
//course_rsp, _ := c.ListForTop(context.TODO(), &course.ListRequest{Size: 10})
//fmt.Println(course_rsp.Result)
// fmt.Println(es.CurlES(config.Get("es.index_name").String(), `{
// "query": {
// "bool": {
// "filter": [
// {
// "term": {
// "goods_id": "1154020374326836400"
// }
// }
// ]
// }
// },
// "sort": [
// {
// "single_price": {
// "order": "asc"
// }
// },
// {
// "_score": {
// "order": "desc"
// }
// }
// ],
// "from": 0,
// "size": 10
//}`))
}
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