1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2025-01-07 13:39:43 +02:00

сделал CreateFilesUpdateEveryColumn()

This commit is contained in:
Nikitin Aleksandr 2024-02-14 16:16:25 +03:00
parent 92a0e6d71f
commit 17ff7e25c7
3 changed files with 40 additions and 37 deletions

View File

@ -495,7 +495,7 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
`
//заменим импорты
//if config.Settings.USE_DEFAULT_TEMPLATE == true {
if config.Settings.USE_DEFAULT_TEMPLATE == true {
DBConstantsURL := create_files.FindDBConstantsURL()
TextCrud = create_files.AddImport(TextCrud, DBConstantsURL)
@ -503,7 +503,7 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
TextCrud = create_files.AddImport(TextCrud, ModelTableURL)
//TextCrud = create_files.ConvertIdToAlias(TextCrud, Table1)
//}
}
//создание текста
TextUpdateEveryColumn := FindTextUpdateEveryColumn(TextCrudUpdateFunc, Table1)

View File

@ -389,7 +389,7 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
`
//заменим импорты
//if config.Settings.USE_DEFAULT_TEMPLATE == true {
if config.Settings.USE_DEFAULT_TEMPLATE == true {
ProtoURL := create_files.FindProtoURL()
TextGRPC_Client = create_files.AddImport(TextGRPC_Client, ProtoURL)
@ -409,7 +409,7 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
TextGRPC_Client = create_files.AddImport(TextGRPC_Client, ModelTableURL)
//TextGRPC_Client = create_files.ConvertIdToAlias(TextGRPC_Client, Table1)
//}
}
//создание текста
TextUpdateEveryColumn := FindTextUpdateEveryColumn(TextGRPC_ClientUpdateFunc, Table1)
@ -428,9 +428,11 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
//удаление пустого импорта
TextGRPC_Client = create_files.DeleteEmptyImport(TextGRPC_Client)
TextGRPC_Client = create_files.DeleteEmptyLines(TextGRPC_Client)
if config.Settings.USE_DEFAULT_TEMPLATE == true {
TextGRPC_Client = create_files.CheckAndAddImportTime_FromText(TextGRPC_Client)
TextGRPC_Client = create_files.CheckAndAddImportTimestamp_FromText(TextGRPC_Client)
TextGRPC_Client = create_files.CheckAndAddImportAlias(TextGRPC_Client)
}
//запись файла
err = os.WriteFile(FilenameReadyGRPC_ClientUpdate, []byte(TextGRPC_Client), constants.FILE_PERMISSIONS)

View File

@ -373,7 +373,7 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
`
//заменим импорты
//if config.Settings.USE_DEFAULT_TEMPLATE == true {
if config.Settings.USE_DEFAULT_TEMPLATE == true {
ModelTableURL := create_files.FindModelTableURL(TableName)
TextGRPCServer = create_files.AddImport(TextGRPCServer, ModelTableURL)
@ -383,7 +383,7 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
//ModelURL := create_files.FindModelURL()
//TextGRPCServer = create_files.AddImport(TextGRPCServer, ModelURL)
//}
}
//создание текста
TextUpdateEveryColumn := FindTextUpdateEveryColumn(TextGRPCServerUpdateFunc, Table1)
@ -397,10 +397,11 @@ func CreateFilesUpdateEveryColumn(Table1 *types.Table) error {
//TextGRPCServer = strings.ReplaceAll(TextGRPCServer, config.Settings.TEXT_TEMPLATE_TABLENAME, Table1.Name)
TextGRPCServer = TextGRPCServer + TextUpdateEveryColumn
if config.Settings.USE_DEFAULT_TEMPLATE == true {
TextGRPCServer = create_files.ConvertIdToAlias(TextGRPCServer, Table1)
TextGRPCServer = create_files.CheckAndAddImportAlias(TextGRPCServer)
TextGRPCServer = config.Settings.TEXT_MODULE_GENERATED + TextGRPCServer
}
//удаление пустого импорта
TextGRPCServer = create_files.DeleteEmptyImport(TextGRPCServer)