1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-12-16 21:52:42 +02:00
crud_generator/internal/create_files/protobuf/protobuf_readall.go

44 lines
912 B
Go
Raw Normal View History

2024-09-17 15:50:01 +02:00
package protobuf
import (
"github.com/ManyakRus/crud_generator/internal/types"
"strings"
)
// FindText_ReadAll - добавляет текст ReadAll
func FindText_ReadAll(TextProto string, Table1 *types.Table) (TextProtoNew string, TextAdd string) {
TextProtoNew = TextProto
2024-09-17 16:38:53 +02:00
_, ok := types.MapReadAll[Table1]
if ok == false {
return
}
2024-09-17 15:50:01 +02:00
2024-09-17 16:38:53 +02:00
TextAdd = ""
Text1 := FindText_ReadAll1(Table1)
2024-09-17 15:50:01 +02:00
2024-09-17 16:38:53 +02:00
//проверим такой текст уже есть
pos1 := strings.Index(TextProto, Text1)
if pos1 >= 0 {
return
2024-09-17 15:50:01 +02:00
}
2024-09-17 16:38:53 +02:00
//
TextAdd = TextAdd + Text1
2024-09-17 15:50:01 +02:00
return TextProtoNew, TextAdd
}
// FindText_ReadAll1 - находит текст FindBy
func FindText_ReadAll1(Table1 *types.Table) string {
Otvet := "\n\trpc "
FuncName := "ReadAll"
TextRequest := "Request_Empty"
//
2024-10-14 15:44:20 +02:00
Otvet = Otvet + Table1.NameGo_translit + "_" + FuncName + "(" + TextRequest + ") returns (ResponseMass) {}\n"
2024-09-17 15:50:01 +02:00
return Otvet
}