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

сделал constants_

This commit is contained in:
Nikitin Aleksandr 2024-05-14 16:30:12 +03:00
parent 44b71d1530
commit ad2b030a9c
4 changed files with 38 additions and 20 deletions

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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
}