mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-05-31 23:29:36 +02:00
сделал AddTextMessageRequestID_Columns()
This commit is contained in:
parent
564002f84b
commit
ad0a31da92
6
.golangci.yml
Normal file
6
.golangci.yml
Normal 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
|
2
Makefile
2
Makefile
@ -54,3 +54,5 @@ lines:
|
||||
go_lines_count ./ ./docs/lines_count.txt 3
|
||||
licenses:
|
||||
golicense -out-xlsx=./docs/licenses.xlsx $(FILEAPP)
|
||||
gocyclo:
|
||||
golangci-lint run ./... --disable-all -E gocyclo -v
|
||||
|
@ -1 +1,4 @@
|
||||
[{"Table":"connections","Columns":["branch_id","is_legal"]}]
|
||||
[
|
||||
{"Table":"connections","Columns":["branch_id","is_legal"]},
|
||||
{"Table":"file_types","Columns":["code"]}
|
||||
]
|
||||
|
@ -42,7 +42,7 @@ func Connect() {
|
||||
// Connect to the NATS server.
|
||||
Conn, err := nats.Connect(NatsURL, nats.Timeout(60*time.Second))
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
log.Panic("nats.Connect(", NatsURL, ") error: ", err)
|
||||
}
|
||||
//defer Conn.Close()
|
||||
|
||||
|
@ -2601,12 +2601,12 @@ func Find_RequestFieldNames_FromMass(MassColumns []*types.Column) string {
|
||||
Otvet := ""
|
||||
|
||||
TextFields := ""
|
||||
TextRequest := ""
|
||||
//TextRequest := ""
|
||||
Underline := ""
|
||||
for _, Column1 := range MassColumns {
|
||||
TextFields = TextFields + Underline + Column1.NameGo
|
||||
TextRequest1 := Find_RequestFieldName_FromMass(Column1, MassColumns)
|
||||
TextRequest = TextRequest + Underline + TextRequest1
|
||||
Otvet = Otvet + Underline + TextRequest1
|
||||
Underline = "_"
|
||||
}
|
||||
|
||||
|
@ -404,7 +404,7 @@ func Is_Common_Сolumn(Column1 *types.Column) bool {
|
||||
func Is_NotNeedUpdate_Сolumn(Column1 *types.Column) bool {
|
||||
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 {
|
||||
Otvet = true
|
||||
|
@ -88,7 +88,8 @@ func CreateFileProto(MapAll map[string]*types.Table) error {
|
||||
TextProtoNew = TextProtoNew + FindText_ProtoTable1_UpdateEveryColumn(TextProto, Table1)
|
||||
|
||||
//добавим текст FindBy
|
||||
TextProto, TextProtoNew1 := FindText_FindBy(TextProto, Table1)
|
||||
TextProtoNew1 := ""
|
||||
TextProto, TextProtoNew1 = FindText_FindBy(TextProto, Table1)
|
||||
TextProtoNew = TextProtoNew + TextProtoNew1
|
||||
|
||||
//добавим текст FindMassBy
|
||||
@ -361,10 +362,10 @@ message ` + TextRequest + ` {
|
||||
|
||||
//
|
||||
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)
|
||||
TextMessage = TextMessage + `
|
||||
` + ProtoType + ` ` + ProtoName + ` = ` + strconv.Itoa(i+2) + `; //значение поиска`
|
||||
` + ProtoType + ` ` + ProtoName + ` = ` + strconv.Itoa(i+2) + `; //значение поиска`
|
||||
}
|
||||
|
||||
TextMessage = TextMessage + `
|
||||
|
@ -26,10 +26,11 @@ func FindText_FindBy(TextProto string, Table1 *types.Table) (string, string) {
|
||||
|
||||
//добавим message
|
||||
TextMess := AddTextMessageRequestID_Columns(TextProto, TableColumns1.Columns)
|
||||
|
||||
//проверим такой текст message уже есть
|
||||
pos1 = strings.Index(TextProto, TextMess)
|
||||
if pos1 < 0 {
|
||||
Otvet = Otvet + "\n" + TextMess
|
||||
Otvet = TextMess
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user