package
Version:
v2.0.1
Opens a new window with list of versions in this module.
Published: Apr 6, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 16
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Api
-
func (e *Api) AddError(err error)
-
func (e *Api) Bind(d interface{}, bindings ...binding.Binding) *Api
-
func (e *Api) Custom(data gin.H)
-
func (e *Api) Error(errCode int, errMsg string, showType string)
-
func (e Api) GetLogger() *logger.Helper
-
func (e *Api) GetOrm(c *gin.Context) (*gorm.DB, error)
-
func (e *Api) ListOK(result interface{}, total int, current int, pageSize int)
-
func (e *Api) MakeContext(c *gin.Context) *Api
-
func (e *Api) MakeOrm() *Api
-
func (e *Api) MakeService(c *service.Service) *Api
-
func (e *Api) OK(data interface{})
-
func (e *Api) PageOK(result interface{}, total int, current int, pageSize int)
-
func (e Api) Translate(form, to interface{})
Error 通常错误数据处理
showType error display type: 0 silent; 1 message.warn; 2 message.error; 4 notification; 9 page
func (e *Api) ListOK(result interface{}, total int, current int, pageSize int)
func (e *Api) OK(data interface{})
OK 通常成功数据处理
func (e *Api) PageOK(result interface{}, total int, current int, pageSize int)
PageOK 分页数据处理
func (e Api) Translate(form, to interface{})
Source Files
¶
Click to show internal directories.
Click to hide internal directories.