diff --git a/bin/templates/internal/server_grpc/server_grpc_test.go_ b/bin/templates/internal/server_grpc/server_grpc_test.go_ index 82c4deb..4e000e8 100644 --- a/bin/templates/internal/server_grpc/server_grpc_test.go_ +++ b/bin/templates/internal/server_grpc/server_grpc_test.go_ @@ -2,7 +2,7 @@ package server_grpc import ( "context" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config" + "github.com/ManyakRus/starter/config" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/crud_starter" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_proto" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" diff --git a/bin/templates/internal/server_nrpc/server_nrpc_starter.go b/bin/templates/internal/server_nrpc/server_nrpc_starter.go index 5d9e4e3..9266f88 100644 --- a/bin/templates/internal/server_nrpc/server_nrpc_starter.go +++ b/bin/templates/internal/server_nrpc/server_nrpc_starter.go @@ -1,10 +1,10 @@ package server_grpc import ( + "github.com/ManyakRus/starter/contextmain" + "github.com/ManyakRus/starter/log" + "github.com/ManyakRus/starter/stopapp" "github.com/nats-io/nats.go" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/contextmain" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/log" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/stopapp" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/internal/app/grpc/server_grpc" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_proto" "os" diff --git a/bin/templates/internal/server_nrpc/server_nrpc_starter_test.go b/bin/templates/internal/server_nrpc/server_nrpc_starter_test.go index 2b3eb56..1d47b1f 100644 --- a/bin/templates/internal/server_nrpc/server_nrpc_starter_test.go +++ b/bin/templates/internal/server_nrpc/server_nrpc_starter_test.go @@ -1,7 +1,7 @@ package server_grpc import ( - config_main "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config" + config_main "github.com/ManyakRus/starter/config" "testing" ) diff --git a/bin/templates/pkg/db/db.go_ b/bin/templates/pkg/db/db.go_ index e000cd4..59dca2c 100644 --- a/bin/templates/pkg/db/db.go_ +++ b/bin/templates/pkg/db/db.go_ @@ -4,8 +4,8 @@ import ( "context" "errors" "fmt" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/micro" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/postgres_gorm" + "github.com/ManyakRus/starter/micro" + "github.com/ManyakRus/starter/postgres_gorm" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" "gorm.io/gorm" diff --git a/bin/templates/pkg/db/db_test.go_ b/bin/templates/pkg/db/db_test.go_ index a1ea400..e943429 100644 --- a/bin/templates/pkg/db/db_test.go_ +++ b/bin/templates/pkg/db/db_test.go_ @@ -1,8 +1,8 @@ package db_lawsuit_status_types import ( - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/postgres_gorm" + "github.com/ManyakRus/starter/config" + "github.com/ManyakRus/starter/postgres_gorm" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" "testing" ) diff --git a/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ b/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ index 317fb71..cf7637d 100644 --- a/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ +++ b/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ @@ -1,7 +1,7 @@ package grpc_lawsuit_status_types import ( - config "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config" + config "github.com/ManyakRus/starter/config" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_client" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" "testing" diff --git a/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ b/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ index b360493..74d2d14 100644 --- a/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ +++ b/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ @@ -1,7 +1,7 @@ package nrpc_lawsuit_status_types import ( - config "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config" + config "github.com/ManyakRus/starter/config" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/nrpc/nrpc_client" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" "testing" diff --git a/internal/config/config.go b/internal/config/config.go index 2e556e0..1bec722 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -24,9 +24,10 @@ type SettingsINI struct { TEMPLATE_FOLDERNAME_NRPC_CLIENT string TEMPLATE_SERVICE_NAME string TEMPLATE_FOLDERNAME_CRUD_STARTER string - NEED_CRUD bool - NEED_GRPC bool - NEED_NRPC bool + TEMPLATE_FOLDERNAME_ALIAS string + NEED_CREATE_CRUD bool + NEED_CREATE_GRPC bool + NEED_CREATE_NRPC bool NEED_CREATE_MODEL_STRUCT bool NEED_CREATE_MODEL_CRUD bool SERVICE_NAME string @@ -38,7 +39,6 @@ type SettingsINI struct { TEXT_DB_MODIFIED_AT string TEXT_DB_IS_DELETED string USE_DEFAULT_TEMPLATE bool - REPOSITORY_URL_ALIAS string PREFIX_SERVER_GRPC string COMMENT_MODEL_STRUCT string } @@ -64,19 +64,19 @@ func FillSettings() { Settings.TEMPLATE_SERVICE_NAME = os.Getenv("TEMPLATE_SERVICE_NAME") Settings.TEMPLATE_FOLDERNAME_CRUD_STARTER = os.Getenv("TEMPLATE_FOLDERNAME_CRUD_STARTER") Settings.SERVICE_REPOSITORY_URL = os.Getenv("SERVICE_REPOSITORY_URL") - Settings.REPOSITORY_URL_ALIAS = os.Getenv("REPOSITORY_URL_ALIAS") + Settings.TEMPLATE_FOLDERNAME_ALIAS = os.Getenv("TEMPLATE_FOLDERNAME_ALIAS") Settings.PREFIX_SERVER_GRPC = os.Getenv("PREFIX_SERVER_GRPC") sHAS_IS_DELETED := os.Getenv("HAS_IS_DELETED") - sNEED_CRUD := os.Getenv("NEED_CRUD") - Settings.NEED_CRUD = BoolFromString(sNEED_CRUD) + sNEED_CRUD := os.Getenv("NEED_CREATE_CRUD") + Settings.NEED_CREATE_CRUD = BoolFromString(sNEED_CRUD) - sNEED_GRPC := os.Getenv("NEED_GRPC") - Settings.NEED_GRPC = BoolFromString(sNEED_GRPC) + sNEED_GRPC := os.Getenv("NEED_CREATE_GRPC") + Settings.NEED_CREATE_GRPC = BoolFromString(sNEED_GRPC) - sNEED_NRPC := os.Getenv("NEED_NRPC") - Settings.NEED_NRPC = BoolFromString(sNEED_NRPC) + sNEED_NRPC := os.Getenv("NEED_CREATE_NRPC") + Settings.NEED_CREATE_NRPC = BoolFromString(sNEED_NRPC) sNEED_CREATE_MODEL_STRUCT := os.Getenv("NEED_CREATE_MODEL_STRUCT") Settings.NEED_CREATE_MODEL_STRUCT = BoolFromString(sNEED_CREATE_MODEL_STRUCT) diff --git a/internal/create_files/create_files.go b/internal/create_files/create_files.go index 548d474..35abef3 100644 --- a/internal/create_files/create_files.go +++ b/internal/create_files/create_files.go @@ -268,11 +268,11 @@ func FindTextDefaultValue(Type_go string) string { // FindURL_Alias - возвращает URL репозитория с пакетом "alias" func FindURL_Alias() string { Otvet := "" - if config.Settings.REPOSITORY_URL_ALIAS == "" { + if config.Settings.TEMPLATE_FOLDERNAME_ALIAS == "" { return Otvet } Otvet = config.Settings.SERVICE_REPOSITORY_URL + "/" - Otvet = Otvet + config.Settings.REPOSITORY_URL_ALIAS + Otvet = Otvet + config.Settings.TEMPLATE_FOLDERNAME_ALIAS return Otvet } diff --git a/internal/create_files/create_files_test.go b/internal/create_files/create_files_test.go index 2eef5f0..510d816 100644 --- a/internal/create_files/create_files_test.go +++ b/internal/create_files/create_files_test.go @@ -19,8 +19,8 @@ func TestFormatName(t *testing.T) { func TestDeleteLineWithComment(t *testing.T) { s := `import ( - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config" - "gitlab.aescorp.ru/dsp_dev/claim/nikitin/postgres_gorm" + "github.com/ManyakRus/starter/config" + "github.com/ManyakRus/starter/postgres_gorm" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types" "testing" //TestFind_ByExtID() "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants" diff --git a/internal/create_files/crud_starter/crud_starter.go b/internal/create_files/crud_starter/crud_starter.go index d6edd67..75ec545 100644 --- a/internal/create_files/crud_starter/crud_starter.go +++ b/internal/create_files/crud_starter/crud_starter.go @@ -29,7 +29,7 @@ func CreateAllFiles(MapAll map[string]*types.Table) error { func CreateFileCrudStarter(MapAll map[string]*types.Table) error { var err error - if config.Settings.NEED_CRUD == false { + if config.Settings.NEED_CREATE_CRUD == false { return err } @@ -66,13 +66,13 @@ func CreateFileCrudStarter(MapAll map[string]*types.Table) error { TextCrudStarter = TextCrudStarter + "\n" + TextDB //GRPC - if config.Settings.NEED_GRPC == true { + if config.Settings.NEED_CREATE_GRPC == true { TextGRPC := FindTextGRPC(MapAll, ModelURL) TextCrudStarter = TextCrudStarter + "\n" + TextGRPC } //NRPC - if config.Settings.NEED_NRPC == true { + if config.Settings.NEED_CREATE_NRPC == true { TextNRPC := FindTextNRPC(MapAll, ModelURL) TextCrudStarter = TextCrudStarter + "\n" + TextNRPC } diff --git a/internal/folders/folders.go b/internal/folders/folders.go index acbe122..da2ced2 100644 --- a/internal/folders/folders.go +++ b/internal/folders/folders.go @@ -93,7 +93,7 @@ func CreateAllFolders() { log.Info("CreateFolder() ", Filename) } - if config.Settings.NEED_CRUD == true { + if config.Settings.NEED_CREATE_CRUD == true { //db Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_DB ok, err = micro.FileExists(Filename) @@ -118,7 +118,7 @@ func CreateAllFolders() { } - if config.Settings.NEED_GRPC == true { + if config.Settings.NEED_CREATE_GRPC == true { //grpc Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_GRPC ok, err = micro.FileExists(Filename) @@ -164,7 +164,7 @@ func CreateAllFolders() { } } - if config.Settings.NEED_NRPC == true { + if config.Settings.NEED_CREATE_NRPC == true { //nrpc Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_NRPC ok, err = micro.FileExists(Filename)