1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-12-22 00:36:41 +02:00

сделал crud_starter_

This commit is contained in:
Nikitin Aleksandr 2024-01-23 13:36:52 +03:00
parent 4513765666
commit 69f2d66861
3 changed files with 22 additions and 2 deletions

View File

@ -41,3 +41,4 @@ const ENV_FILENAME = ".env"
const STARTER_TABLES_FILENAME = "starter_tables.go_"
const STARTER_TABLES_FILENAME_TEST = "starter_tables_test.go_"
const STARTER_TABLES_PREFIX = "crud_starter_"
const CRUD_TABLES_FREFIX = "crud_"

View File

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"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/types"
"github.com/ManyakRus/starter/log"
@ -330,6 +331,24 @@ func FindModelTableURL(TableName string) string {
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"
func FindNRPCClientURL() string {
Otvet := ""

View File

@ -139,8 +139,8 @@ func CreateTestFiles(Table1 *types.Table) error {
if config.Settings.USE_DEFAULT_TEMPLATE == true {
TextDB = create_files.DeleteTemplateRepositoryImports(TextDB)
ModelTableURL := create_files.FindModelTableURL(TableName)
TextDB = create_files.AddImport(TextDB, ModelTableURL)
CrudTableURL := create_files.FindCrudTableURL(TableName)
TextDB = create_files.AddImport(TextDB, CrudTableURL)
}