mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 05:56:38 +08:00
refactor(layout): relocate go.mod to backend/ and clean import paths to module root
- Relocated go.mod and go.sum into backend/ root directory - Stripped redundant backend/ segments from all Go imports (github.com/Rain-kl/Wavelet/...) - Unified Makefile, swagger, and build-test to execute in backend/ module context - Ensured 100% build-test, code-check, format, and swagger pass
This commit is contained in:
@@ -33,7 +33,7 @@ package order
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
)
|
||||
|
||||
//go:embed migrations/*.sql
|
||||
|
||||
@@ -84,7 +84,7 @@ import (
|
||||
"bytes"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/upload"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/model"
|
||||
"github.com/Rain-kl/Wavelet/pkg/model"
|
||||
)
|
||||
|
||||
func ingestMirrorFile(ctx context.Context, userID uint64, data []byte, hash, filename, mime, ext string) (model.Upload, error) {
|
||||
|
||||
@@ -39,8 +39,8 @@ backend/plugins/domain/order/
|
||||
package order
|
||||
|
||||
import (
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
)
|
||||
|
||||
type Plugin struct {
|
||||
|
||||
@@ -61,8 +61,8 @@ package user
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
func (p *Plugin) Apply(ctx *core.Context) error {
|
||||
|
||||
@@ -39,7 +39,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/admin/push"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/listener"
|
||||
"github.com/Rain-kl/Wavelet/pkg/listener"
|
||||
)
|
||||
|
||||
var NewUserRegistered = push.EventMetadata{
|
||||
@@ -84,7 +84,7 @@ func Register() {
|
||||
在业务逻辑完成处(如 `internal/apps/user/routers.go`)仅 import `internal/listener` 并发射事件:
|
||||
|
||||
```go
|
||||
import "github.com/Rain-kl/Wavelet/backend/pkg/listener"
|
||||
import "github.com/Rain-kl/Wavelet/pkg/listener"
|
||||
|
||||
func Register(c *gin.Context) {
|
||||
// ... 注册成功逻辑 ...
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
VERSION ?= dev
|
||||
BUILD_DATE ?= $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
MODULE := $(shell go list -m)
|
||||
MODULE := $(shell cd backend && go list -m)
|
||||
|
||||
swagger:
|
||||
scripts/swagger.sh
|
||||
@@ -15,7 +15,7 @@ license-check:
|
||||
|
||||
format:
|
||||
@echo "==> Formatting backend Go source..."
|
||||
gofmt -w $$(find . -type f -name '*.go' -not -path './.git/*' -not -path './frontend/*')
|
||||
gofmt -w $$(find backend -type f -name '*.go' -not -path './.git/*')
|
||||
@echo "==> Formatting frontend source..."
|
||||
cd frontend && pnpm format
|
||||
|
||||
@@ -27,11 +27,11 @@ build-embedded:
|
||||
pnpm build:embed
|
||||
rm -rf backend/plugins/drivers/driver_http/dist
|
||||
cp -R frontend/out backend/plugins/drivers/driver_http/dist
|
||||
go build \
|
||||
cd backend && go build \
|
||||
-tags embed_frontend \
|
||||
-ldflags "-s -w -X '$(MODULE)/backend/pkg/buildinfo.Version=$(VERSION)' -X '$(MODULE)/backend/pkg/buildinfo.BuildTime=$(BUILD_DATE)'" \
|
||||
-o bin/wavelet \
|
||||
backend/main.go
|
||||
-ldflags "-s -w -X '$(MODULE)/pkg/buildinfo.Version=$(VERSION)' -X '$(MODULE)/pkg/buildinfo.BuildTime=$(BUILD_DATE)'" \
|
||||
-o ../bin/wavelet \
|
||||
main.go
|
||||
|
||||
code-check:
|
||||
@echo "==> Architecture guards..."
|
||||
@@ -54,7 +54,7 @@ code-check:
|
||||
@echo " → plugins/domain/ must not import other plugins/domain/..."
|
||||
@for d in backend/plugins/domain/*/; do \
|
||||
name=$$(basename $$d); \
|
||||
imports=$$(rg -n '"github.com/Rain-kl/Wavelet/backend/plugins/domain/' backend/plugins/domain/"$$name" -g '*.go' 2>/dev/null | rg -v "backend/plugins/domain/$$name/" | rg -v '_test.go' || true); \
|
||||
imports=$$(rg -n '"$(MODULE)/plugins/domain/' backend/plugins/domain/"$$name" -g '*.go' 2>/dev/null | rg -v "backend/plugins/domain/$$name/" | rg -v '_test.go' || true); \
|
||||
if [ -n "$$imports" ]; then \
|
||||
echo "error: backend/plugins/domain/$$name must not import other domain plugins" >&2; \
|
||||
echo "$$imports" >&2; \
|
||||
@@ -62,15 +62,15 @@ code-check:
|
||||
fi; \
|
||||
done
|
||||
@echo " → Architecture guards PASS"
|
||||
golangci-lint run ./backend/...
|
||||
cd backend && golangci-lint run
|
||||
cd frontend && pnpm tsc --noEmit --jsx preserve && npx eslint . --max-warnings 0
|
||||
|
||||
build-backend:
|
||||
@echo "==> Building backend version=$(VERSION) build_date=$(BUILD_DATE)..."
|
||||
go build \
|
||||
-ldflags "-s -w -X '$(MODULE)/backend/pkg/buildinfo.Version=$(VERSION)' -X '$(MODULE)/backend/pkg/buildinfo.BuildTime=$(BUILD_DATE)'" \
|
||||
-o bin/wavelet \
|
||||
backend/main.go
|
||||
cd backend && go build \
|
||||
-ldflags "-s -w -X '$(MODULE)/pkg/buildinfo.Version=$(VERSION)' -X '$(MODULE)/pkg/buildinfo.BuildTime=$(BUILD_DATE)'" \
|
||||
-o ../bin/wavelet \
|
||||
main.go
|
||||
|
||||
build-frontend:
|
||||
@echo "==> Building frontend version=$(VERSION) build_date=$(BUILD_DATE)..."
|
||||
@@ -84,7 +84,7 @@ build-test:
|
||||
@PIDS=""; \
|
||||
STATUS=0; \
|
||||
( cd frontend && pnpm build:embed 2>&1 | sed 's/^/[frontend] /' ) & PIDS="$$PIDS $$!"; \
|
||||
( go test ./... && go build -o /dev/null ./... 2>&1 | sed 's/^/[backend] /' ) & PIDS="$$PIDS $$!"; \
|
||||
( cd backend && go test ./... && go build -o /dev/null ./... 2>&1 | sed 's/^/[backend] /' ) & PIDS="$$PIDS $$!"; \
|
||||
for PID in $$PIDS; do \
|
||||
wait $$PID || STATUS=1; \
|
||||
done; \
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
+18
-18
@@ -10,24 +10,24 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/admin"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/cap"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/system"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/upload"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_cron"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_worker"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_http"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
infradb "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/storage"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/admin"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/cap"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/system"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/upload"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_cron"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_http"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
infradb "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/logger"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/storage"
|
||||
"github.com/pressly/goose/v3"
|
||||
goosedb "github.com/pressly/goose/v3/database"
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
)
|
||||
|
||||
func TestNewWaveletAppProfiles(t *testing.T) {
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
)
|
||||
|
||||
//nolint:unused // startup banner formatting utilities
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
)
|
||||
|
||||
func TestFormatStartupBanner(t *testing.T) {
|
||||
|
||||
@@ -13,10 +13,10 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
userdomain "github.com/Rain-kl/Wavelet/backend/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
userdomain "github.com/Rain-kl/Wavelet/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
"github.com/spf13/cobra"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/testhelper"
|
||||
userdomain "github.com/Rain-kl/Wavelet/backend/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/pkg/testhelper"
|
||||
userdomain "github.com/Rain-kl/Wavelet/plugins/domain/user"
|
||||
)
|
||||
|
||||
func TestResetPasswdCmd_WithUserAndPassword(t *testing.T) {
|
||||
|
||||
+4
-4
@@ -9,10 +9,10 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/trace"
|
||||
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/trace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ package cmd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
// appMockDriver is a test driver tracking its start/stop lifecycle.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
// Context is the central micro-kernel service bus and runtime lifecycle container.
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
)
|
||||
|
||||
// Sample services for testing
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
)
|
||||
|
||||
type UserRegisteredEvent struct {
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
func TestRouterExtension(t *testing.T) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
// Standard sentinel errors returned by core operations.
|
||||
|
||||
@@ -8,8 +8,8 @@ package custom_example
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Package main 是 Wavelet 平台的程序入口
|
||||
package main
|
||||
|
||||
import "github.com/Rain-kl/Wavelet/backend/cmd"
|
||||
import "github.com/Rain-kl/Wavelet/cmd"
|
||||
|
||||
// @title Wavelet API
|
||||
// @version 1.0.0
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/bwmarrin/snowflake"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package testhelper
|
||||
|
||||
import (
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
"github.com/glebarez/sqlite"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/httppool"
|
||||
"github.com/Rain-kl/Wavelet/pkg/httppool"
|
||||
)
|
||||
|
||||
// IsLocalhost 检查 URL 是否为 localhost
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/storage/diskcache"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/storage/diskcache"
|
||||
)
|
||||
|
||||
type updateCacheConfigRequest struct {
|
||||
|
||||
@@ -13,13 +13,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
mail "github.com/Rain-kl/Wavelet/backend/pkg/mail"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/cap"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/storage/objectstore"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
mail "github.com/Rain-kl/Wavelet/pkg/mail"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/cap"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/storage/objectstore"
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -19,9 +19,9 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -15,14 +15,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control/logstore"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_worker"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control/logstore"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control/logstore"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control/logstore"
|
||||
)
|
||||
|
||||
var startTime = time.Now()
|
||||
|
||||
@@ -14,10 +14,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/robfig/cron/v3"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_cron"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_worker"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_cron"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
|
||||
)
|
||||
|
||||
// ListTaskTypes 获取支持的任务类型列表
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
)
|
||||
|
||||
// CreateTemplateRequest 创建模板请求
|
||||
|
||||
@@ -24,10 +24,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"golang.org/x/mod/semver"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -15,13 +15,13 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const minPasswordLength = 8
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/trace"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/trace"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"context"
|
||||
"embed"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/hibiken/asynq"
|
||||
)
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/admin"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/admin"
|
||||
)
|
||||
|
||||
func TestAdminPluginUnit(t *testing.T) {
|
||||
|
||||
@@ -16,11 +16,11 @@ import (
|
||||
"github.com/shopspring/decimal"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/cache/ram"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/cache/ram"
|
||||
"github.com/Rain-kl/Wavelet/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
)
|
||||
|
||||
const installedBinaryMode = 0o755
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/cache/ram"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
"github.com/Rain-kl/Wavelet/pkg/cache/ram"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/redis/go-redis/v9/maintnotifications"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
func setupSystemConfigTest(t *testing.T) (*gorm.DB, func()) {
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
|
||||
"github.com/coreos/go-oidc/v3/oidc"
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/cache/ram"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/cache/ram"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/redis/go-redis/v9/maintnotifications"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
)
|
||||
|
||||
func setupOauthCacheTest(t *testing.T) (*miniredis.Miniredis, func()) {
|
||||
|
||||
@@ -13,14 +13,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/coreos/go-oidc/v3/oidc"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/trace"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/trace"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
)
|
||||
|
||||
var authSourceNamePattern = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$`)
|
||||
|
||||
@@ -7,9 +7,9 @@ package auth
|
||||
import (
|
||||
"embed"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
//go:embed migrations/*.sql
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
type testUser struct {
|
||||
|
||||
@@ -7,7 +7,7 @@ package auth
|
||||
import (
|
||||
"context"
|
||||
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
// GetAuthSourceByID 根据 ID 获取认证源
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/google/uuid"
|
||||
|
||||
@@ -6,9 +6,9 @@ package cap
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/cap/pow"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/cap/pow"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/cap/pow"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/cap/pow"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -6,7 +6,7 @@ package cap
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
)
|
||||
|
||||
// VerifyMiddleware returns a Gin middleware that checks and consumes the X-Cap-Token header.
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package cap
|
||||
|
||||
import (
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
)
|
||||
|
||||
// Plugin implements core.Plugin to provide CAPTCHA generation, validation, and route protection.
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
|
||||
"golang.org/x/sync/singleflight"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
database "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
database "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -16,17 +16,17 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/admin"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/infra/storage"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/admin"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/user"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/logger"
|
||||
"github.com/Rain-kl/Wavelet/plugins/infra/storage"
|
||||
)
|
||||
|
||||
func setupTestDB(t *testing.T) *gorm.DB {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
"github.com/tencent-connect/botgo"
|
||||
"github.com/tencent-connect/botgo/dto"
|
||||
"github.com/tencent-connect/botgo/event"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
)
|
||||
|
||||
func TestHandleEvent_DropsNonC2C(t *testing.T) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
tele "gopkg.in/telebot.v4"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
tele "gopkg.in/telebot.v4"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
)
|
||||
|
||||
// AdminLogin is the metadata definition for the admin login event.
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/testhelper"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/pkg/testhelper"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
)
|
||||
|
||||
func TestUpsertPairingCode_ReusesUnexpired(t *testing.T) {
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"context"
|
||||
"embed"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/core/extpoints"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/core/extpoints"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/hibiken/asynq"
|
||||
)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway"
|
||||
"github.com/Rain-kl/Wavelet/core"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
|
||||
)
|
||||
|
||||
func TestMessageGatewayPluginUnit(t *testing.T) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/httppool"
|
||||
"github.com/Rain-kl/Wavelet/pkg/httppool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"net/smtp"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/httppool"
|
||||
"github.com/Rain-kl/Wavelet/pkg/httppool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/httppool"
|
||||
"github.com/Rain-kl/Wavelet/pkg/httppool"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway/push"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -9,11 +9,11 @@ import (
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
|
||||
pkgpush "github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway/push"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
pkgpush "github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway/push"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway/push"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_worker"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_worker"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
|
||||
)
|
||||
|
||||
// RegisterTaskListeners subscribes push notification handlers to task completion events.
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/message_gateway/push"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/drivers/driver_asynq_worker"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
|
||||
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/idgen"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/backend/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/idgen"
|
||||
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
)
|
||||
|
||||
// Runner manages lifecycle for long-lived channel adapters (WebSocket, long-polling, etc.).
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
)
|
||||
|
||||
// CredentialKey is AES-256 hex derived from the session secret.
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/batchwriter"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control/logstore"
|
||||
"github.com/Rain-kl/Wavelet/pkg/batchwriter"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control/logstore"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const hoursInDay = 24
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"gorm.io/gorm"
|
||||
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
func setupChGormDB(t *testing.T) *gorm.DB {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
// BatchInsert writes access logs to ClickHouse using the native batch API.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ClickHouse/clickhouse-go/v2/lib/driver"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
type clickhouseUserAccessLogStore struct {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/pkg/idgen"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@ import (
|
||||
// plugins/domain 不得直接 import 已废弃的 internal。
|
||||
var forbiddenImports = []string{
|
||||
"github.com/Rain-kl/Wavelet/internal",
|
||||
"github.com/Rain-kl/Wavelet/backend/internal",
|
||||
"github.com/Rain-kl/Wavelet/internal",
|
||||
}
|
||||
|
||||
func TestAppsMustNotImportPersistenceDirectly(t *testing.T) {
|
||||
t.Chdir("../../../../..")
|
||||
out, err := exec.Command("go", "list", "-test", "-f", `{{.ImportPath}} {{join .Imports " "}}`, "./backend/plugins/domain/...").Output()
|
||||
t.Chdir("../../../..")
|
||||
out, err := exec.Command("go", "list", "-test", "-f", `{{.ImportPath}} {{join .Imports " "}}`, "./plugins/domain/...").Output()
|
||||
if err != nil {
|
||||
t.Fatalf("go list: %v", err)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ func TestAppsMustNotImportPersistenceDirectly(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
pkg := fields[0]
|
||||
if !strings.HasPrefix(pkg, "github.com/Rain-kl/Wavelet/backend/plugins/domain") {
|
||||
if !strings.HasPrefix(pkg, "github.com/Rain-kl/Wavelet/plugins/domain") {
|
||||
continue
|
||||
}
|
||||
for _, imp := range fields[1:] {
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/logger"
|
||||
db "github.com/Rain-kl/Wavelet/backend/plugins/infra/database"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/logger"
|
||||
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/backend/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/backend/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/backend/plugins/domain/risk_control/logstore"
|
||||
"github.com/Rain-kl/Wavelet/core/contracts"
|
||||
"github.com/Rain-kl/Wavelet/pkg/config"
|
||||
"github.com/Rain-kl/Wavelet/pkg/idgen"
|
||||
"github.com/Rain-kl/Wavelet/pkg/response"
|
||||
"github.com/Rain-kl/Wavelet/pkg/util"
|
||||
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control/logstore"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user