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
619a1f25
authored
Jun 30, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
06b9719d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
2 deletions
.gitignore
cmd/logs/2020-06-30.log → bat/logs/2020-06-30.log
cmd/logs/2020-06-30.log.wf → bat/logs/2020-06-30.log.wf
bat/searchHttp.bat
cmd/cmd.exe~
cmd/course_http_server.go
.gitignore
View file @
619a1f25
...
...
@@ -5,4 +5,6 @@ gowatch.yml
*.exe
*.exe~
cmd.exe~
/cmd/logs/
\ No newline at end of file
/cmd/logs/
/cmd/*.exe~
/cmd/logs
cmd
/logs/2020-06-30.log
→
bat
/logs/2020-06-30.log
View file @
619a1f25
File moved
cmd
/logs/2020-06-30.log.wf
→
bat
/logs/2020-06-30.log.wf
View file @
619a1f25
File moved
bat/searchHttp.bat
0 → 100644
View file @
619a1f25
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
go run ../cmd/search_http_server.go -config=../conf/config.ini
\ No newline at end of file
cmd/cmd.exe~
deleted
100644 → 0
View file @
06b9719d
The file could not be displayed because it is too large.
cmd/course_http_server.go
View file @
619a1f25
...
...
@@ -3,6 +3,7 @@ package main
import
(
"flag"
"github.com/gin-gonic/gin"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/micro/go-micro/v2/web"
"log"
"search_server/boot"
...
...
@@ -23,6 +24,21 @@ func main() {
r
:=
gin
.
New
()
gin_
.
BootStrap
(
r
)
c
:=
grpc
.
NewClient
()
r
:=
gin
.
New
()
r
.
Handle
(
"GET"
,
"/test"
,
func
(
ctx
*
gin
.
Context
)
{
news
c
:=
Course
.
NewCourseService
(
"api.jtthink.com.course"
,
c
)
course_rsp
,
_
:=
c
.
ListForTop
(
context
.
Background
(),
&
Course
.
ListRequest
{
Size
:
10
})
ctx
.
JSON
(
200
,
gin
.
H
{
"Result"
:
course_rsp
.
Result
})
})
service
:=
web
.
NewService
(
web
.
Name
(
"api.jtthink.com.http.course"
),
web
.
Handler
(
r
),
)
port
:=
config
.
Get
(
"web.port"
)
.
String
()
//web改成micro 就是grpc,并直接注册到etcd里面
service
:=
web
.
NewService
(
...
...
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