修改模块名为goweb-gin-demo
parent
da4b26cdf6
commit
28bbe31e12
|
@ -101,7 +101,7 @@ docs/
|
||||||
└── swagger.yaml
|
└── swagger.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
> 需要注意把docs文件夹导入到代码中 `import "github.com/ymm135/goweb-gin-demo/docs"`
|
> 需要注意把docs文件夹导入到代码中 `import "goweb-gin-demo/docs"`
|
||||||
|
|
||||||
# 验证码获取及校验
|
# 验证码获取及校验
|
||||||
首选通过`/base/captcha`获取验证码,其中包含验证码图片地址:`data:image/png;...`
|
首选通过`/base/captcha`获取验证码,其中包含验证码图片地址:`data:image/png;...`
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/api/web"
|
"goweb-gin-demo/api/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ApiGroup struct {
|
type ApiGroup struct {
|
||||||
|
|
|
@ -3,9 +3,9 @@ package web
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/mojocn/base64Captcha"
|
"github.com/mojocn/base64Captcha"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/response"
|
"goweb-gin-demo/model/common/response"
|
||||||
webRes "github.com/ymm135/goweb-gin-demo/model/web/response"
|
webRes "goweb-gin-demo/model/web/response"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/service"
|
"goweb-gin-demo/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ApiGroup struct {
|
type ApiGroup struct {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/response"
|
"goweb-gin-demo/model/common/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/response"
|
"goweb-gin-demo/model/common/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
systemReq "github.com/ymm135/goweb-gin-demo/model/web/request"
|
systemReq "goweb-gin-demo/model/web/request"
|
||||||
systemRes "github.com/ymm135/goweb-gin-demo/model/web/response"
|
systemRes "goweb-gin-demo/model/web/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/utils"
|
"goweb-gin-demo/utils"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -4,13 +4,13 @@ import (
|
||||||
"github.com/dgrijalva/jwt-go"
|
"github.com/dgrijalva/jwt-go"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/response"
|
"goweb-gin-demo/model/common/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
systemReq "github.com/ymm135/goweb-gin-demo/model/web/request"
|
systemReq "goweb-gin-demo/model/web/request"
|
||||||
webRes "github.com/ymm135/goweb-gin-demo/model/web/response"
|
webRes "goweb-gin-demo/model/web/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/utils"
|
"goweb-gin-demo/utils"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/fvbock/endless"
|
"github.com/fvbock/endless"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/initialize"
|
"goweb-gin-demo/initialize"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
|
|
||||||
"github.com/songzhibin97/gkit/cache/local_cache"
|
"github.com/songzhibin97/gkit/cache/local_cache"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
_ "github.com/ymm135/goweb-gin-demo/packfile"
|
_ "goweb-gin-demo/packfile"
|
||||||
"github.com/ymm135/goweb-gin-demo/utils"
|
"goweb-gin-demo/utils"
|
||||||
|
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/utils"
|
"goweb-gin-demo/utils"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,13 +2,13 @@ package global
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/songzhibin97/gkit/cache/local_cache"
|
"github.com/songzhibin97/gkit/cache/local_cache"
|
||||||
"github.com/ymm135/goweb-gin-demo/utils/timer"
|
"goweb-gin-demo/utils/timer"
|
||||||
|
|
||||||
"golang.org/x/sync/singleflight"
|
"golang.org/x/sync/singleflight"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/config"
|
"goweb-gin-demo/config"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module github.com/ymm135/goweb-gin-demo
|
module goweb-gin-demo
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package initialize
|
package initialize
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/initialize/internal"
|
"goweb-gin-demo/initialize/internal"
|
||||||
|
|
||||||
"gorm.io/driver/mysql"
|
"gorm.io/driver/mysql"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"gorm.io/gorm/logger"
|
"gorm.io/gorm/logger"
|
||||||
"gorm.io/gorm/utils"
|
"gorm.io/gorm/utils"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/swaggo/gin-swagger"
|
"github.com/swaggo/gin-swagger"
|
||||||
"github.com/swaggo/gin-swagger/swaggerFiles"
|
"github.com/swaggo/gin-swagger/swaggerFiles"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/middleware"
|
"goweb-gin-demo/middleware"
|
||||||
"github.com/ymm135/goweb-gin-demo/router"
|
"goweb-gin-demo/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Routers() *gin.Engine {
|
func Routers() *gin.Engine {
|
||||||
|
|
|
@ -42,3 +42,5 @@
|
||||||
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:24:04.838 [34minfo[0m /Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:43 router register success
|
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:24:04.838 [34minfo[0m /Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:43 router register success
|
||||||
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:24:04.839 [34minfo[0m /Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31 server run success on {"address": ":8888"}
|
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:24:04.839 [34minfo[0m /Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31 server run success on {"address": ":8888"}
|
||||||
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:33:20.005 [31merror[0m /Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38 accept tcp [::]:8888: use of closed network connection
|
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:33:20.005 [31merror[0m /Users/zero/work/mygithub/goweb-gin-demo/core/server.go:38 accept tcp [::]:8888: use of closed network connection
|
||||||
|
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:42:32.682 [34minfo[0m /Users/zero/work/mygithub/goweb-gin-demo/initialize/router.go:43 router register success
|
||||||
|
[github.com/flipped-aurora/gin-vue-admin/server]2021/10/29 - 14:42:32.683 [34minfo[0m /Users/zero/work/mygithub/goweb-gin-demo/core/server.go:31 server run success on {"address": ":8888"}
|
||||||
|
|
8
main.go
8
main.go
|
@ -1,10 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/core"
|
"goweb-gin-demo/core"
|
||||||
_ "github.com/ymm135/goweb-gin-demo/docs"
|
_ "goweb-gin-demo/docs"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/initialize"
|
"goweb-gin-demo/initialize"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -2,10 +2,10 @@ package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/response"
|
"goweb-gin-demo/model/common/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web/request"
|
"goweb-gin-demo/model/web/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/service"
|
"goweb-gin-demo/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
var casbinService = service.ServiceGroupApp.CasbinService
|
var casbinService = service.ServiceGroupApp.CasbinService
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package middleware
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/utils"
|
"goweb-gin-demo/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/response"
|
"goweb-gin-demo/model/common/response"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"github.com/ymm135/goweb-gin-demo/service"
|
"goweb-gin-demo/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web/request"
|
"goweb-gin-demo/model/web/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/service"
|
"goweb-gin-demo/service"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysBaseMenu struct {
|
type SysBaseMenu struct {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JwtBlacklist struct {
|
type JwtBlacklist struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ package web
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 如果含有time.Time 请自行import time包
|
// 如果含有time.Time 请自行import time包
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package request
|
package request
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add menu authority info structure
|
// Add menu authority info structure
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package request
|
package request
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysOperationRecordSearch struct {
|
type SysOperationRecordSearch struct {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package response
|
package response
|
||||||
|
|
||||||
import "github.com/ymm135/goweb-gin-demo/model/web"
|
import "goweb-gin-demo/model/web"
|
||||||
|
|
||||||
type SysAuthorityResponse struct {
|
type SysAuthorityResponse struct {
|
||||||
Authority web.SysAuthority `json:"authority"`
|
Authority web.SysAuthority `json:"authority"`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package response
|
package response
|
||||||
|
|
||||||
import "github.com/ymm135/goweb-gin-demo/model/web"
|
import "goweb-gin-demo/model/web"
|
||||||
|
|
||||||
type SysMenusResponse struct {
|
type SysMenusResponse struct {
|
||||||
Menus []web.SysMenu `json:"menus"`
|
Menus []web.SysMenu `json:"menus"`
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package response
|
package response
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SysUserResponse struct {
|
type SysUserResponse struct {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/satori/go.uuid"
|
"github.com/satori/go.uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package router
|
package router
|
||||||
|
|
||||||
import "github.com/ymm135/goweb-gin-demo/router/web"
|
import "goweb-gin-demo/router/web"
|
||||||
|
|
||||||
type RouterGroup struct {
|
type RouterGroup struct {
|
||||||
web.BaseRouter
|
web.BaseRouter
|
||||||
|
|
|
@ -2,7 +2,7 @@ package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/ymm135/goweb-gin-demo/api"
|
"goweb-gin-demo/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BaseRouter struct {
|
type BaseRouter struct {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
v1 "github.com/ymm135/goweb-gin-demo/api"
|
v1 "goweb-gin-demo/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JwtRouter struct {
|
type JwtRouter struct {
|
||||||
|
|
|
@ -2,8 +2,8 @@ package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
v1 "github.com/ymm135/goweb-gin-demo/api"
|
v1 "goweb-gin-demo/api"
|
||||||
"github.com/ymm135/goweb-gin-demo/middleware"
|
"goweb-gin-demo/middleware"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MenuRouter struct {
|
type MenuRouter struct {
|
||||||
|
|
|
@ -2,8 +2,8 @@ package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
v1 "github.com/ymm135/goweb-gin-demo/api"
|
v1 "goweb-gin-demo/api"
|
||||||
"github.com/ymm135/goweb-gin-demo/middleware"
|
"goweb-gin-demo/middleware"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserRouter struct {
|
type UserRouter struct {
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web/response"
|
"goweb-gin-demo/model/web/response"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package service
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"github.com/casbin/casbin/v2/util"
|
"github.com/casbin/casbin/v2/util"
|
||||||
gormadapter "github.com/casbin/gorm-adapter/v3"
|
gormadapter "github.com/casbin/gorm-adapter/v3"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web/request"
|
"goweb-gin-demo/model/web/request"
|
||||||
)
|
)
|
||||||
|
|
||||||
//@author: [piexlmax](https://github.com/piexlmax)
|
//@author: [piexlmax](https://github.com/piexlmax)
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JwtService struct {
|
type JwtService struct {
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
systemReq "github.com/ymm135/goweb-gin-demo/model/web/request"
|
systemReq "goweb-gin-demo/model/web/request"
|
||||||
)
|
)
|
||||||
|
|
||||||
//@author: [granty1](https://github.com/granty1)
|
//@author: [granty1](https://github.com/granty1)
|
||||||
|
|
|
@ -3,10 +3,10 @@ package service
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/common/request"
|
"goweb-gin-demo/model/common/request"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web"
|
"goweb-gin-demo/model/web"
|
||||||
"github.com/ymm135/goweb-gin-demo/utils"
|
"goweb-gin-demo/utils"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package utils
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
systemReq "github.com/ymm135/goweb-gin-demo/model/web/request"
|
systemReq "goweb-gin-demo/model/web/request"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 从Gin的Context中获取从jwt解析出来的用户ID
|
// 从Gin的Context中获取从jwt解析出来的用户ID
|
||||||
|
|
|
@ -3,7 +3,7 @@ package utils
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package utils
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/dgrijalva/jwt-go"
|
"github.com/dgrijalva/jwt-go"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"github.com/ymm135/goweb-gin-demo/model/web/request"
|
"goweb-gin-demo/model/web/request"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JWT struct {
|
type JWT struct {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
zaprotatelogs "github.com/lestrrat-go/file-rotatelogs"
|
zaprotatelogs "github.com/lestrrat-go/file-rotatelogs"
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ymm135/goweb-gin-demo/global"
|
"goweb-gin-demo/global"
|
||||||
zaprotatelogs "github.com/lestrrat-go/file-rotatelogs"
|
zaprotatelogs "github.com/lestrrat-go/file-rotatelogs"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue