优化结构
This commit is contained in:
parent
746e33e027
commit
361a562f75
3
Makefile
3
Makefile
|
|
@ -26,7 +26,7 @@ build:
|
|||
.PHONY: generate
|
||||
# generate
|
||||
generate:
|
||||
go generate ./...
|
||||
go generate ./app/system/cmd
|
||||
go mod tidy
|
||||
|
||||
.PHONY: all
|
||||
|
|
@ -54,3 +54,4 @@ help:
|
|||
{ lastLine = $$0 }' $(MAKEFILE_LIST)
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"kra/app/system/dto"
|
||||
"kra/app/system/service"
|
||||
"kra/app/system/worker"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/logging"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/app/system/internal/dto"
|
||||
"kra/app/system/internal/service"
|
||||
"kra/app/system/internal/worker"
|
||||
"kra/pkg/logging"
|
||||
|
||||
"github.com/go-kratos/kratos/v3"
|
||||
"github.com/go-kratos/kratos/v3/config"
|
||||
|
|
@ -37,7 +37,7 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml")
|
||||
flag.StringVar(&flagconf, "conf", "../configs", "config path, eg: -conf config.yaml")
|
||||
}
|
||||
|
||||
func newApp(logger *slog.Logger, hs *kratoshttp.Server, scheduler *worker.TaskScheduler, audit *service.AuditRecorder, loggerControl *logging.ReloadableLogger) *kratos.App {
|
||||
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
)
|
||||
|
||||
func TestSwaggerAddress(t *testing.T) {
|
||||
|
|
@ -8,17 +8,17 @@ package main
|
|||
import (
|
||||
"log/slog"
|
||||
|
||||
"kra/app/admin"
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/data"
|
||||
"kra/app/system/initialize"
|
||||
"kra/app/system/integration"
|
||||
"kra/app/system/integration/cache"
|
||||
"kra/app/system/service"
|
||||
"kra/app/system/transport/server"
|
||||
"kra/app/system/worker"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/logging"
|
||||
"kra/app/system/internal/app"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/app/system/internal/data"
|
||||
"kra/app/system/internal/initialize"
|
||||
"kra/app/system/internal/integration"
|
||||
"kra/app/system/internal/integration/cache"
|
||||
"kra/app/system/internal/server"
|
||||
"kra/app/system/internal/service"
|
||||
"kra/app/system/internal/worker"
|
||||
"kra/pkg/logging"
|
||||
platformtask "kra/pkg/task"
|
||||
|
||||
"github.com/go-kratos/kratos/v3"
|
||||
|
|
@ -8,21 +8,21 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/go-kratos/kratos/v3"
|
||||
"kra/app/admin"
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/data"
|
||||
"kra/app/system/data/payment"
|
||||
"kra/app/system/data/repository"
|
||||
"kra/app/system/initialize"
|
||||
"kra/app/system/integration/cache"
|
||||
"kra/app/system/integration/email"
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/app/system/service"
|
||||
"kra/app/system/transport/handler"
|
||||
"kra/app/system/transport/server"
|
||||
"kra/app/system/worker"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/logging"
|
||||
"kra/app/system/internal/app"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/app/system/internal/data"
|
||||
"kra/app/system/internal/data/payment"
|
||||
"kra/app/system/internal/data/repository"
|
||||
"kra/app/system/internal/initialize"
|
||||
"kra/app/system/internal/integration/cache"
|
||||
"kra/app/system/internal/integration/email"
|
||||
"kra/app/system/internal/integration/storage"
|
||||
"kra/app/system/internal/server"
|
||||
"kra/app/system/internal/service"
|
||||
"kra/app/system/internal/transport/handler"
|
||||
"kra/app/system/internal/worker"
|
||||
"kra/pkg/logging"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
|
|
@ -4,9 +4,9 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
systemmodule "kra/app/system"
|
||||
systemserver "kra/app/system/transport/server"
|
||||
systemworker "kra/app/system/worker"
|
||||
systemmodule "kra/app/system/internal/module"
|
||||
systemserver "kra/app/system/internal/server"
|
||||
systemworker "kra/app/system/internal/worker"
|
||||
"kra/pkg/module"
|
||||
platformtask "kra/pkg/task"
|
||||
)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.12
|
||||
// protoc v7.35.1
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: conf/conf.proto
|
||||
|
||||
package conf
|
||||
|
|
@ -2213,7 +2213,7 @@ const file_conf_conf_proto_rawDesc = "" +
|
|||
"\x10force_path_style\x18\t \x01(\bR\x0eforcePathStyle\x12\x1d\n" +
|
||||
"\n" +
|
||||
"account_id\x18\n" +
|
||||
" \x01(\tR\taccountIdB\x18Z\x16kra/internal/conf;confb\x06proto3"
|
||||
" \x01(\tR\taccountIdB#Z!kra/app/system/internal/conf;confb\x06proto3"
|
||||
|
||||
var (
|
||||
file_conf_conf_proto_rawDescOnce sync.Once
|
||||
|
|
@ -3,7 +3,7 @@ package kratos.api;
|
|||
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
option go_package = "kra/internal/conf;conf";
|
||||
option go_package = "kra/app/system/internal/conf;conf";
|
||||
|
||||
message Bootstrap {
|
||||
Server server = 1;
|
||||
|
|
@ -215,3 +215,4 @@ message AdminBackend {
|
|||
string account_id = 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package data
|
||||
|
||||
import (
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
|
@ -9,8 +9,8 @@ import (
|
|||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/app/system/internal/integration/storage"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
|
@ -11,10 +11,10 @@ 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"
|
||||
"kra/app/system/internal/conf"
|
||||
datapayment "kra/app/system/internal/data/payment"
|
||||
datasystem "kra/app/system/internal/data/repository"
|
||||
"kra/app/system/internal/integration/storage"
|
||||
"kra/pkg/module"
|
||||
)
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -19,7 +19,7 @@ import (
|
|||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/schema"
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/pkg/database/gormkit"
|
||||
)
|
||||
|
||||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"kra/internal/logging"
|
||||
"kra/pkg/database/gormkit"
|
||||
"kra/pkg/logging"
|
||||
|
||||
"gorm.io/gorm/logger"
|
||||
)
|
||||
|
|
@ -5,9 +5,9 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/app/system/internal/integration/storage"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
|
@ -7,8 +7,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/integration/storage"
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
"kra/app/system/internal/integration/storage"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package data
|
||||
|
||||
import (
|
||||
datapayment "kra/app/system/data/payment"
|
||||
datasystem "kra/app/system/data/repository"
|
||||
datapayment "kra/app/system/internal/data/payment"
|
||||
datasystem "kra/app/system/internal/data/repository"
|
||||
"kra/pkg/database/migration"
|
||||
"kra/pkg/module"
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/conf"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
|
|
@ -11,8 +11,8 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"kra/app/system/biz"
|
||||
datapayment "kra/app/system/integration/payment"
|
||||
"kra/app/system/internal/biz"
|
||||
datapayment "kra/app/system/internal/integration/payment"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
func TestSavePaymentConfigRequiresDouyinAppIDWhenEnabled(t *testing.T) {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package payment
|
||||
|
||||
import "kra/app/system/utils/paymentutil"
|
||||
import "kra/app/system/internal/utils/paymentutil"
|
||||
|
||||
func text(values map[string]any, key string) string {
|
||||
value, _ := values[key].(string)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
func TestMigrateSeedsPaymentProviders(t *testing.T) {
|
||||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
)
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
func newPaymentOrderRepoForTest(t *testing.T) *paymentOrderRepo {
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/gormkit"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
func TestAnnouncementRepositoryKeepsRawIDQuerySemantics(t *testing.T) {
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"strconv"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/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/app/system/internal/biz"
|
||||
"kra/app/system/internal/conf"
|
||||
)
|
||||
|
||||
func newPolicyTestData(t *testing.T) *Data {
|
||||
|
|
@ -3,7 +3,7 @@ package system
|
|||
import (
|
||||
"context"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"errors"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package system
|
||||
|
||||
import "kra/app/system/biz"
|
||||
import "kra/app/system/internal/biz"
|
||||
|
||||
type auditQueryRepo struct{ data Provider }
|
||||
type auditRecorderRepo struct{ data Provider }
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/internal/conf"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/app/system/internal/conf"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
func TestDictionaryListPreservesPreloadCollectionShapes(t *testing.T) {
|
||||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"kra/pkg/database/pagination"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
func errorString(value string) *string { return &value }
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/app/system/biz"
|
||||
"kra/app/system/internal/biz"
|
||||
)
|
||||
|
||||
const (
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue