Переглянути джерело

update:重新命名gomod并且忽略yaml文件

lvxiaorun 4 роки тому
батько
коміт
62abd58585

+ 2 - 1
.gitignore

@@ -7,4 +7,5 @@
 *.iml
 out
 gen
-shopperthree_manage.yaml
+shopperthree_manage.yaml
+/passport.yaml

+ 4 - 4
app/boot/cmd.go

@@ -9,10 +9,10 @@ import (
 	"github.com/spf13/viper"
 	"go.uber.org/zap"
 
-	"shopperthree_manage_v2/app/router"
-	"shopperthree_manage_v2/client/mysql"
-	"shopperthree_manage_v2/client/sredis"
-	"shopperthree_manage_v2/logger"
+	"passport/app/router"
+	"passport/client/mysql"
+	"passport/client/sredis"
+	"passport/logger"
 )
 
 func Run() {

+ 2 - 2
app/boot/db.go

@@ -1,8 +1,8 @@
 package boot
 
 import (
-	"shopperthree_manage_v2/app/models"
-	"shopperthree_manage_v2/client/mysql"
+	"passport/app/models"
+	"passport/client/mysql"
 )
 
 func InitModel() error {

+ 4 - 4
app/business/login.go

@@ -6,10 +6,10 @@ import (
 	"github.com/jinzhu/gorm"
 	"github.com/spf13/viper"
 
-	"shopperthree_manage_v2/app/models"
-	"shopperthree_manage_v2/pkg/ierr"
-	"shopperthree_manage_v2/pkg/jwt"
-	"shopperthree_manage_v2/pkg/util"
+	"passport/app/models"
+	"passport/pkg/ierr"
+	"passport/pkg/jwt"
+	"passport/pkg/util"
 )
 
 func Login(req *models.LoginRequest) (*models.LoginReply, error) {

+ 4 - 4
app/handlers/file.go

@@ -5,11 +5,11 @@ import (
 	"github.com/gin-gonic/gin"
 	"github.com/spf13/viper"
 	"go.uber.org/zap"
+	"passport/app/models"
+	"passport/logger"
+	"passport/pkg/ierr"
+	"passport/pkg/util"
 	"path/filepath"
-	"shopperthree_manage_v2/app/models"
-	"shopperthree_manage_v2/logger"
-	"shopperthree_manage_v2/pkg/ierr"
-	"shopperthree_manage_v2/pkg/util"
 )
 
 /**

+ 4 - 4
app/handlers/login.go

@@ -2,10 +2,10 @@ package handlers
 
 import (
 	"github.com/gin-gonic/gin"
-	"shopperthree_manage_v2/app/business"
-	"shopperthree_manage_v2/app/models"
-	"shopperthree_manage_v2/logger"
-	"shopperthree_manage_v2/pkg/ierr"
+	"passport/app/business"
+	"passport/app/models"
+	"passport/logger"
+	"passport/pkg/ierr"
 )
 
 /**

+ 3 - 3
app/handlers/middleware.go

@@ -3,9 +3,9 @@ package handlers
 import (
 	"github.com/spf13/viper"
 	"net/http"
-	"shopperthree_manage_v2/app/models"
-	"shopperthree_manage_v2/pkg/ierr"
-	"shopperthree_manage_v2/pkg/jwt"
+	"passport/app/models"
+	"passport/pkg/ierr"
+	"passport/pkg/jwt"
 	"time"
 
 	"github.com/gin-gonic/gin"

+ 1 - 1
app/models/common.go

@@ -3,7 +3,7 @@ package models
 import (
 	"time"
 
-	"shopperthree_manage_v2/client/mysql"
+	"passport/client/mysql"
 )
 
 // 删除标志

+ 1 - 1
app/models/table_admin.go

@@ -1,6 +1,6 @@
 package models
 
-import "shopperthree_manage_v2/client/mysql"
+import "passport/client/mysql"
 
 type TAdmin struct {
 	UserId   string `gorm:"column:user_id;type:varchar(20)"`

+ 2 - 2
app/models/table_file.go

@@ -1,8 +1,8 @@
 package models
 
 import (
-	"shopperthree_manage_v2/client/mysql"
-	"shopperthree_manage_v2/pkg/ierr"
+	"passport/client/mysql"
+	"passport/pkg/ierr"
 )
 
 type File struct {

+ 1 - 1
app/router/router.go

@@ -3,7 +3,7 @@ package router
 import (
 	"github.com/gin-gonic/gin"
 	"net/http"
-	"shopperthree_manage_v2/app/handlers"
+	"passport/app/handlers"
 )
 
 func StepRouters(r *gin.Engine) {

+ 2 - 2
config/config.go

@@ -7,11 +7,11 @@ import (
 )
 
 func init() {
-	viper.SetConfigName("shopperthree_manage")
+	viper.SetConfigName("passport")
 	viper.SetConfigType("yaml")
 	viper.AddConfigPath(".")
 	viper.AddConfigPath("..")
-	viper.AddConfigPath("/etc/shopperthree_manage")
+	viper.AddConfigPath("/etc/passport")
 	if err := viper.ReadInConfig(); err != nil {
 		panic(err)
 	}

+ 1 - 1
go.mod

@@ -1,4 +1,4 @@
-module shopperthree_manage_v2
+module passport
 
 go 1.13
 

+ 2 - 2
main.go

@@ -1,9 +1,9 @@
 package main
 
 import (
-	_ "shopperthree_manage_v2/config"
+	_ "passport/config"
 
-	"shopperthree_manage_v2/app/boot"
+	"passport/app/boot"
 )
 
 func main() {

+ 1 - 1
passport.yaml

@@ -1,6 +1,6 @@
 server:
   host: 127.0.0.1
-  port: 7696
+  port: 10001
 
 mysql:
   address: shopperthree:U4r6u*j0deCqHN3y@tcp(wzkj.pc:3306)/shopperthree?charset=utf8&parseTime=True&loc=Local