mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-03-11 14:59:21 +02:00
сделал crud_starter_
This commit is contained in:
parent
4513765666
commit
69f2d66861
@ -41,3 +41,4 @@ const ENV_FILENAME = ".env"
|
|||||||
const STARTER_TABLES_FILENAME = "starter_tables.go_"
|
const STARTER_TABLES_FILENAME = "starter_tables.go_"
|
||||||
const STARTER_TABLES_FILENAME_TEST = "starter_tables_test.go_"
|
const STARTER_TABLES_FILENAME_TEST = "starter_tables_test.go_"
|
||||||
const STARTER_TABLES_PREFIX = "crud_starter_"
|
const STARTER_TABLES_PREFIX = "crud_starter_"
|
||||||
|
const CRUD_TABLES_FREFIX = "crud_"
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/ManyakRus/crud_generator/internal/config"
|
"github.com/ManyakRus/crud_generator/internal/config"
|
||||||
|
"github.com/ManyakRus/crud_generator/internal/constants"
|
||||||
"github.com/ManyakRus/crud_generator/internal/mini_func"
|
"github.com/ManyakRus/crud_generator/internal/mini_func"
|
||||||
"github.com/ManyakRus/crud_generator/internal/types"
|
"github.com/ManyakRus/crud_generator/internal/types"
|
||||||
"github.com/ManyakRus/starter/log"
|
"github.com/ManyakRus/starter/log"
|
||||||
@ -330,6 +331,24 @@ func FindModelTableURL(TableName string) string {
|
|||||||
return Otvet
|
return Otvet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FindCrudStarterTableURL - возвращает URL репозитория crud_starter для таблицы TableName
|
||||||
|
func FindCrudStarterTableURL(TableName string) string {
|
||||||
|
Otvet := ""
|
||||||
|
|
||||||
|
Otvet = config.Settings.SERVICE_REPOSITORY_URL + "/" + config.Settings.TEMPLATE_FOLDERNAME_CRUD_STARTER + "/" + constants.STARTER_TABLES_PREFIX + TableName
|
||||||
|
|
||||||
|
return Otvet
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindCrudTableURL - возвращает URL репозитория crud для таблицы TableName
|
||||||
|
func FindCrudTableURL(TableName string) string {
|
||||||
|
Otvet := ""
|
||||||
|
|
||||||
|
Otvet = config.Settings.SERVICE_REPOSITORY_URL + "/" + config.Settings.TEMPLATE_FOLDERNAME_CRUD + "/" + constants.CRUD_TABLES_FREFIX + TableName
|
||||||
|
|
||||||
|
return Otvet
|
||||||
|
}
|
||||||
|
|
||||||
// FindNRPCClientURL - возвращает URL репозитория с пакетом "nrpc_client"
|
// FindNRPCClientURL - возвращает URL репозитория с пакетом "nrpc_client"
|
||||||
func FindNRPCClientURL() string {
|
func FindNRPCClientURL() string {
|
||||||
Otvet := ""
|
Otvet := ""
|
||||||
|
@ -139,8 +139,8 @@ func CreateTestFiles(Table1 *types.Table) error {
|
|||||||
if config.Settings.USE_DEFAULT_TEMPLATE == true {
|
if config.Settings.USE_DEFAULT_TEMPLATE == true {
|
||||||
TextDB = create_files.DeleteTemplateRepositoryImports(TextDB)
|
TextDB = create_files.DeleteTemplateRepositoryImports(TextDB)
|
||||||
|
|
||||||
ModelTableURL := create_files.FindModelTableURL(TableName)
|
CrudTableURL := create_files.FindCrudTableURL(TableName)
|
||||||
TextDB = create_files.AddImport(TextDB, ModelTableURL)
|
TextDB = create_files.AddImport(TextDB, CrudTableURL)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user