| 123456789101112131415161718192021222324252627282930 |
- package binding
- import (
- "git.sxidc.com/go-framework/baize/api"
- "github.com/gin-gonic/gin/binding"
- )
- func JsonBody(c *api.Context, dto DTO) error {
- return c.ShouldBindJSON(dto)
- }
- func QueryParams(c *api.Context, dto DTO) error {
- return c.ShouldBindQuery(dto)
- }
- func PathParams(c *api.Context, dto DTO) error {
- return c.ShouldBindUri(dto)
- }
- func MultipartForm(c *api.Context, dto DTO) error {
- return c.ShouldBindWith(dto, binding.FormMultipart)
- }
- func FormBody(c *api.Context, dto DTO) error {
- return c.ShouldBindWith(dto, binding.Form)
- }
- func XMLBody(c *api.Context, dto DTO) error {
- return c.ShouldBindXML(dto)
- }
|