controller

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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) Add

func (c *AnnouncementController) Add(g *gin.Context)

添加公告

func (*AnnouncementController) Del

func (c *AnnouncementController) Del(g *gin.Context)

删除公告

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL