1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2025-01-03 01:22:21 +02:00

сделал TEMPLATES_CONVERT_ID_FILENAME

This commit is contained in:
Nikitin Aleksandr 2024-02-16 11:37:36 +03:00
parent 32f435054c
commit ad10921d30
13 changed files with 79 additions and 43 deletions

View File

@ -1,14 +1,3 @@
{
"lawsuit_payments.id": "alias.PaymentId",
"lawsuit_payments.invoice_id": "alias.InvoiceId",
"lawsuit_payments.lawsuit_id": "alias.LawsuitId",
"lawsuit_payments.id": "alias.PaymentId",
"invoice_debt_type_stats.invoice_id": "alias.InvoiceId",
"invoice_debt_type_stats.lawsuit_id": "alias.LawsuitId",
"contract_black_items.contract_number": "alias.ContractNumber",
"contract_white_items.contract_number": "alias.ContractNumber",
"lawsuits.number_claim": "alias.ClaimNumber",
"lawsuits.number": "alias.LawsuitNumber",
"contracts.number": "alias.ContractNumber"
}

View File

@ -0,0 +1,14 @@
{
"lawsuit_payments.id": "alias.PaymentId",
"lawsuit_payments.invoice_id": "alias.InvoiceId",
"lawsuit_payments.lawsuit_id": "alias.LawsuitId",
"lawsuit_payments.id": "alias.PaymentId",
"invoice_debt_type_stats.invoice_id": "alias.InvoiceId",
"invoice_debt_type_stats.lawsuit_id": "alias.LawsuitId",
"contract_black_items.contract_number": "alias.ContractNumber",
"contract_white_items.contract_number": "alias.ContractNumber",
"lawsuits.number_claim": "alias.ClaimNumber",
"lawsuits.number": "alias.LawsuitNumber",
"contracts.number": "alias.ContractNumber"
}

View File

@ -1,8 +1,2 @@
{
"lawsuits": [
{
"old": "create_update_ctx",
"new": "create_update_ctx_original"
}
]
}

View File

@ -0,0 +1,8 @@
{
"lawsuits": [
{
"old": "create_update_ctx",
"new": "create_update_ctx_original"
}
]
}

View File

@ -1,3 +1,2 @@
{
"lawsuits": "NewLawsuit,AsLawsuit,create_update_ctx"
}

View File

@ -0,0 +1,3 @@
{
"lawsuits": "NewLawsuit,AsLawsuit,create_update_ctx"
}

View File

@ -1,19 +1,2 @@
{
"inn": "INN",
"kpp": "KPP",
"okpo": "OKPO",
"ogrn": "OGRN",
"okato": "OKATO",
"nsi_flat": "NSIFlat",
"nsi_flat_id": "NSIFlatID",
"nsi_id": "NSIID",
"www": "WWW",
"bik": "BIK",
"city_name": "City",
"edms_link": "EDMSLink",
"code_nsi": "CodeNSI",
"json_updated_at": "JSONUpdatedAt",
"pdf_updated_at": "PDFUpdatedAt",
"pdf_file_id": "PDFFileID",
"json_file_id": "JSONFileID"
}

View File

@ -0,0 +1,19 @@
{
"inn": "INN",
"kpp": "KPP",
"okpo": "OKPO",
"ogrn": "OGRN",
"okato": "OKATO",
"nsi_flat": "NSIFlat",
"nsi_flat_id": "NSIFlatID",
"nsi_id": "NSIID",
"www": "WWW",
"bik": "BIK",
"city_name": "City",
"edms_link": "EDMSLink",
"code_nsi": "CodeNSI",
"json_updated_at": "JSONUpdatedAt",
"pdf_updated_at": "PDFUpdatedAt",
"pdf_file_id": "PDFFileID",
"json_file_id": "JSONFileID"
}

View File

@ -1,4 +1,3 @@
{
"ext_id": true,
"created_at": false
}

View File

@ -0,0 +1,4 @@
{
"ext_id": true,
"created_at": false
}

View File

@ -179,4 +179,19 @@ NEED_CREATE_UPDATE_EVERY_COLUMN=true
TEMPLATES_CRUD_TABLE_UPDATE_FUNC_FILENAME="crud_table_update_func.go_"
#TEMPLATES_CRUD_TABLE_UPDATE_FUNC_TEST_FILENAME - short filename of "crud_table_update_func_test.go_" file
TEMPLATES_CRUD_TABLE_UPDATE_FUNC_TEST_FILENAME="crud_table_update_func_test.go_"
TEMPLATES_CRUD_TABLE_UPDATE_FUNC_TEST_FILENAME="crud_table_update_func_test.go_"
#TEMPLATES_CONVERT_ID_FILENAME - short filename of "convert_id.json" file
TEMPLATES_CONVERT_ID_FILENAME="convert_id.json"
#TEMPLATES_CRUD_FUNCTIONS_RENAME_FILENAME - short filename of "crud_functions_rename.json" file
TEMPLATES_CRUD_FUNCTIONS_RENAME_FILENAME="crud_functions_rename.json"
#TEMPLATES_MODEL_CRUD_DELETE_FUNCTIONS_FILENAME - short filename of "model_crud_delete_functions.json" file
TEMPLATES_MODEL_CRUD_DELETE_FUNCTIONS_FILENAME="model_crud_delete_functions.json"
#TEMPLATES_NAME_REPLACE_FILENAME - short filename of "name_replace.json" file
TEMPLATES_NAME_REPLACE_FILENAME="name_replace.json"
#TEMPLATES_NULLABLE_FILENAME - short filename of "nullable.json" file
TEMPLATES_NULLABLE_FILENAME="nullable.json"

View File

@ -41,6 +41,11 @@ type SettingsINI struct {
TEMPLATES_ALIAS_FILENAME string
TEMPLATES_CRUD_TABLE_UPDATE_FUNC_FILENAME string
TEMPLATES_CRUD_TABLE_UPDATE_FUNC_TEST_FILENAME string
TEMPLATES_CONVERT_ID_FILENAME string
TEMPLATES_CRUD_FUNCTIONS_RENAME_FILENAME string
TEMPLATES_MODEL_CRUD_DELETE_FUNCTIONS_FILENAME string
TEMPLATES_NAME_REPLACE_FILENAME string
TEMPLATES_NULLABLE_FILENAME string
NEED_CREATE_MODEL_STRUCT bool
NEED_CREATE_MODEL_CRUD bool
NEED_CREATE_DB bool
@ -185,7 +190,11 @@ func FillSettings() {
Settings.PREFIX_CLIENT_GRPC = os.Getenv("PREFIX_CLIENT_GRPC")
Settings.TEMPLATES_CRUD_TABLE_UPDATE_FUNC_FILENAME = os.Getenv("TEMPLATES_CRUD_TABLE_UPDATE_FUNC_FILENAME")
Settings.TEMPLATES_CRUD_TABLE_UPDATE_FUNC_TEST_FILENAME = os.Getenv("TEMPLATES_CRUD_TABLE_UPDATE_FUNC_TEST_FILENAME")
Settings.TEMPLATES_CONVERT_ID_FILENAME = os.Getenv("TEMPLATES_CONVERT_ID_FILENAME")
Settings.TEMPLATES_CRUD_FUNCTIONS_RENAME_FILENAME = os.Getenv("TEMPLATES_CRUD_FUNCTIONS_RENAME_FILENAME")
Settings.TEMPLATES_MODEL_CRUD_DELETE_FUNCTIONS_FILENAME = os.Getenv("TEMPLATES_MODEL_CRUD_DELETE_FUNCTIONS_FILENAME")
Settings.TEMPLATES_NAME_REPLACE_FILENAME = os.Getenv("TEMPLATES_NAME_REPLACE_FILENAME")
Settings.TEMPLATES_NULLABLE_FILENAME = os.Getenv("TEMPLATES_NULLABLE_FILENAME")
}
// CurrentDirectory - возвращает текущую директорию ОС

View File

@ -38,7 +38,7 @@ func LoadMappings() {
// LoadNameReplace - загружает маппинг ТипБД = ТипGolang, из файла .json
func LoadNameReplace() {
dir := micro.ProgramDir_bin()
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + "name_replace.json"
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + config.Settings.TEMPLATES_NAME_REPLACE_FILENAME
var err error
@ -61,7 +61,7 @@ func LoadNameReplace() {
// LoadNullable - загружает список полей которые могут быть null
func LoadNullable() {
dir := micro.ProgramDir_bin()
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + "nullable.json"
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + config.Settings.TEMPLATES_NULLABLE_FILENAME
var err error
@ -120,7 +120,7 @@ func Load_TEXT_DB_IS_DELETED() {
// LoadConvertID - загружает map: ИмяТаблицы:Тип
func LoadConvertID() {
dir := micro.ProgramDir_bin()
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + "convert_id.json"
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + config.Settings.TEMPLATES_CONVERT_ID_FILENAME
var err error
@ -143,7 +143,7 @@ func LoadConvertID() {
// LoadMapModelCrudDeleteFunctions - загружает map ИмяТаблицыPostgres:ИмяФункцииGolang
func LoadMapModelCrudDeleteFunctions() {
dir := micro.ProgramDir_bin()
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + "model_crud_delete_functions.json"
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + config.Settings.TEMPLATES_MODEL_CRUD_DELETE_FUNCTIONS_FILENAME
var err error
@ -184,7 +184,7 @@ func Load_TEXT_DB_CREATED_AT() {
// LoadCrudFunctionsRename - загружает маппинг ИмяТаблицы:{old:"",new:""}
func LoadCrudFunctionsRename() {
dir := micro.ProgramDir_bin()
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + "crud_functions_rename.json"
FileName := dir + config.Settings.TEMPLATE_FOLDERNAME + micro.SeparatorFile() + constants.CONFIG_FOLDER_NAME + micro.SeparatorFile() + config.Settings.TEMPLATES_CRUD_FUNCTIONS_RENAME_FILENAME
var err error