mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-01-29 09:47:16 +02:00
сделал github.com/ManyakRus/starter/
This commit is contained in:
parent
7cb07d4d5a
commit
4f0a800b67
@ -2,7 +2,7 @@ package server_grpc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"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/crud_starter"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_proto"
|
"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"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package server_grpc
|
package server_grpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/ManyakRus/starter/contextmain"
|
||||||
|
"github.com/ManyakRus/starter/log"
|
||||||
|
"github.com/ManyakRus/starter/stopapp"
|
||||||
"github.com/nats-io/nats.go"
|
"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/internal/app/grpc/server_grpc"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_proto"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_proto"
|
||||||
"os"
|
"os"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package server_grpc
|
package server_grpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
config_main "gitlab.aescorp.ru/dsp_dev/claim/nikitin/config"
|
config_main "github.com/ManyakRus/starter/config"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/nikitin/micro"
|
"github.com/ManyakRus/starter/micro"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/nikitin/postgres_gorm"
|
"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/db/constants"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package db_lawsuit_status_types
|
package db_lawsuit_status_types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/nikitin/config"
|
"github.com/ManyakRus/starter/config"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/nikitin/postgres_gorm"
|
"github.com/ManyakRus/starter/postgres_gorm"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package grpc_lawsuit_status_types
|
package grpc_lawsuit_status_types
|
||||||
|
|
||||||
import (
|
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/network/grpc/grpc_client"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package nrpc_lawsuit_status_types
|
package nrpc_lawsuit_status_types
|
||||||
|
|
||||||
import (
|
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/network/nrpc/nrpc_client"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -24,9 +24,10 @@ type SettingsINI struct {
|
|||||||
TEMPLATE_FOLDERNAME_NRPC_CLIENT string
|
TEMPLATE_FOLDERNAME_NRPC_CLIENT string
|
||||||
TEMPLATE_SERVICE_NAME string
|
TEMPLATE_SERVICE_NAME string
|
||||||
TEMPLATE_FOLDERNAME_CRUD_STARTER string
|
TEMPLATE_FOLDERNAME_CRUD_STARTER string
|
||||||
NEED_CRUD bool
|
TEMPLATE_FOLDERNAME_ALIAS string
|
||||||
NEED_GRPC bool
|
NEED_CREATE_CRUD bool
|
||||||
NEED_NRPC bool
|
NEED_CREATE_GRPC bool
|
||||||
|
NEED_CREATE_NRPC bool
|
||||||
NEED_CREATE_MODEL_STRUCT bool
|
NEED_CREATE_MODEL_STRUCT bool
|
||||||
NEED_CREATE_MODEL_CRUD bool
|
NEED_CREATE_MODEL_CRUD bool
|
||||||
SERVICE_NAME string
|
SERVICE_NAME string
|
||||||
@ -38,7 +39,6 @@ type SettingsINI struct {
|
|||||||
TEXT_DB_MODIFIED_AT string
|
TEXT_DB_MODIFIED_AT string
|
||||||
TEXT_DB_IS_DELETED string
|
TEXT_DB_IS_DELETED string
|
||||||
USE_DEFAULT_TEMPLATE bool
|
USE_DEFAULT_TEMPLATE bool
|
||||||
REPOSITORY_URL_ALIAS string
|
|
||||||
PREFIX_SERVER_GRPC string
|
PREFIX_SERVER_GRPC string
|
||||||
COMMENT_MODEL_STRUCT string
|
COMMENT_MODEL_STRUCT string
|
||||||
}
|
}
|
||||||
@ -64,19 +64,19 @@ func FillSettings() {
|
|||||||
Settings.TEMPLATE_SERVICE_NAME = os.Getenv("TEMPLATE_SERVICE_NAME")
|
Settings.TEMPLATE_SERVICE_NAME = os.Getenv("TEMPLATE_SERVICE_NAME")
|
||||||
Settings.TEMPLATE_FOLDERNAME_CRUD_STARTER = os.Getenv("TEMPLATE_FOLDERNAME_CRUD_STARTER")
|
Settings.TEMPLATE_FOLDERNAME_CRUD_STARTER = os.Getenv("TEMPLATE_FOLDERNAME_CRUD_STARTER")
|
||||||
Settings.SERVICE_REPOSITORY_URL = os.Getenv("SERVICE_REPOSITORY_URL")
|
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")
|
Settings.PREFIX_SERVER_GRPC = os.Getenv("PREFIX_SERVER_GRPC")
|
||||||
|
|
||||||
sHAS_IS_DELETED := os.Getenv("HAS_IS_DELETED")
|
sHAS_IS_DELETED := os.Getenv("HAS_IS_DELETED")
|
||||||
|
|
||||||
sNEED_CRUD := os.Getenv("NEED_CRUD")
|
sNEED_CRUD := os.Getenv("NEED_CREATE_CRUD")
|
||||||
Settings.NEED_CRUD = BoolFromString(sNEED_CRUD)
|
Settings.NEED_CREATE_CRUD = BoolFromString(sNEED_CRUD)
|
||||||
|
|
||||||
sNEED_GRPC := os.Getenv("NEED_GRPC")
|
sNEED_GRPC := os.Getenv("NEED_CREATE_GRPC")
|
||||||
Settings.NEED_GRPC = BoolFromString(sNEED_GRPC)
|
Settings.NEED_CREATE_GRPC = BoolFromString(sNEED_GRPC)
|
||||||
|
|
||||||
sNEED_NRPC := os.Getenv("NEED_NRPC")
|
sNEED_NRPC := os.Getenv("NEED_CREATE_NRPC")
|
||||||
Settings.NEED_NRPC = BoolFromString(sNEED_NRPC)
|
Settings.NEED_CREATE_NRPC = BoolFromString(sNEED_NRPC)
|
||||||
|
|
||||||
sNEED_CREATE_MODEL_STRUCT := os.Getenv("NEED_CREATE_MODEL_STRUCT")
|
sNEED_CREATE_MODEL_STRUCT := os.Getenv("NEED_CREATE_MODEL_STRUCT")
|
||||||
Settings.NEED_CREATE_MODEL_STRUCT = BoolFromString(sNEED_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"
|
// FindURL_Alias - возвращает URL репозитория с пакетом "alias"
|
||||||
func FindURL_Alias() string {
|
func FindURL_Alias() string {
|
||||||
Otvet := ""
|
Otvet := ""
|
||||||
if config.Settings.REPOSITORY_URL_ALIAS == "" {
|
if config.Settings.TEMPLATE_FOLDERNAME_ALIAS == "" {
|
||||||
return Otvet
|
return Otvet
|
||||||
}
|
}
|
||||||
Otvet = config.Settings.SERVICE_REPOSITORY_URL + "/"
|
Otvet = config.Settings.SERVICE_REPOSITORY_URL + "/"
|
||||||
Otvet = Otvet + config.Settings.REPOSITORY_URL_ALIAS
|
Otvet = Otvet + config.Settings.TEMPLATE_FOLDERNAME_ALIAS
|
||||||
|
|
||||||
return Otvet
|
return Otvet
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ func TestFormatName(t *testing.T) {
|
|||||||
|
|
||||||
func TestDeleteLineWithComment(t *testing.T) {
|
func TestDeleteLineWithComment(t *testing.T) {
|
||||||
s := `import (
|
s := `import (
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/nikitin/config"
|
"github.com/ManyakRus/starter/config"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/nikitin/postgres_gorm"
|
"github.com/ManyakRus/starter/postgres_gorm"
|
||||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||||
"testing"
|
"testing"
|
||||||
//TestFind_ByExtID() "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants"
|
//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 {
|
func CreateFileCrudStarter(MapAll map[string]*types.Table) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if config.Settings.NEED_CRUD == false {
|
if config.Settings.NEED_CREATE_CRUD == false {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,13 +66,13 @@ func CreateFileCrudStarter(MapAll map[string]*types.Table) error {
|
|||||||
TextCrudStarter = TextCrudStarter + "\n" + TextDB
|
TextCrudStarter = TextCrudStarter + "\n" + TextDB
|
||||||
|
|
||||||
//GRPC
|
//GRPC
|
||||||
if config.Settings.NEED_GRPC == true {
|
if config.Settings.NEED_CREATE_GRPC == true {
|
||||||
TextGRPC := FindTextGRPC(MapAll, ModelURL)
|
TextGRPC := FindTextGRPC(MapAll, ModelURL)
|
||||||
TextCrudStarter = TextCrudStarter + "\n" + TextGRPC
|
TextCrudStarter = TextCrudStarter + "\n" + TextGRPC
|
||||||
}
|
}
|
||||||
|
|
||||||
//NRPC
|
//NRPC
|
||||||
if config.Settings.NEED_NRPC == true {
|
if config.Settings.NEED_CREATE_NRPC == true {
|
||||||
TextNRPC := FindTextNRPC(MapAll, ModelURL)
|
TextNRPC := FindTextNRPC(MapAll, ModelURL)
|
||||||
TextCrudStarter = TextCrudStarter + "\n" + TextNRPC
|
TextCrudStarter = TextCrudStarter + "\n" + TextNRPC
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ func CreateAllFolders() {
|
|||||||
log.Info("CreateFolder() ", Filename)
|
log.Info("CreateFolder() ", Filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.Settings.NEED_CRUD == true {
|
if config.Settings.NEED_CREATE_CRUD == true {
|
||||||
//db
|
//db
|
||||||
Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_DB
|
Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_DB
|
||||||
ok, err = micro.FileExists(Filename)
|
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
|
//grpc
|
||||||
Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_GRPC
|
Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_GRPC
|
||||||
ok, err = micro.FileExists(Filename)
|
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
|
//nrpc
|
||||||
Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_NRPC
|
Filename = dir + config.Settings.SERVICE_NAME + micro.SeparatorFile() + config.Settings.TEMPLATE_FOLDERNAME_NRPC
|
||||||
ok, err = micro.FileExists(Filename)
|
ok, err = micro.FileExists(Filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user