From b77c9684093284227e3cdcb152e93c4c6aa7e4c4 Mon Sep 17 00:00:00 2001 From: Paul Pan Date: Thu, 20 Oct 2022 16:50:19 +0800 Subject: [PATCH] feat: manually revert back --- cmd/app/run.go | 2 +- internal/api/debug/handler.go | 2 +- internal/api/problem/handler.go | 2 +- internal/api/problem/update.go | 4 ++-- internal/api/user/create.go | 2 +- internal/api/user/handler.go | 2 +- internal/api/user/login.go | 4 ++-- internal/api/user/logout.go | 2 +- internal/api/user/profile.go | 4 ++-- internal/app/app.go | 6 +++--- {global => internal/global}/config.go | 0 {global => internal/global}/global.go | 0 {global => internal/global}/jwt.go | 2 +- {global => internal/global}/repo.go | 0 {global => internal/global}/router.go | 0 {global => internal/global}/setup.go | 0 {model => internal/model}/Language.go | 0 {model => internal/model}/Problem.go | 0 {model => internal/model}/Role.go | 0 {model => internal/model}/Status.go | 0 {model => internal/model}/Submission.go | 0 {model => internal/model}/Task.go | 0 {model => internal/model}/User.go | 0 {model => internal/model}/Verdict.go | 0 {repo => internal/repo}/postgresql/postgresql.go | 4 ++-- {repo => internal/repo}/redis/redis.go | 2 +- internal/router/api.go | 2 +- internal/router/router.go | 2 +- internal/service/jwt/service.go | 2 +- internal/service/jwt/token.go | 2 +- internal/service/problem/create.go | 2 +- internal/service/problem/query.go | 2 +- internal/service/problem/queryFuzz.go | 2 +- internal/service/problem/service.go | 4 ++-- internal/service/problem/update.go | 2 +- internal/service/task/judge.go | 2 +- internal/service/task/push.go | 2 +- internal/service/task/service.go | 4 ++-- internal/service/user/create.go | 2 +- internal/service/user/login.go | 2 +- internal/service/user/profile.go | 2 +- internal/service/user/service.go | 4 ++-- 42 files changed, 38 insertions(+), 38 deletions(-) rename {global => internal/global}/config.go (100%) rename {global => internal/global}/global.go (100%) rename {global => internal/global}/jwt.go (90%) rename {global => internal/global}/repo.go (100%) rename {global => internal/global}/router.go (100%) rename {global => internal/global}/setup.go (100%) rename {model => internal/model}/Language.go (100%) rename {model => internal/model}/Problem.go (100%) rename {model => internal/model}/Role.go (100%) rename {model => internal/model}/Status.go (100%) rename {model => internal/model}/Submission.go (100%) rename {model => internal/model}/Task.go (100%) rename {model => internal/model}/User.go (100%) rename {model => internal/model}/Verdict.go (100%) rename {repo => internal/repo}/postgresql/postgresql.go (95%) rename {repo => internal/repo}/redis/redis.go (93%) diff --git a/cmd/app/run.go b/cmd/app/run.go index 96b23bd..0da7fbc 100644 --- a/cmd/app/run.go +++ b/cmd/app/run.go @@ -1,8 +1,8 @@ package main import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/app" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/urfave/cli/v2" "math/rand" "time" diff --git a/internal/api/debug/handler.go b/internal/api/debug/handler.go index d5d9e85..23ae47e 100644 --- a/internal/api/debug/handler.go +++ b/internal/api/debug/handler.go @@ -1,7 +1,7 @@ package debug import ( - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/gin-gonic/gin" "go.uber.org/zap" ) diff --git a/internal/api/problem/handler.go b/internal/api/problem/handler.go index 08fb97f..12378f8 100644 --- a/internal/api/problem/handler.go +++ b/internal/api/problem/handler.go @@ -1,7 +1,7 @@ package problem import ( - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/WHUPRJ/woj-server/internal/service/problem" "github.com/gin-gonic/gin" "go.uber.org/zap" diff --git a/internal/api/problem/update.go b/internal/api/problem/update.go index 68e2d85..03d5bd3 100644 --- a/internal/api/problem/update.go +++ b/internal/api/problem/update.go @@ -1,9 +1,9 @@ package problem import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/gin-gonic/gin" ) diff --git a/internal/api/user/create.go b/internal/api/user/create.go index 5149ee0..8e2dc25 100644 --- a/internal/api/user/create.go +++ b/internal/api/user/create.go @@ -1,8 +1,8 @@ package user import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/WHUPRJ/woj-server/internal/service/user" "github.com/gin-gonic/gin" ) diff --git a/internal/api/user/handler.go b/internal/api/user/handler.go index e05fba1..1dcc8b5 100644 --- a/internal/api/user/handler.go +++ b/internal/api/user/handler.go @@ -1,7 +1,7 @@ package user import ( - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/WHUPRJ/woj-server/internal/service/user" "github.com/gin-gonic/gin" "go.uber.org/zap" diff --git a/internal/api/user/login.go b/internal/api/user/login.go index 40336f6..1252c33 100644 --- a/internal/api/user/login.go +++ b/internal/api/user/login.go @@ -1,9 +1,9 @@ package user import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/gin-gonic/gin" ) diff --git a/internal/api/user/logout.go b/internal/api/user/logout.go index 015759a..f9a288c 100644 --- a/internal/api/user/logout.go +++ b/internal/api/user/logout.go @@ -1,8 +1,8 @@ package user import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/gin-gonic/gin" ) diff --git a/internal/api/user/profile.go b/internal/api/user/profile.go index cd14ec9..07a2f45 100644 --- a/internal/api/user/profile.go +++ b/internal/api/user/profile.go @@ -1,9 +1,9 @@ package user import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/gin-gonic/gin" ) diff --git a/internal/app/app.go b/internal/app/app.go index 9e77a21..58139f5 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -3,11 +3,11 @@ package app import ( "context" "fmt" - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/repo/postgresql" + "github.com/WHUPRJ/woj-server/internal/repo/redis" "github.com/WHUPRJ/woj-server/internal/router" "github.com/WHUPRJ/woj-server/internal/service/jwt" - "github.com/WHUPRJ/woj-server/repo/postgresql" - "github.com/WHUPRJ/woj-server/repo/redis" "go.uber.org/zap" "net/http" "os" diff --git a/global/config.go b/internal/global/config.go similarity index 100% rename from global/config.go rename to internal/global/config.go diff --git a/global/global.go b/internal/global/global.go similarity index 100% rename from global/global.go rename to internal/global/global.go diff --git a/global/jwt.go b/internal/global/jwt.go similarity index 90% rename from global/jwt.go rename to internal/global/jwt.go index 2d3e5e3..cac10dd 100644 --- a/global/jwt.go +++ b/internal/global/jwt.go @@ -2,7 +2,7 @@ package global import ( "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v4" ) diff --git a/global/repo.go b/internal/global/repo.go similarity index 100% rename from global/repo.go rename to internal/global/repo.go diff --git a/global/router.go b/internal/global/router.go similarity index 100% rename from global/router.go rename to internal/global/router.go diff --git a/global/setup.go b/internal/global/setup.go similarity index 100% rename from global/setup.go rename to internal/global/setup.go diff --git a/model/Language.go b/internal/model/Language.go similarity index 100% rename from model/Language.go rename to internal/model/Language.go diff --git a/model/Problem.go b/internal/model/Problem.go similarity index 100% rename from model/Problem.go rename to internal/model/Problem.go diff --git a/model/Role.go b/internal/model/Role.go similarity index 100% rename from model/Role.go rename to internal/model/Role.go diff --git a/model/Status.go b/internal/model/Status.go similarity index 100% rename from model/Status.go rename to internal/model/Status.go diff --git a/model/Submission.go b/internal/model/Submission.go similarity index 100% rename from model/Submission.go rename to internal/model/Submission.go diff --git a/model/Task.go b/internal/model/Task.go similarity index 100% rename from model/Task.go rename to internal/model/Task.go diff --git a/model/User.go b/internal/model/User.go similarity index 100% rename from model/User.go rename to internal/model/User.go diff --git a/model/Verdict.go b/internal/model/Verdict.go similarity index 100% rename from model/Verdict.go rename to internal/model/Verdict.go diff --git a/repo/postgresql/postgresql.go b/internal/repo/postgresql/postgresql.go similarity index 95% rename from repo/postgresql/postgresql.go rename to internal/repo/postgresql/postgresql.go index a99d57d..15b0226 100644 --- a/repo/postgresql/postgresql.go +++ b/internal/repo/postgresql/postgresql.go @@ -4,8 +4,8 @@ import ( "database/sql" "errors" "fmt" - "github.com/WHUPRJ/woj-server/global" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" "gorm.io/driver/postgres" "gorm.io/gorm" diff --git a/repo/redis/redis.go b/internal/repo/redis/redis.go similarity index 93% rename from repo/redis/redis.go rename to internal/repo/redis/redis.go index 1058f4d..d23da71 100644 --- a/repo/redis/redis.go +++ b/internal/repo/redis/redis.go @@ -2,7 +2,7 @@ package redis import ( "context" - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/go-redis/redis/v8" "go.uber.org/zap" ) diff --git a/internal/router/api.go b/internal/router/api.go index 1e88076..80fab98 100644 --- a/internal/router/api.go +++ b/internal/router/api.go @@ -1,10 +1,10 @@ package router import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/api/debug" "github.com/WHUPRJ/woj-server/internal/api/problem" "github.com/WHUPRJ/woj-server/internal/api/user" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/gin-gonic/gin" ) diff --git a/internal/router/router.go b/internal/router/router.go index f03bb88..a5669f2 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -1,7 +1,7 @@ package router import ( - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/WHUPRJ/woj-server/internal/pkg/metrics" _ "github.com/WHUPRJ/woj-server/internal/router/docs" "github.com/WHUPRJ/woj-server/pkg/utils" diff --git a/internal/service/jwt/service.go b/internal/service/jwt/service.go index 36b1d99..3cb372d 100644 --- a/internal/service/jwt/service.go +++ b/internal/service/jwt/service.go @@ -1,7 +1,7 @@ package jwt import ( - "github.com/WHUPRJ/woj-server/global" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/go-redis/redis/v8" "go.uber.org/zap" ) diff --git a/internal/service/jwt/token.go b/internal/service/jwt/token.go index 5deaa17..876757e 100644 --- a/internal/service/jwt/token.go +++ b/internal/service/jwt/token.go @@ -3,8 +3,8 @@ package jwt import ( "context" "fmt" - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" + "github.com/WHUPRJ/woj-server/internal/global" "github.com/WHUPRJ/woj-server/pkg/utils" "github.com/golang-jwt/jwt/v4" "go.uber.org/zap" diff --git a/internal/service/problem/create.go b/internal/service/problem/create.go index a06c392..ad48e3a 100644 --- a/internal/service/problem/create.go +++ b/internal/service/problem/create.go @@ -2,7 +2,7 @@ package problem import ( "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" ) diff --git a/internal/service/problem/query.go b/internal/service/problem/query.go index 4155f28..f6ef0df 100644 --- a/internal/service/problem/query.go +++ b/internal/service/problem/query.go @@ -3,7 +3,7 @@ package problem import ( "errors" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/WHUPRJ/woj-server/pkg/utils" "gorm.io/gorm" "gorm.io/gorm/clause" diff --git a/internal/service/problem/queryFuzz.go b/internal/service/problem/queryFuzz.go index 0d82896..0fad2fc 100644 --- a/internal/service/problem/queryFuzz.go +++ b/internal/service/problem/queryFuzz.go @@ -3,7 +3,7 @@ package problem import ( "errors" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "gorm.io/gorm" "gorm.io/gorm/clause" ) diff --git a/internal/service/problem/service.go b/internal/service/problem/service.go index b9c3e4a..693951d 100644 --- a/internal/service/problem/service.go +++ b/internal/service/problem/service.go @@ -1,9 +1,9 @@ package problem import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" "gorm.io/gorm" ) diff --git a/internal/service/problem/update.go b/internal/service/problem/update.go index 31ddad2..079bb13 100644 --- a/internal/service/problem/update.go +++ b/internal/service/problem/update.go @@ -2,7 +2,7 @@ package problem import ( "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" "gorm.io/gorm/clause" ) diff --git a/internal/service/task/judge.go b/internal/service/task/judge.go index 12df05f..057c150 100644 --- a/internal/service/task/judge.go +++ b/internal/service/task/judge.go @@ -3,7 +3,7 @@ package task import ( "encoding/json" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" ) diff --git a/internal/service/task/push.go b/internal/service/task/push.go index b6026af..e252789 100644 --- a/internal/service/task/push.go +++ b/internal/service/task/push.go @@ -3,7 +3,7 @@ package task import ( "encoding/json" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" ) diff --git a/internal/service/task/service.go b/internal/service/task/service.go index 8b104b5..66d48ff 100644 --- a/internal/service/task/service.go +++ b/internal/service/task/service.go @@ -1,9 +1,9 @@ package task import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/hibiken/asynq" "go.uber.org/zap" ) diff --git a/internal/service/user/create.go b/internal/service/user/create.go index 32f8059..faf5e16 100644 --- a/internal/service/user/create.go +++ b/internal/service/user/create.go @@ -2,7 +2,7 @@ package user import ( "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "go.uber.org/zap" "golang.org/x/crypto/bcrypt" "strings" diff --git a/internal/service/user/login.go b/internal/service/user/login.go index 64ccad0..77824e5 100644 --- a/internal/service/user/login.go +++ b/internal/service/user/login.go @@ -3,7 +3,7 @@ package user import ( "errors" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "golang.org/x/crypto/bcrypt" "gorm.io/gorm" ) diff --git a/internal/service/user/profile.go b/internal/service/user/profile.go index a94d169..4705f31 100644 --- a/internal/service/user/profile.go +++ b/internal/service/user/profile.go @@ -3,7 +3,7 @@ package user import ( "errors" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/model" "gorm.io/gorm" ) diff --git a/internal/service/user/service.go b/internal/service/user/service.go index 4f38ef0..e5e398a 100644 --- a/internal/service/user/service.go +++ b/internal/service/user/service.go @@ -1,9 +1,9 @@ package user import ( - "github.com/WHUPRJ/woj-server/global" "github.com/WHUPRJ/woj-server/internal/e" - "github.com/WHUPRJ/woj-server/model" + "github.com/WHUPRJ/woj-server/internal/global" + "github.com/WHUPRJ/woj-server/internal/model" "github.com/go-redis/redis/v8" "go.uber.org/zap" "gorm.io/gorm"