controllers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(c *gin.Context, code int, msg ...string)

*

  • 失败时返回

func Error404

func Error404(c *gin.Context)

func Error500

func Error500(c *gin.Context)

func GenRequest

func GenRequest(c *gin.Context, request interface{}) (err error)

*

  • 将请求的body转换为request数据结构
  • @param c
  • @param request 传入request数据结构的指针 如 new(TestRequest)

func GetBannerList

func GetBannerList(c *gin.Context)

测试数据库服务示例

func HandleHello

func HandleHello(c *gin.Context)

hello示例

func HandleTest

func HandleTest(c *gin.Context)

request和response的示例

func ReadBody

func ReadBody(c *gin.Context) (body []byte, err error)

重复读取body

func Success

func Success(c *gin.Context, data interface{})

*

  • 成功时返回

Types

This section is empty.

Jump to

Keyboard shortcuts

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