Commit ae0e7551 by mushishixian

提代码提出src文件夹

parent c7072989
...@@ -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 {
......
...@@ -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"
) )
......
...@@ -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"
) )
......
...@@ -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/src/service" "jtthink/service"
"log" "log"
) )
......
...@@ -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"
) )
......
[database]
user_name = root
password = root
host = 192.168.2.239
database = test
table_prefix =
type = mysql
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
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
...@@ -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
...@@ -20,4 +21,4 @@ require ( ...@@ -20,4 +21,4 @@ require (
google.golang.org/protobuf v1.24.0 google.golang.org/protobuf v1.24.0
) )
replace google.golang.org/grpc => google.golang.org/grpc v1.26.0 replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
\ No newline at end of file
...@@ -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/src/service" "jtthink/service"
) )
func init() { func init() {
......
...@@ -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/src/service" "jtthink/service"
) )
func init() { func init() {
......
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
}
...@@ -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}
......
...@@ -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 {}
......
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment