diff --git a/bin/templates/cmd/main.go_ b/bin/templates/cmd/main.go_ index faf64a7..5336c1b 100644 --- a/bin/templates/cmd/main.go_ +++ b/bin/templates/cmd/main.go_ @@ -4,7 +4,7 @@ import ( configmain "github.com/ManyakRus/starter/config_main" "github.com/ManyakRus/starter/stopapp" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/crud_starter" - "gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/constants" + "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/constants" "github.com/ManyakRus/starter/postgres_gorm" ) diff --git a/bin/templates/configs_/mapping.json b/bin/templates/configs_/mapping.json index 30c101a..fc6bf0e 100644 --- a/bin/templates/configs_/mapping.json +++ b/bin/templates/configs_/mapping.json @@ -284,7 +284,7 @@ "sql_type": "decimal", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -293,7 +293,7 @@ "sql_type": "double", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -302,7 +302,7 @@ "sql_type": "money", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -311,7 +311,7 @@ "sql_type": "real", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -339,7 +339,7 @@ "sql_type": "float8", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -394,7 +394,7 @@ "sql_type": "numeric", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -511,7 +511,7 @@ "sql_type": "udecimal", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" @@ -520,7 +520,7 @@ "sql_type": "udouble", "go_type": "float64", "json_type": "Float", - "protobuf_type": "float", + "protobuf_type": "double", "guregu_type": "null.Float", "go_nullable_type": "sql.NullFloat64", "swagger_type": "float64" diff --git a/bin/templates/pkg/network/grpc/grpc_client/grpc_client.go_ b/bin/templates/pkg/network/grpc/grpc_client/grpc_client.go_ index c49023a..406a8ec 100644 --- a/bin/templates/pkg/network/grpc/grpc_client/grpc_client.go_ +++ b/bin/templates/pkg/network/grpc/grpc_client/grpc_client.go_ @@ -10,7 +10,7 @@ import ( "gitlab.aescorp.ru/dsp_dev/claim/sync_service/api/grpc_proto" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_constants" "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/nrpc/nrpc_client" - "gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/db_constants" + "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "os" diff --git a/internal/create_files/protobuf/protobuf.go b/internal/create_files/protobuf/protobuf.go index 58a65b8..da04a8b 100644 --- a/internal/create_files/protobuf/protobuf.go +++ b/internal/create_files/protobuf/protobuf.go @@ -148,10 +148,10 @@ func FindTextProtoTable1(TextProto string, Table1 *types.Table) string { } if create_files.Has_Column_IsDeleted(Table1) == true { - Otvet = Otvet + FindTextDelete(TextProto, ModelName) + Otvet = Otvet + FindTextDelete(TextProto, Table1) if config.Settings.HAS_IS_DELETED == true { - Otvet = Otvet + FindTextRestore(TextProto, ModelName) + Otvet = Otvet + FindTextRestore(TextProto, Table1) } } @@ -223,9 +223,9 @@ func FindTextSave(TextProto string, ModelName string) string { } // FindTextDelete - возвращает текст .proto -func FindTextDelete(TextProto string, ModelName string) string { +func FindTextDelete(TextProto string, Table1 *types.Table) string { Otvet := "" - Otvet2 := TextDelete(ModelName) + Otvet2 := TextDelete(Table1) //проверка такой текст уже есть pos1 := strings.Index(TextProto, Otvet2) @@ -239,9 +239,9 @@ func FindTextDelete(TextProto string, ModelName string) string { } // FindTextRestore - возвращает текст .proto -func FindTextRestore(TextProto string, ModelName string) string { +func FindTextRestore(TextProto string, Table1 *types.Table) string { Otvet := "" - Otvet2 := TextRestore(ModelName) + Otvet2 := TextRestore(Table1) //проверка такой текст уже есть pos1 := strings.Index(TextProto, Otvet2) @@ -308,15 +308,33 @@ func TextSave(ModelName string) string { } // TextDelete - возвращает текст .proto -func TextDelete(ModelName string) string { - Otvet := "rpc " + ModelName + "_Delete(RequestId) returns (Response) {}" +func TextDelete(Table1 *types.Table) string { + Otvet := "" + + ModelName := Table1.NameGo + PrimaryKeyColumn := create_files.FindPrimaryKeyColumn(Table1) + if PrimaryKeyColumn == nil { + return Otvet + } + + TextRequest, _ := create_files.FindTextProtobufRequest(Table1) + Otvet = "rpc " + ModelName + "_Delete(" + TextRequest + ") returns (Response) {}" return Otvet } // TextRestore - возвращает текст .proto -func TextRestore(ModelName string) string { - Otvet := "rpc " + ModelName + "_Restore(RequestId) returns (Response) {}" +func TextRestore(Table1 *types.Table) string { + Otvet := "" + + ModelName := Table1.NameGo + PrimaryKeyColumn := create_files.FindPrimaryKeyColumn(Table1) + if PrimaryKeyColumn == nil { + return Otvet + } + + TextRequest, _ := create_files.FindTextProtobufRequest(Table1) + Otvet = "rpc " + ModelName + "_Restore(" + TextRequest + ") returns (Response) {}" return Otvet }