1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2025-01-23 09:24:43 +02:00

сделал model_crud.go_

This commit is contained in:
Nikitin Aleksandr 2023-11-08 18:12:04 +03:00
parent 4667965cb8
commit 77991aad91
4 changed files with 23 additions and 1 deletions

View File

@ -109,7 +109,11 @@ func TestFind_ByExtID(t *testing.T) {
t.Error("TestFind_ByExtID() error: ", err)
}
Otvet, err = Find_ByExtID(Otvet.ExtID, Otvet.ConnectionID)
if Otvet.ExtID ==0 {
return
}
err = crud.Find_ByExtID(&Otvet)
if err != nil {
t.Error("TestFind_ByExtID() error: ", err)
}

View File

@ -135,6 +135,12 @@ func CreateTestFiles(Table1 *types.Table) error {
}
TextDB = DeleteFuncTestFind_byExtID(TextDB, ModelName, Table1)
//Postgres_ID_Test = ID Minimum
if Table1.IDMinimum != "" {
TextFind := "const Postgres_ID_Test = "
TextDB = strings.ReplaceAll(TextDB, TextFind+"1", TextFind+Table1.IDMinimum)
}
// замена ID на PrimaryKey
TextDB = create_files.ReplacePrimaryKeyID(TextDB, Table1)

View File

@ -120,6 +120,12 @@ func CreateTestFiles(Table1 *types.Table) error {
}
TextDB = DeleteFuncTestFind_byExtID(TextDB, ModelName, Table1)
//Postgres_ID_Test = ID Minimum
if Table1.IDMinimum != "" {
TextFind := "const " + ModelName + "_ID_Test = "
TextDB = strings.ReplaceAll(TextDB, TextFind+"1", TextFind+Table1.IDMinimum)
}
// замена ID на PrimaryKey
TextDB = create_files.ReplacePrimaryKeyID(TextDB, Table1)

View File

@ -135,6 +135,12 @@ func CreateTestFiles(Table1 *types.Table) error {
}
TextDB = DeleteFuncTestFind_byExtID(TextDB, ModelName, Table1)
//Postgres_ID_Test = ID Minimum
if Table1.IDMinimum != "" {
TextFind := "const Postgres_ID_Test = "
TextDB = strings.ReplaceAll(TextDB, TextFind+"1", TextFind+Table1.IDMinimum)
}
// замена ID на PrimaryKey
TextDB = create_files.ReplacePrimaryKeyID(TextDB, Table1)