From b7d960421828c2d9998cce9c7deedc09158b7a46 Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 17 Aug 2022 23:02:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E6=94=B9go.mod=20module=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- app/controller/backend/attachment.go | 8 ++++---- app/controller/backend/auth.go | 8 ++++---- app/controller/backend/user.go | 8 ++++---- app/controller/base/base.go | 4 ++-- app/controller/common/common.go | 8 ++++---- app/controller/common/token.go | 8 ++++---- app/controller/frontend/user.go | 2 +- app/service/backend/user.go | 8 ++++---- app/service/common/user.go | 6 +++--- bootstrap/boot.go | 8 ++++---- cmd/admin.go | 10 +++++----- cmd/controller.go | 6 +++--- cmd/migrate.go | 6 +++--- cmd/model.go | 6 +++--- cmd/service.go | 6 +++--- cmd/test/consumer.go | 10 +++++----- cmd/test/producer.go | 12 ++++++------ global/app/context.go | 6 +++--- global/vars.go | 4 ++-- go.mod | 2 +- main.go | 10 +++++----- middleware/casbin_auth.go | 8 ++++---- middleware/ip_auth.go | 2 +- middleware/login_auth.go | 6 +++--- middleware/requestid_auth.go | 2 +- models/model.go | 2 +- pkg/paginator/pagination.go | 4 ++-- pkg/util/upload.go | 2 +- router/register.go | 10 +++++----- router/routes/backend.go | 2 +- router/routes/common.go | 4 ++-- router/routes/frontend.go | 2 +- types/admin/admin.go | 2 +- types/user/user.go | 2 +- 35 files changed, 99 insertions(+), 99 deletions(-) diff --git a/README.md b/README.md index 6bde367..63c4e44 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ make linux 引用包 ```go -import "github.com/MQEnergy/go-framework/pkg/paginator" +import "github.com/MQEnergy/gin-framework/pkg/paginator" ``` ### 一、基础用法 @@ -564,7 +564,7 @@ go run main.go account -help ### 初始化go.mod ```bash -go mod init github.com/MQEnergy/go-framework/gin-framework +go mod init github.com/MQEnergy/gin-framework go mod tidy ``` diff --git a/app/controller/backend/attachment.go b/app/controller/backend/attachment.go index a1ca082..535517c 100644 --- a/app/controller/backend/attachment.go +++ b/app/controller/backend/attachment.go @@ -1,10 +1,10 @@ package backend import ( - "github.com/MQEnergy/go-framework/app/controller/base" - "github.com/MQEnergy/go-framework/pkg/response" - "github.com/MQEnergy/go-framework/pkg/util" - "github.com/MQEnergy/go-framework/types/attachment" + "github.com/MQEnergy/gin-framework/app/controller/base" + "github.com/MQEnergy/gin-framework/pkg/response" + "github.com/MQEnergy/gin-framework/pkg/util" + "github.com/MQEnergy/gin-framework/types/attachment" "github.com/gin-gonic/gin" "net/http" ) diff --git a/app/controller/backend/auth.go b/app/controller/backend/auth.go index 6edffee..d2a66cb 100644 --- a/app/controller/backend/auth.go +++ b/app/controller/backend/auth.go @@ -1,10 +1,10 @@ package backend import ( - "github.com/MQEnergy/go-framework/app/controller/base" - "github.com/MQEnergy/go-framework/app/service/common" - "github.com/MQEnergy/go-framework/pkg/response" - "github.com/MQEnergy/go-framework/types/user" + "github.com/MQEnergy/gin-framework/app/controller/base" + "github.com/MQEnergy/gin-framework/app/service/common" + "github.com/MQEnergy/gin-framework/pkg/response" + "github.com/MQEnergy/gin-framework/types/user" "github.com/gin-gonic/gin" "net/http" ) diff --git a/app/controller/backend/user.go b/app/controller/backend/user.go index 0fcd8dc..6410155 100644 --- a/app/controller/backend/user.go +++ b/app/controller/backend/user.go @@ -1,10 +1,10 @@ package backend import ( - "github.com/MQEnergy/go-framework/app/controller/base" - "github.com/MQEnergy/go-framework/app/service/backend" - "github.com/MQEnergy/go-framework/pkg/response" - "github.com/MQEnergy/go-framework/types/user" + "github.com/MQEnergy/gin-framework/app/controller/base" + "github.com/MQEnergy/gin-framework/app/service/backend" + "github.com/MQEnergy/gin-framework/pkg/response" + "github.com/MQEnergy/gin-framework/types/user" "github.com/gin-gonic/gin" "net/http" ) diff --git a/app/controller/base/base.go b/app/controller/base/base.go index a120c99..1c20aea 100644 --- a/app/controller/base/base.go +++ b/app/controller/base/base.go @@ -2,8 +2,8 @@ package base import ( "errors" - "github.com/MQEnergy/go-framework/pkg/response" - "github.com/MQEnergy/go-framework/pkg/validator" + "github.com/MQEnergy/gin-framework/pkg/response" + "github.com/MQEnergy/gin-framework/pkg/validator" "github.com/gin-gonic/gin" "net/http" ) diff --git a/app/controller/common/common.go b/app/controller/common/common.go index 31c1554..d3d9abe 100644 --- a/app/controller/common/common.go +++ b/app/controller/common/common.go @@ -1,10 +1,10 @@ package common import ( - "github.com/MQEnergy/go-framework/app/controller/base" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/models" - "github.com/MQEnergy/go-framework/pkg/response" + "github.com/MQEnergy/gin-framework/app/controller/base" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/models" + "github.com/MQEnergy/gin-framework/pkg/response" "github.com/gin-gonic/gin" "github.com/jinzhu/copier" "github.com/samber/lo" diff --git a/app/controller/common/token.go b/app/controller/common/token.go index 7ead5ca..38f81e5 100644 --- a/app/controller/common/token.go +++ b/app/controller/common/token.go @@ -1,10 +1,10 @@ package common import ( - "github.com/MQEnergy/go-framework/app/controller/base" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/auth" - "github.com/MQEnergy/go-framework/pkg/response" + "github.com/MQEnergy/gin-framework/app/controller/base" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/auth" + "github.com/MQEnergy/gin-framework/pkg/response" "github.com/gin-gonic/gin" "net/http" "strings" diff --git a/app/controller/frontend/user.go b/app/controller/frontend/user.go index 53eb7cf..3daa22c 100644 --- a/app/controller/frontend/user.go +++ b/app/controller/frontend/user.go @@ -1,7 +1,7 @@ package frontend import ( - "github.com/MQEnergy/go-framework/app/controller/base" + "github.com/MQEnergy/gin-framework/app/controller/base" ) type UserController struct { diff --git a/app/service/backend/user.go b/app/service/backend/user.go index 9efc6ef..69a0ac1 100644 --- a/app/service/backend/user.go +++ b/app/service/backend/user.go @@ -2,10 +2,10 @@ package backend import ( "fmt" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/models" - "github.com/MQEnergy/go-framework/pkg/paginator" - "github.com/MQEnergy/go-framework/types/user" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/models" + "github.com/MQEnergy/gin-framework/pkg/paginator" + "github.com/MQEnergy/gin-framework/types/user" gorabbitmq "github.com/MQEnergy/go-rabbitmq" "github.com/gogf/gf/v2/util/gconv" "sync" diff --git a/app/service/common/user.go b/app/service/common/user.go index 1196d27..dd81b8c 100644 --- a/app/service/common/user.go +++ b/app/service/common/user.go @@ -2,9 +2,9 @@ package common import ( "errors" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/auth" - "github.com/MQEnergy/go-framework/types/user" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/auth" + "github.com/MQEnergy/gin-framework/types/user" ) type UserService struct{} diff --git a/bootstrap/boot.go b/bootstrap/boot.go index b557ef4..3519dbe 100644 --- a/bootstrap/boot.go +++ b/bootstrap/boot.go @@ -2,10 +2,10 @@ package bootstrap import ( "fmt" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/lib" - "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/lib" + "github.com/MQEnergy/gin-framework/pkg/util" "github.com/sirupsen/logrus" ) diff --git a/cmd/admin.go b/cmd/admin.go index 24e08f5..dbdd061 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -2,11 +2,11 @@ package cmd import ( "fmt" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/models" - "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/models" + "github.com/MQEnergy/gin-framework/pkg/util" "github.com/urfave/cli/v2" "time" ) diff --git a/cmd/controller.go b/cmd/controller.go index 8df36b3..8c2903b 100644 --- a/cmd/controller.go +++ b/cmd/controller.go @@ -2,9 +2,9 @@ package cmd import ( "fmt" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/pkg/util" "github.com/urfave/cli/v2" "io/ioutil" "strings" diff --git a/cmd/migrate.go b/cmd/migrate.go index 0227e8d..44f86e6 100644 --- a/cmd/migrate.go +++ b/cmd/migrate.go @@ -3,9 +3,9 @@ package cmd import ( "database/sql" "fmt" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" "github.com/go-sql-driver/mysql" "github.com/golang-migrate/migrate/v4" dmysql "github.com/golang-migrate/migrate/v4/database/mysql" diff --git a/cmd/model.go b/cmd/model.go index c743ba6..7b8e67e 100644 --- a/cmd/model.go +++ b/cmd/model.go @@ -2,9 +2,9 @@ package cmd import ( "fmt" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" gomodel "github.com/MQEnergy/gorm-model" "github.com/urfave/cli/v2" ) diff --git a/cmd/service.go b/cmd/service.go index 1f886a8..d82ab6d 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -2,9 +2,9 @@ package cmd import ( "fmt" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/pkg/util" "github.com/urfave/cli/v2" "io/ioutil" "strings" diff --git a/cmd/test/consumer.go b/cmd/test/consumer.go index 685f191..a2b7b57 100644 --- a/cmd/test/consumer.go +++ b/cmd/test/consumer.go @@ -1,11 +1,11 @@ package main import ( - "github.com/MQEnergy/go-framework/app/amqp/consumer" - "github.com/MQEnergy/go-framework/app/service/backend" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" + "github.com/MQEnergy/gin-framework/app/amqp/consumer" + "github.com/MQEnergy/gin-framework/app/service/backend" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" gorabbitmq "github.com/MQEnergy/go-rabbitmq" "time" ) diff --git a/cmd/test/producer.go b/cmd/test/producer.go index 519d69e..73440d5 100644 --- a/cmd/test/producer.go +++ b/cmd/test/producer.go @@ -2,12 +2,12 @@ package main import ( "fmt" - "github.com/MQEnergy/go-framework/app/amqp/producer" - "github.com/MQEnergy/go-framework/app/service/backend" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/app/amqp/producer" + "github.com/MQEnergy/gin-framework/app/service/backend" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/util" gorabbitmq "github.com/MQEnergy/go-rabbitmq" "time" ) diff --git a/global/app/context.go b/global/app/context.go index d5fe6c5..a3b152b 100644 --- a/global/app/context.go +++ b/global/app/context.go @@ -4,9 +4,9 @@ import ( "context" "encoding/json" "errors" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/auth" - "github.com/MQEnergy/go-framework/types/admin" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/auth" + "github.com/MQEnergy/gin-framework/types/admin" "github.com/gin-gonic/gin" "strconv" ) diff --git a/global/vars.go b/global/vars.go index 51e33d1..113c780 100644 --- a/global/vars.go +++ b/global/vars.go @@ -1,8 +1,8 @@ package global import ( - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/pkg/lib" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/pkg/lib" "github.com/gin-gonic/gin" "github.com/go-redis/redis/v8" "gorm.io/gorm" diff --git a/go.mod b/go.mod index 9f46e24..c2aceaf 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/MQEnergy/go-framework +module github.com/MQEnergy/gin-framework go 1.18 diff --git a/main.go b/main.go index dd5f937..267840c 100644 --- a/main.go +++ b/main.go @@ -2,11 +2,11 @@ package main import ( "fmt" - "github.com/MQEnergy/go-framework/bootstrap" - "github.com/MQEnergy/go-framework/cmd" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/pkg/validator" - "github.com/MQEnergy/go-framework/router" + "github.com/MQEnergy/gin-framework/bootstrap" + "github.com/MQEnergy/gin-framework/cmd" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/pkg/validator" + "github.com/MQEnergy/gin-framework/router" "github.com/gogf/gf/v2/os/gtime" "github.com/urfave/cli/v2" "os" diff --git a/middleware/casbin_auth.go b/middleware/casbin_auth.go index be5fd73..23f13ac 100644 --- a/middleware/casbin_auth.go +++ b/middleware/casbin_auth.go @@ -1,10 +1,10 @@ package middleware import ( - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/global/app" - "github.com/MQEnergy/go-framework/pkg/response" - util2 "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/global/app" + "github.com/MQEnergy/gin-framework/pkg/response" + util2 "github.com/MQEnergy/gin-framework/pkg/util" "github.com/casbin/casbin/v2" "github.com/casbin/casbin/v2/util" gormadapter "github.com/casbin/gorm-adapter/v3" diff --git a/middleware/ip_auth.go b/middleware/ip_auth.go index 856038b..5c33615 100644 --- a/middleware/ip_auth.go +++ b/middleware/ip_auth.go @@ -2,7 +2,7 @@ package middleware import ( "fmt" - "github.com/MQEnergy/go-framework/config" + "github.com/MQEnergy/gin-framework/config" "github.com/gin-gonic/gin" "net/http" ) diff --git a/middleware/login_auth.go b/middleware/login_auth.go index d3e042b..b830180 100644 --- a/middleware/login_auth.go +++ b/middleware/login_auth.go @@ -1,9 +1,9 @@ package middleware import ( - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/auth" - "github.com/MQEnergy/go-framework/pkg/response" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/auth" + "github.com/MQEnergy/gin-framework/pkg/response" "github.com/gin-gonic/gin" "strings" ) diff --git a/middleware/requestid_auth.go b/middleware/requestid_auth.go index 4d745cd..07e23bc 100644 --- a/middleware/requestid_auth.go +++ b/middleware/requestid_auth.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "github.com/MQEnergy/go-framework/global" + "github.com/MQEnergy/gin-framework/global" "github.com/gin-contrib/requestid" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" diff --git a/models/model.go b/models/model.go index 34f6c4e..1b573b1 100644 --- a/models/model.go +++ b/models/model.go @@ -1,6 +1,6 @@ package models -import "github.com/MQEnergy/go-framework/pkg/util" +import "github.com/MQEnergy/gin-framework/pkg/util" type Model struct { Id uint64 `gorm:"primaryKey;autoIncrement;column:id;type:bigint unsigned;NOT NULL;" json:"id"` diff --git a/pkg/paginator/pagination.go b/pkg/paginator/pagination.go index f8891d8..3da5058 100644 --- a/pkg/paginator/pagination.go +++ b/pkg/paginator/pagination.go @@ -1,8 +1,8 @@ package paginator import ( - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/pkg/util" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/pkg/util" "github.com/samber/lo" "gorm.io/gorm" "math" diff --git a/pkg/util/upload.go b/pkg/util/upload.go index d152c28..6d7b87a 100644 --- a/pkg/util/upload.go +++ b/pkg/util/upload.go @@ -3,7 +3,7 @@ package util import ( "errors" "fmt" - "github.com/MQEnergy/go-framework/global" + "github.com/MQEnergy/gin-framework/global" "github.com/gin-gonic/gin" "io/ioutil" "os" diff --git a/router/register.go b/router/register.go index ba1c64e..07b572a 100644 --- a/router/register.go +++ b/router/register.go @@ -2,11 +2,11 @@ package router import ( "fmt" - "github.com/MQEnergy/go-framework/config" - "github.com/MQEnergy/go-framework/global" - "github.com/MQEnergy/go-framework/middleware" - "github.com/MQEnergy/go-framework/pkg/response" - "github.com/MQEnergy/go-framework/router/routes" + "github.com/MQEnergy/gin-framework/config" + "github.com/MQEnergy/gin-framework/global" + "github.com/MQEnergy/gin-framework/middleware" + "github.com/MQEnergy/gin-framework/pkg/response" + "github.com/MQEnergy/gin-framework/router/routes" "github.com/gin-contrib/cors" "github.com/gin-contrib/requestid" "github.com/gin-gonic/gin" diff --git a/router/routes/backend.go b/router/routes/backend.go index 81db3fe..dd6741b 100644 --- a/router/routes/backend.go +++ b/router/routes/backend.go @@ -1,7 +1,7 @@ package routes import ( - "github.com/MQEnergy/go-framework/app/controller/backend" + "github.com/MQEnergy/gin-framework/app/controller/backend" "github.com/gin-gonic/gin" ) diff --git a/router/routes/common.go b/router/routes/common.go index 0857fdb..dcd9f7d 100644 --- a/router/routes/common.go +++ b/router/routes/common.go @@ -1,8 +1,8 @@ package routes import ( - "github.com/MQEnergy/go-framework/app/controller/backend" - "github.com/MQEnergy/go-framework/app/controller/common" + "github.com/MQEnergy/gin-framework/app/controller/backend" + "github.com/MQEnergy/gin-framework/app/controller/common" "github.com/gin-gonic/gin" ) diff --git a/router/routes/frontend.go b/router/routes/frontend.go index 7907aa8..69cfbaf 100644 --- a/router/routes/frontend.go +++ b/router/routes/frontend.go @@ -1,7 +1,7 @@ package routes import ( - "github.com/MQEnergy/go-framework/app/controller/frontend" + "github.com/MQEnergy/gin-framework/app/controller/frontend" "github.com/gin-gonic/gin" ) diff --git a/types/admin/admin.go b/types/admin/admin.go index 48f3b7c..3e540a0 100644 --- a/types/admin/admin.go +++ b/types/admin/admin.go @@ -1,6 +1,6 @@ package admin -import "github.com/MQEnergy/go-framework/models" +import "github.com/MQEnergy/gin-framework/models" type BaseAdmin models.GinAdmin diff --git a/types/user/user.go b/types/user/user.go index fcb6c14..8a0a60f 100644 --- a/types/user/user.go +++ b/types/user/user.go @@ -1,6 +1,6 @@ package user -import "github.com/MQEnergy/go-framework/models" +import "github.com/MQEnergy/gin-framework/models" type BaseUser models.GinUser type GinUserInfo models.GinUserInfo