Documentation ¶
Index ¶
- Constants
- type AnnouncementController
- type BaseController
- func (c *BaseController) ResponseData(g *gin.Context, data interface{})
- func (c *BaseController) ResponseFailure(g *gin.Context, httpCode, code int, err interface{})
- func (c *BaseController) ResponseFailureForFuncErr(g *gin.Context, err interface{})
- func (c *BaseController) ResponseFailureForParameter(g *gin.Context, err interface{})
- func (c *BaseController) ResponseSuccess(g *gin.Context)
Constants ¶
View Source
const ( CErrParam = "未获取到要操作的对象ID" CErrJSON = "获取JSON数据失败" CErrTypeConversion = "类型转换错误" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnouncementController ¶
type AnnouncementController struct {
BaseController
}
announcement
func (*AnnouncementController) GetAll ¶
func (c *AnnouncementController) GetAll(g *gin.Context)
@Summary 删除公告 @Tags announcement @Produce json @Param id param int true "ID" @Success 200 {string} string @Failure 500 {string} string @Router /v1/announcement/{id} [delete]
func (*AnnouncementController) GetById ¶
func (c *AnnouncementController) GetById(g *gin.Context)
获取公告 @Summary 获取公告 @Tags announcement @Description 通过ID获取公告信息 @Accept json @Produce json @Param id path int false "Announcement ID" @Success 200 {string} model.Announcement{} @Failure 500 {string} string @Router /v1/announcement/{id} [get]
func (*AnnouncementController) UpDate ¶
func (c *AnnouncementController) UpDate(g *gin.Context)
修改公告
type BaseController ¶
type BaseController struct { }
func (*BaseController) ResponseData ¶
func (c *BaseController) ResponseData(g *gin.Context, data interface{})
func (*BaseController) ResponseFailure ¶
func (c *BaseController) ResponseFailure(g *gin.Context, httpCode, code int, err interface{})
func (*BaseController) ResponseFailureForFuncErr ¶
func (c *BaseController) ResponseFailureForFuncErr(g *gin.Context, err interface{})
func (*BaseController) ResponseFailureForParameter ¶
func (c *BaseController) ResponseFailureForParameter(g *gin.Context, err interface{})
func (*BaseController) ResponseSuccess ¶
func (c *BaseController) ResponseSuccess(g *gin.Context)
Click to show internal directories.
Click to hide internal directories.