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
ae0e7551
authored
Jun 04, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提代码提出src文件夹
parent
c7072989
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
53 additions
and
24 deletions
Mapper/CourseMapper.go
cmd/course_http_server.go
cmd/course_http_server.go.bak
cmd/course_server.go
cmd/user_server.go
conf/config.ini
course.bat
coursehttp.bat
go.mod
lib/CourseLib.go
lib/CourseTopicLib.go
pkg/config/config.go
service/CourseService.go
service/CourseTopicService.go
user.bat
Mapper/CourseMapper.go
View file @
ae0e7551
...
@@ -2,8 +2,8 @@ package Mapper
...
@@ -2,8 +2,8 @@ package Mapper
import
(
import
(
"github.com/jinzhu/gorm"
"github.com/jinzhu/gorm"
"jtthink/
src/
Boot"
"jtthink/Boot"
"jtthink/
src/
Vars"
"jtthink/Vars"
)
)
func
GetCourseList
()
*
gorm
.
DB
{
func
GetCourseList
()
*
gorm
.
DB
{
...
...
cmd/course_http_server.go
View file @
ae0e7551
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/micro/go-micro/v2/web"
"github.com/micro/go-micro/v2/web"
"jtthink/framework/gin_"
"jtthink/framework/gin_"
_
"jtthink/
src/
lib"
_
"jtthink/lib"
"log"
"log"
)
)
...
...
cmd/course_http_server.go.bak
View file @
ae0e7551
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"context"
"context"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/micro/go-micro/v2/web"
"github.com/micro/go-micro/v2/web"
"jtthink/
src/
Course"
"jtthink/Course"
"log"
"log"
"net/http"
"net/http"
)
)
...
...
cmd/course_server.go
View file @
ae0e7551
...
@@ -2,8 +2,8 @@ package main
...
@@ -2,8 +2,8 @@ package main
import
(
import
(
"github.com/micro/go-micro/v2"
"github.com/micro/go-micro/v2"
"jtthink/
src/
Course"
"jtthink/Course"
"jtthink/s
rc/s
ervice"
"jtthink/service"
"log"
"log"
)
)
...
...
cmd/user_server.go
View file @
ae0e7551
...
@@ -3,10 +3,10 @@ package main
...
@@ -3,10 +3,10 @@ package main
import
(
import
(
"context"
"context"
"github.com/micro/go-micro/v2/client"
"github.com/micro/go-micro/v2/client"
"jtthink/
src/
Course"
"jtthink/Course"
"github.com/micro/go-micro/v2"
"github.com/micro/go-micro/v2"
"jtthink/
src/
Users"
"jtthink/Users"
"log"
"log"
)
)
...
...
conf/config.ini
0 → 100644
View file @
ae0e7551
[database]
user_name
=
root
password
=
root
host
=
192.168.2.239
database
=
test
table_prefix
=
type
=
mysql
course.bat
View file @
ae0e7551
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=localhost:2379
set MICRO_REGISTRY_ADDRESS=localhost:2379
go run src/cmd/course_server.go --server_address :9091
go run cmd/course_server.go --server_address :9091
\ No newline at end of file
\ No newline at end of file
coursehttp.bat
View file @
ae0e7551
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
go run src/cmd/course_http_server.go --server_address :9000
go run cmd/course_http_server.go --server_address :9000
\ No newline at end of file
\ No newline at end of file
go.mod
View file @
ae0e7551
...
@@ -5,14 +5,15 @@ go 1.14
...
@@ -5,14 +5,15 @@ go 1.14
require (
require (
github.com/favadi/protoc-go-inject-tag v1.0.0 // indirect
github.com/favadi/protoc-go-inject-tag v1.0.0 // indirect
github.com/gin-gonic/gin v1.6.3
github.com/gin-gonic/gin v1.6.3
github.com/go-ini/ini v1.44.0
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.4.2
github.com/jinzhu/gorm v1.9.12
github.com/jinzhu/gorm v1.9.12
github.com/micro/go-micro v1.18.0
github.com/micro/go-micro v1.18.0
// indirect
github.com/micro/go-micro/v2 v2.5.0
github.com/micro/go-micro/v2 v2.5.0
github.com/micro/micro v1.18.0 // indirect
github.com/micro/micro v1.18.0 // indirect
github.com/micro/micro/v2 v2.5.0 // indirect
github.com/micro/micro/v2 v2.5.0 // indirect
github.com/micro/protoc-gen-micro/v2 v2.0.0 // indirect
github.com/micro/protoc-gen-micro/v2 v2.0.0 // indirect
github.com/shopspring/decimal v1.2.0
github.com/shopspring/decimal v1.2.0
// indirect
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect
...
...
lib/CourseLib.go
View file @
ae0e7551
...
@@ -3,8 +3,8 @@ package lib
...
@@ -3,8 +3,8 @@ package lib
import
(
import
(
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"jtthink/framework/gin_"
"jtthink/
src/
Course"
"jtthink/Course"
"jtthink/s
rc/s
ervice"
"jtthink/service"
)
)
func
init
()
{
func
init
()
{
...
...
lib/CourseTopicLib.go
View file @
ae0e7551
...
@@ -3,8 +3,8 @@ package lib
...
@@ -3,8 +3,8 @@ package lib
import
(
import
(
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"jtthink/framework/gin_"
"jtthink/
src/
Course"
"jtthink/Course"
"jtthink/s
rc/s
ervice"
"jtthink/service"
)
)
func
init
()
{
func
init
()
{
...
...
pkg/config/config.go
View file @
ae0e7551
package
config
package
config
import
(
"fmt"
"github.com/go-ini/ini"
)
var
(
cfg
*
ini
.
File
)
func
SetUp
(
filePath
string
)
{
var
err
error
cfg
,
err
=
ini
.
Load
(
filePath
)
if
err
!=
nil
{
panic
(
fmt
.
Sprintf
(
"解析配置文件失败: %v"
,
err
))
}
}
func
GetConfig
()
*
ini
.
File
{
return
cfg
}
service/CourseService.go
View file @
ae0e7551
...
@@ -2,8 +2,8 @@ package service
...
@@ -2,8 +2,8 @@ package service
import
(
import
(
"context"
"context"
.
"jtthink/
src/
Course"
.
"jtthink/Course"
"jtthink/
src/
Mapper"
"jtthink/Mapper"
)
)
func
NewCourseModel
(
id
int32
,
name
string
)
*
CourseModel
{
func
NewCourseModel
(
id
int32
,
name
string
)
*
CourseModel
{
return
&
CourseModel
{
CourseId
:
id
,
CourseName
:
name
}
return
&
CourseModel
{
CourseId
:
id
,
CourseName
:
name
}
...
...
service/CourseTopicService.go
View file @
ae0e7551
...
@@ -2,8 +2,8 @@ package service
...
@@ -2,8 +2,8 @@ package service
import
(
import
(
"context"
"context"
"jtthink/
src/
Boot"
"jtthink/Boot"
.
"jtthink/
src/
Course"
.
"jtthink/Course"
)
)
type
CourseTopicServiceImpl
struct
{}
type
CourseTopicServiceImpl
struct
{}
...
...
user.bat
View file @
ae0e7551
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=localhost:2379
set MICRO_REGISTRY_ADDRESS=localhost:2379
go run src/cmd/user_server.go --server_address :9090
go run cmd/user_server.go --server_address :9090
\ No newline at end of file
\ No newline at end of file
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