优化结构
This commit is contained in:
parent
e65cf0b1d0
commit
746e33e027
|
|
@ -0,0 +1,34 @@
|
|||
// Package app is the composition root for the running administration service.
|
||||
// It knows which business modules are enabled and wires their contributions
|
||||
// into the shared platform. Individual modules do not import this package.
|
||||
package app
|
||||
|
||||
import (
|
||||
systemmodule "kra/app/system"
|
||||
systemserver "kra/app/system/transport/server"
|
||||
systemworker "kra/app/system/worker"
|
||||
"kra/pkg/module"
|
||||
platformtask "kra/pkg/task"
|
||||
)
|
||||
|
||||
// Catalog lists the business modules enabled in this binary. Adding an order
|
||||
// module means adding one Definition here; system initialization and runtime
|
||||
// code consume the catalog without knowing that module's implementation.
|
||||
func Catalog() module.Catalog {
|
||||
return module.Catalog{Definitions: []module.Definition{systemmodule.Definition()}}
|
||||
}
|
||||
|
||||
// TaskRegistry builds the process-wide registry from dependency-free module
|
||||
// contributions. Dependency-bearing methods are added by their module runtime
|
||||
// constructors after the usecases have been created.
|
||||
func TaskRegistry(catalog module.Catalog) *platformtask.Registry {
|
||||
registry := platformtask.NewRegistry()
|
||||
registry.RegisterAll(catalog.TaskMethods())
|
||||
return registry
|
||||
}
|
||||
|
||||
// Runtime composes HTTP route contributors from the enabled modules.
|
||||
func Runtime(systemRoutes *systemserver.Routes, systemTasks *systemworker.TaskMethods, registry *platformtask.Registry) *module.Runtime {
|
||||
platformtask.Apply(registry, systemTasks)
|
||||
return module.NewRuntime(systemRoutes)
|
||||
}
|
||||
|
|
@ -10,18 +10,22 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/app/system/service"
|
||||
"kra/app/system/transport/handler"
|
||||
"kra/app/system/transport/httpx"
|
||||
servermiddleware "kra/app/system/transport/middleware"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/service"
|
||||
"kra/internal/modules/system/transport/handler"
|
||||
"kra/internal/modules/system/transport/httpx"
|
||||
servermiddleware "kra/internal/modules/system/transport/middleware"
|
||||
serverrouter "kra/internal/modules/system/transport/router"
|
||||
platformmodule "kra/pkg/module"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
kratoshttp "github.com/go-kratos/kratos/v3/transport/http"
|
||||
)
|
||||
|
||||
func NewGinEngine(runtime *conf.Runtime, access *service.AccessControlService, handlers *handler.Set, auth *service.AuthService, security *service.SecurityService, audit *service.AuditRecorder, logger *slog.Logger, version string) *gin.Engine {
|
||||
return NewGinEngineWithRuntime(runtime, access, auth, security, audit, logger, version, platformmodule.NewRuntime(NewRoutes(handlers)))
|
||||
}
|
||||
|
||||
func NewGinEngineWithRuntime(runtime *conf.Runtime, access *service.AccessControlService, auth *service.AuthService, security *service.SecurityService, audit *service.AuditRecorder, logger *slog.Logger, version string, routes *platformmodule.Runtime) *gin.Engine {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
engine := gin.New()
|
||||
if err := engine.SetTrustedProxies(nil); err != nil && logger != nil {
|
||||
|
|
@ -36,7 +40,6 @@ func NewGinEngine(runtime *conf.Runtime, access *service.AccessControlService, h
|
|||
}
|
||||
public := engine.Group(prefix)
|
||||
public.GET("/health", func(c *gin.Context) { c.JSON(http.StatusOK, "ok") })
|
||||
serverrouter.RegisterPublic(public, engine, handlers.Public)
|
||||
|
||||
private := engine.Group(prefix)
|
||||
// The reference administration behavior installs operation recording after JWT,
|
||||
|
|
@ -44,26 +47,9 @@ func NewGinEngine(runtime *conf.Runtime, access *service.AccessControlService, h
|
|||
// equivalent Kra guards avoids persisting rejected unauthenticated or
|
||||
// unauthorized requests as successful business operations.
|
||||
private.Use(servermiddleware.Auth(auth), servermiddleware.MustChangePassword(), servermiddleware.AccessControl(runtime, access), servermiddleware.OperationAudit(runtime, audit))
|
||||
serverrouter.RegisterUser(private, handlers.User)
|
||||
serverrouter.RegisterNavigation(private, handlers.Navigation)
|
||||
serverrouter.RegisterSession(private, handlers.Session)
|
||||
serverrouter.RegisterAuthority(private, handlers.Authority)
|
||||
serverrouter.RegisterMenu(private, handlers.Menu)
|
||||
serverrouter.RegisterAPI(private, public, engine, handlers.API)
|
||||
serverrouter.RegisterPermission(private, handlers.Permission)
|
||||
serverrouter.RegisterOrganization(private, handlers.Organization)
|
||||
serverrouter.RegisterDictionary(private, handlers.Dictionary)
|
||||
serverrouter.RegisterParameter(private, handlers.Parameter)
|
||||
serverrouter.RegisterAPIToken(private, handlers.APIToken)
|
||||
serverrouter.RegisterSystemConfig(private, handlers.SystemConfig)
|
||||
serverrouter.RegisterVersion(private, handlers.Version)
|
||||
serverrouter.RegisterExport(private, public, handlers.Export)
|
||||
serverrouter.RegisterAudit(private, public, handlers.Audit)
|
||||
serverrouter.RegisterTask(private, handlers.Task)
|
||||
serverrouter.RegisterMedia(private, handlers.Media)
|
||||
serverrouter.RegisterAnnouncement(private, public, handlers.Announcement)
|
||||
serverrouter.RegisterEmail(private, handlers.Email)
|
||||
serverrouter.RegisterPayment(private, public, handlers.Payment)
|
||||
if routes != nil {
|
||||
routes.RegisterRoutes(public, private, engine)
|
||||
}
|
||||
registerSwagger(engine, prefix, version, logger)
|
||||
registerLocalStorage(engine, runtime)
|
||||
|
||||
|
|
@ -11,8 +11,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/transport/handler"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/transport/handler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"kra/internal/modules/system/routeinfo"
|
||||
"kra/app/system/routeinfo"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
|
|
@ -14,3 +14,8 @@
|
|||
|
||||
系统表统一使用 `sys_` 前缀;业务表应由新业务模块自行命名和迁移,不要混入
|
||||
本目录。
|
||||
|
||||
system 通过 `Definition()` 提供自己的迁移、支付菜单/API 和默认任务,通过
|
||||
`worker.TaskMethods` 提供依赖系统用例的任务实现,通过 `transport/server.Routes`
|
||||
提供路由。应用组合根消费这些公共协议;新增业务不需要修改 system 的初始化、
|
||||
worker、路由或数据层。
|
||||
|
|
@ -3,4 +3,4 @@ package biz
|
|||
import "github.com/google/wire"
|
||||
|
||||
// ProviderSet is biz providers.
|
||||
var ProviderSet = wire.NewSet(NewUserUsecase, NewAuthenticationUsecase, NewSystemConfigUsecase, NewAuthorityUsecase, NewAPIUsecase, NewPermissionUsecase, NewAccessControlUsecase, NewMenuUsecase, NewDepartmentUsecase, NewPositionUsecase, NewDictionaryUsecase, NewParameterUsecase, NewTokenUsecase, NewSecurityUsecase, NewVersionUsecase, NewExportUsecase, NewAuditUsecase, NewAuditRecorderUsecase, NewLogViewerUsecase, NewTaskUsecase, NewTaskApplicationUsecase, NewMediaUsecase, NewAnnouncementUsecase, NewEmailUsecase, NewPaymentUsecase)
|
||||
var ProviderSet = wire.NewSet(NewUserUsecase, NewAuthenticationUsecase, NewSystemConfigUsecase, NewAuthorityUsecase, NewAPIUsecase, NewPermissionUsecase, NewAccessControlUsecase, NewMenuUsecase, NewDepartmentUsecase, NewPositionUsecase, NewDictionaryUsecase, NewParameterUsecase, NewTokenUsecase, NewSecurityUsecase, NewVersionUsecase, NewExportUsecase, NewAuditUsecase, NewAuditRecorderUsecase, NewLogViewerUsecase, NewTaskUsecaseWithRegistry, NewTaskApplicationUsecase, NewMediaUsecase, NewAnnouncementUsecase, NewEmailUsecase, NewPaymentUsecase)
|
||||
|
|
@ -72,9 +72,23 @@ type TaskRuntime interface {
|
|||
Unsubscribe(uint, chan []byte)
|
||||
}
|
||||
|
||||
type TaskUsecase struct{ TaskRepo }
|
||||
type TaskUsecase struct {
|
||||
TaskRepo
|
||||
methods TaskMethodRegistry
|
||||
}
|
||||
|
||||
func NewTaskUsecase(repo TaskRepo) *TaskUsecase { return &TaskUsecase{TaskRepo: repo} }
|
||||
func NewTaskUsecase(repo TaskRepo) *TaskUsecase {
|
||||
return NewTaskUsecaseWithRegistry(repo, DefaultTaskMethodRegistry())
|
||||
}
|
||||
|
||||
func NewTaskUsecaseWithRegistry(repo TaskRepo, methods TaskMethodRegistry) *TaskUsecase {
|
||||
if methods == nil {
|
||||
methods = DefaultTaskMethodRegistry()
|
||||
}
|
||||
return &TaskUsecase{TaskRepo: repo, methods: methods}
|
||||
}
|
||||
|
||||
func (uc *TaskUsecase) RegisteredMethods() []TaskMethod { return uc.methods.List() }
|
||||
|
||||
func (uc *TaskUsecase) Validate(value *TimedTask) error {
|
||||
if value.Name == "" {
|
||||
|
|
@ -91,7 +105,7 @@ func (uc *TaskUsecase) Validate(value *TimedTask) error {
|
|||
}
|
||||
switch value.ExecutorType {
|
||||
case TaskExecutorMethod:
|
||||
if !registeredTaskMethod(value.MethodName) {
|
||||
if _, ok := uc.methods.Lookup(value.MethodName); !ok {
|
||||
return fmt.Errorf("方法 %s 未注册", value.MethodName)
|
||||
}
|
||||
if len(value.Params) > 0 && !json.Valid(value.Params) {
|
||||
|
|
@ -154,6 +168,10 @@ func NewTaskApplicationUsecase(tasks *TaskUsecase, runtime TaskRuntime) *TaskApp
|
|||
return &TaskApplicationUsecase{tasks: tasks, runtime: runtime}
|
||||
}
|
||||
|
||||
func (uc *TaskApplicationUsecase) RegisteredMethods() []TaskMethod {
|
||||
return uc.tasks.RegisteredMethods()
|
||||
}
|
||||
|
||||
func (uc *TaskApplicationUsecase) syncRuntime(ctx context.Context, id uint) error {
|
||||
if ctx == nil {
|
||||
ctx = context.Background()
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package biz
|
||||
|
||||
import platformtask "kra/pkg/task"
|
||||
|
||||
type TaskMethodFunc = platformtask.MethodFunc
|
||||
type TaskMethod = platformtask.Method
|
||||
|
||||
type TaskMethodRegistry interface {
|
||||
Register(platformtask.Method)
|
||||
Lookup(string) (TaskMethodFunc, bool)
|
||||
List() []TaskMethod
|
||||
}
|
||||
|
||||
var defaultTaskMethods = platformtask.NewRegistry()
|
||||
|
||||
// RegisterTaskMethod remains as a compatibility helper for tests and callers
|
||||
// that have not moved to constructor injection yet.
|
||||
func RegisterTaskMethod(name, description string, fn TaskMethodFunc) {
|
||||
defaultTaskMethods.Register(platformtask.Method{Name: name, Description: description, Run: fn})
|
||||
}
|
||||
|
||||
func TaskMethodByName(name string) (TaskMethodFunc, bool) {
|
||||
return defaultTaskMethods.Lookup(name)
|
||||
}
|
||||
|
||||
func RegisteredTaskMethods() []TaskMethod { return defaultTaskMethods.List() }
|
||||
|
||||
func DefaultTaskMethodRegistry() TaskMethodRegistry { return defaultTaskMethods }
|
||||
|
|
@ -9,8 +9,8 @@ import (
|
|||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/integration/storage"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
|
@ -351,7 +351,7 @@ func (d *Data) reloadConfig(ctx context.Context) error {
|
|||
}
|
||||
}
|
||||
if databaseReady && (next.Admin.System == nil || !next.Admin.System.DisableAutoMigrate) {
|
||||
if err = migrateAll(candidateDB.WithContext(ctx)); err != nil {
|
||||
if err = migrateAll(candidateDB.WithContext(ctx), d.catalog); err != nil {
|
||||
return fmt.Errorf("reload database migrations: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
@ -11,10 +11,11 @@ import (
|
|||
"github.com/google/wire"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gorm.io/gorm"
|
||||
datapayment "kra/app/system/data/payment"
|
||||
datasystem "kra/app/system/data/repository"
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
datapayment "kra/internal/modules/system/data/payment"
|
||||
datasystem "kra/internal/modules/system/data/repository"
|
||||
"kra/internal/modules/system/integration/storage"
|
||||
"kra/pkg/module"
|
||||
)
|
||||
|
||||
var ProviderSet = wire.NewSet(
|
||||
|
|
@ -44,6 +45,7 @@ type Data struct {
|
|||
dbList map[string]*gorm.DB
|
||||
appLogger *slog.Logger
|
||||
auditLog *dataScopeAuditWriter
|
||||
catalog module.Catalog
|
||||
}
|
||||
|
||||
// DB exposes the active primary database to narrowly scoped data submodules.
|
||||
|
|
@ -139,7 +141,7 @@ func (d *Data) database(name string) (*gorm.DB, error) {
|
|||
return db, nil
|
||||
}
|
||||
|
||||
func NewData(runtime *conf.Runtime, appLogger *slog.Logger, storageManager *storage.Reloadable) (*Data, func(), error) {
|
||||
func NewData(runtime *conf.Runtime, appLogger *slog.Logger, storageManager *storage.Reloadable, catalog module.Catalog) (*Data, func(), error) {
|
||||
if appLogger == nil {
|
||||
appLogger = slog.Default()
|
||||
}
|
||||
|
|
@ -153,7 +155,7 @@ func NewData(runtime *conf.Runtime, appLogger *slog.Logger, storageManager *stor
|
|||
// and /init/initdb remain available.
|
||||
c.Database = &conf.Data_Database{}
|
||||
}
|
||||
d := &Data{runtime: runtime, appLogger: appLogger, storage: storageManager}
|
||||
d := &Data{runtime: runtime, appLogger: appLogger, storage: storageManager, catalog: catalog}
|
||||
usingFallback := !databaseConnectionConfigured(c.Database)
|
||||
var db *gorm.DB
|
||||
var err error
|
||||
|
|
@ -190,7 +192,7 @@ func NewData(runtime *conf.Runtime, appLogger *slog.Logger, storageManager *stor
|
|||
}
|
||||
disableAutoMigrate := admin.System != nil && admin.System.DisableAutoMigrate
|
||||
if !usingFallback && !disableAutoMigrate {
|
||||
if err = migrateAll(db); err != nil {
|
||||
if err = migrateAll(db, catalog); err != nil {
|
||||
return nil, nil, fmt.Errorf("migrate tables: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -20,7 +20,7 @@ import (
|
|||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/schema"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/platform/database/gormkit"
|
||||
"kra/pkg/database/gormkit"
|
||||
)
|
||||
|
||||
var databaseNamePattern = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_$-]*$`)
|
||||
|
|
@ -9,7 +9,7 @@ import (
|
|||
"time"
|
||||
|
||||
"kra/internal/logging"
|
||||
"kra/internal/platform/database/gormkit"
|
||||
"kra/pkg/database/gormkit"
|
||||
|
||||
"gorm.io/gorm/logger"
|
||||
)
|
||||
|
|
@ -5,9 +5,9 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/modules/system/integration/storage"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
|
@ -180,7 +180,7 @@ func (d *Data) InitializeDatabase(ctx context.Context, input *biz.DatabaseConfig
|
|||
}
|
||||
}()
|
||||
db := candidate.WithContext(ctx)
|
||||
if err := migrateAll(db); err != nil {
|
||||
if err := migrateAll(db, d.catalog); err != nil {
|
||||
return err
|
||||
}
|
||||
if seed != nil {
|
||||
|
|
@ -7,8 +7,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/integration/storage"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package data
|
||||
|
||||
import (
|
||||
datapayment "kra/app/system/data/payment"
|
||||
datasystem "kra/app/system/data/repository"
|
||||
"kra/pkg/database/migration"
|
||||
"kra/pkg/module"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func InfrastructureMigrations() []migration.Step {
|
||||
return []migration.Step{{
|
||||
ID: "202608200001_data_infrastructure",
|
||||
Migrate: func(db *gorm.DB) error {
|
||||
return migration.CreateMissingTables(db, &integrationConfigPO{})
|
||||
},
|
||||
}}
|
||||
}
|
||||
|
||||
// migrateAll is the single data-layer migration entry point. Module-specific
|
||||
// schema work stays with the module that owns its persistent objects.
|
||||
func migrateAll(db *gorm.DB, catalogs ...module.Catalog) error {
|
||||
steps := InfrastructureMigrations()
|
||||
if len(catalogs) > 0 && len(catalogs[0].MigrationSteps()) > 0 {
|
||||
steps = append(steps, catalogs[0].MigrationSteps()...)
|
||||
} else {
|
||||
steps = append(steps, datasystem.Migrations()...)
|
||||
steps = append(steps, datapayment.Migrations()...)
|
||||
}
|
||||
return migration.Run(db, steps)
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ package data
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"kra/internal/platform/database/migration"
|
||||
"kra/pkg/database/migration"
|
||||
)
|
||||
|
||||
func TestMigrateAllRunsModuleSchemasWithoutBootstrapSeed(t *testing.T) {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package payment
|
||||
|
||||
import (
|
||||
"kra/internal/modules/system/adminsurface"
|
||||
"kra/internal/platform/database/migration"
|
||||
"kra/pkg/database/migration"
|
||||
platformmodule "kra/pkg/module"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -19,17 +19,17 @@ func Migrations() []migration.Step {
|
|||
// AdminSurface describes the payment-owned entries shown in the system
|
||||
// administration UI. The system module persists these records because it owns
|
||||
// the menu/API/policy tables.
|
||||
func AdminSurface() adminsurface.Surface {
|
||||
return adminsurface.Surface{
|
||||
Menus: []adminsurface.Menu{
|
||||
func AdminSurface() platformmodule.Surface {
|
||||
return platformmodule.Surface{
|
||||
Menus: []platformmodule.Menu{
|
||||
{Name: "paymentOrders", Path: "paymentOrders", ParentName: "extensions", Component: "view/systemTools/payment/orders.vue", Title: "支付订单", Icon: "wallet", Sort: 6},
|
||||
{Name: "paymentConfig", Path: "paymentConfig", ParentName: "extensions", Component: "view/systemTools/payment/config.vue", Title: "支付配置", Icon: "credit-card", Sort: 7},
|
||||
},
|
||||
APIs: []adminsurface.API{
|
||||
{Path: "/payment/configs", Method: "GET", APIGroup: "支付", Description: "获取支付渠道配置"},
|
||||
{Path: "/payment/config", Method: "POST", APIGroup: "支付", Description: "保存支付渠道配置"},
|
||||
{Path: "/payment/orders", Method: "GET", APIGroup: "支付", Description: "分页查询支付订单"},
|
||||
{Path: "/payment/order", Method: "POST", APIGroup: "支付", Description: "查询支付订单"},
|
||||
APIs: []platformmodule.API{
|
||||
{Path: "/payment/configs", Method: "GET", Group: "支付", Description: "获取支付渠道配置"},
|
||||
{Path: "/payment/config", Method: "POST", Group: "支付", Description: "保存支付渠道配置"},
|
||||
{Path: "/payment/orders", Method: "GET", Group: "支付", Description: "分页查询支付订单"},
|
||||
{Path: "/payment/order", Method: "POST", Group: "支付", Description: "查询支付订单"},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -11,8 +11,8 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
datapayment "kra/internal/modules/system/integration/payment"
|
||||
"kra/app/system/biz"
|
||||
datapayment "kra/app/system/integration/payment"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func TestSavePaymentConfigRequiresDouyinAppIDWhenEnabled(t *testing.T) {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package payment
|
||||
|
||||
import "kra/internal/modules/system/utils/paymentutil"
|
||||
import "kra/app/system/utils/paymentutil"
|
||||
|
||||
func text(values map[string]any, key string) string {
|
||||
value, _ := values[key].(string)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func TestMigrateSeedsPaymentProviders(t *testing.T) {
|
||||
|
|
@ -10,8 +10,8 @@ import (
|
|||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
)
|
||||
|
||||
type paymentOrderPO struct {
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func newPaymentOrderRepoForTest(t *testing.T) *paymentOrderRepo {
|
||||
|
|
@ -5,9 +5,9 @@ import (
|
|||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/gormkit"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/gormkit"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func TestAnnouncementRepositoryKeepsRawIDQuerySemantics(t *testing.T) {
|
||||
|
|
@ -6,8 +6,8 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"strconv"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"github.com/casbin/casbin/v3"
|
||||
casbinmodel "github.com/casbin/casbin/v3/model"
|
||||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/biz"
|
||||
)
|
||||
|
||||
func newPolicyTestData(t *testing.T) *Data {
|
||||
|
|
@ -3,7 +3,7 @@ package system
|
|||
import (
|
||||
"context"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"errors"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package system
|
||||
|
||||
import "kra/internal/modules/system/biz"
|
||||
import "kra/app/system/biz"
|
||||
|
||||
type auditQueryRepo struct{ data Provider }
|
||||
type auditRecorderRepo struct{ data Provider }
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -7,8 +7,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func TestDictionaryListPreservesPreloadCollectionShapes(t *testing.T) {
|
||||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func errorString(value string) *string { return &value }
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -7,8 +7,8 @@ import (
|
|||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/modules/system/biz"
|
||||
)
|
||||
|
||||
func TestLogViewerReadsNestedCategoryFiles(t *testing.T) {
|
||||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/internal/platform/database/pagination"
|
||||
"kra/app/system/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
)
|
||||
|
||||
func TestMediaListKeepsZeroPageSizeContract(t *testing.T) {
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"time"
|
||||
|
||||
"kra/internal/modules/system/biz"
|
||||
"kra/app/system/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue