JM-WechatMini/resource/autocode_template/server/request.go.tpl
2023-11-02 04:34:46 +08:00

25 lines
775 B
Smarty

package request
import (
"miniapp/model/{{.Package}}"
"miniapp/model/common/request"
"time"
)
type {{.StructName}}Search struct{
{{.Package}}.{{.StructName}}
StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
{{- range .Fields}}
{{- if eq .FieldSearchType "BETWEEN" "NOT BETWEEN"}}
Start{{.FieldName}} *{{.FieldType}} `json:"start{{.FieldName}}" form:"start{{.FieldName}}"`
End{{.FieldName}} *{{.FieldType}} `json:"end{{.FieldName}}" form:"end{{.FieldName}}"`
{{- end }}
{{- end }}
request.PageInfo
{{- if .NeedSort}}
Sort string `json:"sort" form:"sort"`
Order string `json:"order" form:"order"`
{{- end}}
}