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
5a1aa156
authored
Jun 28, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
fbd773ab
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
9 deletions
bat/course.bat
boot/app.go
cmd/course_http_server.go
controller/course_controller.go
doc/bom_service.md
go.mod
readme.md
bat/course.bat
View file @
5a1aa156
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=localhost:2379
go run cmd/course_server.go --server_address :9091
\ No newline at end of file
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
go run ../cmd/course_server.go --server_address :9092
\ No newline at end of file
boot/app.go
View file @
5a1aa156
...
...
@@ -4,15 +4,16 @@ import (
"search_server/pkg/config"
"search_server/pkg/gredis"
"search_server/pkg/logger"
"search_server/pkg/mysql"
)
func
Boot
(
configPath
string
)
(
err
error
)
{
if
err
=
config
.
SetUp
(
configPath
);
err
!=
nil
{
panic
(
err
)
}
//
if err = mysql.Setup(); err != nil {
//
return
//
}
if
err
=
mysql
.
Setup
();
err
!=
nil
{
return
}
if
err
=
gredis
.
Setup
();
err
!=
nil
{
return
}
...
...
cmd/course_http_server.go
View file @
5a1aa156
...
...
@@ -12,8 +12,9 @@ import (
)
func
main
()
{
var
path
string
flag
.
StringVar
(
&
path
,
"config"
,
"
../
conf/config.ini"
,
"配置文件"
)
flag
.
StringVar
(
&
path
,
"config"
,
"conf/config.ini"
,
"配置文件"
)
flag
.
Parse
()
if
err
:=
boot
.
Boot
(
path
);
err
!=
nil
{
log
.
Println
(
err
)
...
...
controller/course_controller.go
View file @
5a1aa156
...
...
@@ -7,7 +7,7 @@ import (
"search_server/service"
)
func
I
nit
()
{
func
i
nit
()
{
courseService
:=
service
.
NewCourseServiceImpl
()
gin_
.
NewBuilder
()
.
WithService
(
courseService
)
.
WithMiddleware
(
Check_Middleware
())
.
...
...
doc/bom_service.md
View file @
5a1aa156
##bom_service 实现了bom的搜索
##bom_service 实现了bom的搜索
,接口如下
go.mod
View file @
5a1aa156
...
...
@@ -19,6 +19,7 @@ require (
github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1 // indirect
github.com/mholt/certmagic v0.9.3 // indirect
github.com/micro/go-micro/v2 v2.9.0
github.com/micro/micro/v2 v2.9.1 // indirect
github.com/prometheus/client_golang v1.5.1 // indirect
github.com/prometheus/common v0.9.1
github.com/prometheus/procfs v0.0.11 // indirect
...
...
readme.md
View file @
5a1aa156
...
...
@@ -18,6 +18,7 @@
├── protos //原始的protos文件
├── service //业务逻辑操作所在目录
### 已经封装的模块以及用法
#### 1.配置读取
...
...
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