Commit ae0e7551 by mushishixian

提代码提出src文件夹

parent c7072989
......@@ -2,8 +2,8 @@ package Mapper
import (
"github.com/jinzhu/gorm"
"jtthink/src/Boot"
"jtthink/src/Vars"
"jtthink/Boot"
"jtthink/Vars"
)
func GetCourseList() *gorm.DB {
......
......@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/micro/go-micro/v2/web"
"jtthink/framework/gin_"
_ "jtthink/src/lib"
_ "jtthink/lib"
"log"
)
......
......@@ -4,7 +4,7 @@ import (
"context"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/micro/go-micro/v2/web"
"jtthink/src/Course"
"jtthink/Course"
"log"
"net/http"
)
......
......@@ -2,8 +2,8 @@ package main
import (
"github.com/micro/go-micro/v2"
"jtthink/src/Course"
"jtthink/src/service"
"jtthink/Course"
"jtthink/service"
"log"
)
......
......@@ -3,10 +3,10 @@ package main
import (
"context"
"github.com/micro/go-micro/v2/client"
"jtthink/src/Course"
"jtthink/Course"
"github.com/micro/go-micro/v2"
"jtthink/src/Users"
"jtthink/Users"
"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_ADDRESS=localhost:2379
go run src/cmd/course_server.go --server_address :9091
\ No newline at end of file
go run cmd/course_server.go --server_address :9091
\ No newline at end of file
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
go run src/cmd/course_http_server.go --server_address :9000
\ No newline at end of file
go run cmd/course_http_server.go --server_address :9000
\ No newline at end of file
......@@ -5,14 +5,15 @@ go 1.14
require (
github.com/favadi/protoc-go-inject-tag v1.0.0 // indirect
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/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/micro v1.18.0 // indirect
github.com/micro/micro/v2 v2.5.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/sys v0.0.0-20200523222454-059865788121 // indirect
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect
......
......@@ -3,8 +3,8 @@ package lib
import (
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"jtthink/src/Course"
"jtthink/src/service"
"jtthink/Course"
"jtthink/service"
)
func init() {
......
......@@ -3,8 +3,8 @@ package lib
import (
"github.com/gin-gonic/gin"
"jtthink/framework/gin_"
"jtthink/src/Course"
"jtthink/src/service"
"jtthink/Course"
"jtthink/service"
)
func init() {
......
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
import (
"context"
. "jtthink/src/Course"
"jtthink/src/Mapper"
. "jtthink/Course"
"jtthink/Mapper"
)
func NewCourseModel(id int32,name string) *CourseModel {
return &CourseModel{CourseId:id,CourseName:name}
......
......@@ -2,8 +2,8 @@ package service
import (
"context"
"jtthink/src/Boot"
. "jtthink/src/Course"
"jtthink/Boot"
. "jtthink/Course"
)
type CourseTopicServiceImpl struct {}
......
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=localhost:2379
go run src/cmd/user_server.go --server_address :9090
\ No newline at end of file
go run cmd/user_server.go --server_address :9090
\ 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