mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-01-17 08:56:48 +02:00
сделал github.com/ManyakRus/starter/
This commit is contained in:
parent
7cb07d4d5a
commit
4f0a800b67
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
)
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
)
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user