Documentation ¶
Index ¶
- func Recover(c *gin.Context)
- func ReturnDataMessage(c *gin.Context, code int, msg string, data interface{})
- func ReturnDataMessageU(c *gin.Context, code int, msg string, data interface{})
- func ReturnError(c *gin.Context, err error)
- func ReturnErrorU(c *gin.Context, err error)
- func ReturnListDataMessage(c *gin.Context, code int, msg string, data interface{})
- func ReturnListDataMessageU(c *gin.Context, code int, msg string, data interface{})
- func ReturnMessage(c *gin.Context, code int, msg string)
- func ReturnMessageU(c *gin.Context, code int, msg string)
- func TryGetQueryString(c *gin.Context, names ...string) string
- type BaseController
- type Controller
- type ControllerMethod
- type DataController
- func (b *DataController) ReturnDataMessage(c *gin.Context, code int, message string, data interface{})
- func (b *DataController) ReturnError(c *gin.Context, code int, message error)
- func (b *DataController) ReturnMessage(c *gin.Context, code int, message string)
- func (b *DataController) ReturnPageMessage(c *gin.Context, code int, message string, pageSize int, pageNo int, ...)
- func (b *DataController) Upload(c *gin.Context, filed string, path string, name string) (string, error)
- func (b *DataController) Uploads(c *gin.Context, filed string, path string) (map[string]string, error)
- type GinServer
- type HTTPDataResponse
- type HTTPListResponse
- type HTTPPageResponse
- type HTTPResponse
- type HttpDataResponse
- type HttpListResponse
- type HttpPageResponse
- type HttpResponse
- type IBaseController
- type MethodType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReturnDataMessage ¶
func ReturnDataMessageU ¶
func ReturnError ¶
func ReturnErrorU ¶
func ReturnListDataMessage ¶
func ReturnListDataMessageU ¶
Types ¶
type BaseController ¶
type BaseController struct { IBaseController Name string `json:"name"` }
type Controller ¶
type Controller struct { Server *gin.Engine Group *gin.RouterGroup // contains filtered or unexported fields }
/defin controller
func (*Controller) AddHandle ¶
func (c *Controller) AddHandle(m MethodType, p string, h gin.HandlerFunc)
func (*Controller) RegisterController ¶
func (c *Controller) RegisterController()
type ControllerMethod ¶
type ControllerMethod struct { Method MethodType Path string Handle gin.HandlerFunc }
/define api function
type DataController ¶
type DataController struct {
BaseController
}
func (*DataController) ReturnDataMessage ¶
func (b *DataController) ReturnDataMessage(c *gin.Context, code int, message string, data interface{})
func (*DataController) ReturnError ¶
func (b *DataController) ReturnError(c *gin.Context, code int, message error)
func (*DataController) ReturnMessage ¶
func (b *DataController) ReturnMessage(c *gin.Context, code int, message string)
func (*DataController) ReturnPageMessage ¶
type GinServer ¶
/define server
func (*GinServer) NewController ¶
func (c *GinServer) NewController(path string) *Controller
new controller
func (*GinServer) RegisterController ¶
func (c *GinServer) RegisterController()
type HTTPDataResponse ¶
type HTTPDataResponse struct { HTTPResponse Data interface{} `json:"Data"` }
type HTTPListResponse ¶
type HTTPListResponse struct { HTTPResponse Count int `json:"Count"` Data interface{} `json:"Data"` }
type HTTPPageResponse ¶
type HTTPPageResponse struct { HTTPResponse PageSize int `json:"PageSize"` PageNo int `json:"PageNo"` TotalCount int `json:"TotalCount"` TotalPage int `json:"TotalPage"` Data interface{} `json:"Data"` }
type HTTPResponse ¶
type HttpDataResponse ¶
type HttpDataResponse struct { HttpResponse Data interface{} `json:"data"` }
type HttpListResponse ¶
type HttpListResponse struct { HttpResponse Data interface{} `json:"data"` }
type HttpPageResponse ¶
type HttpPageResponse struct { HttpResponse PageSize int `json:"pageSize"` PageNo int `json:"pageNo"` TotalCount int `json:"totalCount"` TotalPage int `json:"totalPage"` Data interface{} `json:"data"` }
type HttpResponse ¶
type IBaseController ¶
type IBaseController interface {
Register(server *GinServer)
}
type MethodType ¶
type MethodType uint32
/define http method
const ( GET MethodType = 1 + iota POST PUT DELETE )
Click to show internal directories.
Click to hide internal directories.