MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / GetWebProtoValidation

Method GetWebProtoValidation

pkg/sql2code/parser/commonParser.go:162–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160}
161
162func (info *CrudInfo) GetWebProtoValidation() string {
163 if info == nil {
164 return ""
165 }
166 if info.ProtoType == "string" {
167 return fmt.Sprintf(`[(validate.rules).string.min_len = 1, (tagger.tags) = "uri:\"%s\""]`, info.ColumnNameCamelFCL)
168 }
169 return fmt.Sprintf(`[(validate.rules).%s.gt = 0, (tagger.tags) = "uri:\"%s\""]`, info.ProtoType, info.ColumnNameCamelFCL)
170}
171
172func getCommonHandlerStructCodes(data tmplData, jsonNamedType int) (string, error) {
173 newFields := []tmplField{}

Callers 1

TestCrudInfoFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestCrudInfoFunction · 0.64