refactor: removed unnecessary code

This commit is contained in:
Marvin Zhang
2024-07-11 12:45:29 +08:00
parent f2f298d8f8
commit aca0c0ebce
57 changed files with 423 additions and 430 deletions

View File

@@ -11,6 +11,12 @@ import (
mongo2 "go.mongodb.org/mongo-driver/mongo"
)
type Action struct {
Method string
Path string
HandlerFunc gin.HandlerFunc
}
type BaseControllerV2[T any] struct {
modelSvc *service.ModelServiceV2[T]
actions []Action

View File

@@ -6,7 +6,7 @@ import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/controllers"
"github.com/crawlab-team/crawlab/core/middlewares"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/models/v2"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/crawlab-team/crawlab/core/user"
"github.com/spf13/viper"
@@ -24,7 +24,7 @@ func init() {
}
// TestModel is a simple struct to be used as a model in tests
type TestModel models.TestModel
type TestModel models.TestModelV2
var TestToken string

View File

@@ -5,7 +5,7 @@ import (
"encoding/json"
"github.com/crawlab-team/crawlab/core/controllers"
"github.com/crawlab-team/crawlab/core/middlewares"
"github.com/crawlab-team/crawlab/core/models/models"
"github.com/crawlab-team/crawlab/core/models/models/v2"
"github.com/crawlab-team/crawlab/core/models/service"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"