1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2025-06-05 11:57:30 +02:00

сделал AddTextMessageRequestID_Columns()

This commit is contained in:
Nikitin Aleksandr 2024-09-26 14:27:25 +03:00
parent 564002f84b
commit ad0a31da92
8 changed files with 22 additions and 9 deletions

6
.golangci.yml Normal file
View File

@ -0,0 +1,6 @@
# Options for analysis running.
linters-settings:
gocyclo:
# Minimal code complexity to report.
# Default: 30 (but we recommend 10-20)
min-complexity: 20

View File

@ -54,3 +54,5 @@ lines:
go_lines_count ./ ./docs/lines_count.txt 3 go_lines_count ./ ./docs/lines_count.txt 3
licenses: licenses:
golicense -out-xlsx=./docs/licenses.xlsx $(FILEAPP) golicense -out-xlsx=./docs/licenses.xlsx $(FILEAPP)
gocyclo:
golangci-lint run ./... --disable-all -E gocyclo -v

View File

@ -1 +1,4 @@
[{"Table":"connections","Columns":["branch_id","is_legal"]}] [
{"Table":"connections","Columns":["branch_id","is_legal"]},
{"Table":"file_types","Columns":["code"]}
]

View File

@ -42,7 +42,7 @@ func Connect() {
// Connect to the NATS server. // Connect to the NATS server.
Conn, err := nats.Connect(NatsURL, nats.Timeout(60*time.Second)) Conn, err := nats.Connect(NatsURL, nats.Timeout(60*time.Second))
if err != nil { if err != nil {
log.Panic(err) log.Panic("nats.Connect(", NatsURL, ") error: ", err)
} }
//defer Conn.Close() //defer Conn.Close()

View File

@ -2601,12 +2601,12 @@ func Find_RequestFieldNames_FromMass(MassColumns []*types.Column) string {
Otvet := "" Otvet := ""
TextFields := "" TextFields := ""
TextRequest := "" //TextRequest := ""
Underline := "" Underline := ""
for _, Column1 := range MassColumns { for _, Column1 := range MassColumns {
TextFields = TextFields + Underline + Column1.NameGo TextFields = TextFields + Underline + Column1.NameGo
TextRequest1 := Find_RequestFieldName_FromMass(Column1, MassColumns) TextRequest1 := Find_RequestFieldName_FromMass(Column1, MassColumns)
TextRequest = TextRequest + Underline + TextRequest1 Otvet = Otvet + Underline + TextRequest1
Underline = "_" Underline = "_"
} }

View File

@ -404,7 +404,7 @@ func Is_Common_Сolumn(Column1 *types.Column) bool {
func Is_NotNeedUpdate_Сolumn(Column1 *types.Column) bool { func Is_NotNeedUpdate_Сolumn(Column1 *types.Column) bool {
Otvet := false Otvet := false
Otvet = Is_Column_CommonStruct(Column1) || Is_Column_GroupsStruct(Column1) || Is_Column_ExtLinksStruct(Column1) Otvet = Is_Column_CommonStruct(Column1) || Is_Column_GroupsStruct(Column1) //|| Is_Column_ExtLinksStruct(Column1)
if Is_Need_Сolumn(Column1) == false { if Is_Need_Сolumn(Column1) == false {
Otvet = true Otvet = true

View File

@ -88,7 +88,8 @@ func CreateFileProto(MapAll map[string]*types.Table) error {
TextProtoNew = TextProtoNew + FindText_ProtoTable1_UpdateEveryColumn(TextProto, Table1) TextProtoNew = TextProtoNew + FindText_ProtoTable1_UpdateEveryColumn(TextProto, Table1)
//добавим текст FindBy //добавим текст FindBy
TextProto, TextProtoNew1 := FindText_FindBy(TextProto, Table1) TextProtoNew1 := ""
TextProto, TextProtoNew1 = FindText_FindBy(TextProto, Table1)
TextProtoNew = TextProtoNew + TextProtoNew1 TextProtoNew = TextProtoNew + TextProtoNew1
//добавим текст FindMassBy //добавим текст FindMassBy
@ -361,10 +362,10 @@ message ` + TextRequest + ` {
// //
for i, Column1 := range Columns { for i, Column1 := range Columns {
ProtoType := create_files.Convert_GolangTypeNameToProtobufTypeName(Column1.Type) ProtoType := create_files.Convert_GolangTypeNameToProtobufTypeName(Column1.TypeGo)
ProtoName := create_files.Find_RequestFieldName_FromMass(Column1, Columns) ProtoName := create_files.Find_RequestFieldName_FromMass(Column1, Columns)
TextMessage = TextMessage + ` TextMessage = TextMessage + `
` + ProtoType + ` ` + ProtoName + ` = ` + strconv.Itoa(i+2) + `; //значение поиска` ` + ProtoType + ` ` + ProtoName + ` = ` + strconv.Itoa(i+2) + `; //значение поиска`
} }
TextMessage = TextMessage + ` TextMessage = TextMessage + `

View File

@ -26,10 +26,11 @@ func FindText_FindBy(TextProto string, Table1 *types.Table) (string, string) {
//добавим message //добавим message
TextMess := AddTextMessageRequestID_Columns(TextProto, TableColumns1.Columns) TextMess := AddTextMessageRequestID_Columns(TextProto, TableColumns1.Columns)
//проверим такой текст message уже есть //проверим такой текст message уже есть
pos1 = strings.Index(TextProto, TextMess) pos1 = strings.Index(TextProto, TextMess)
if pos1 < 0 { if pos1 < 0 {
Otvet = Otvet + "\n" + TextMess Otvet = TextMess
} }
// //