123456789101112131415161718192021 |
- package common
- import (
- "github.com/gin-gonic/gin"
- "net/http"
- )
- type BaseCtl struct {
- }
- func (ctl *BaseCtl) RespError(c *gin.Context, e error) {
- c.JSON(http.StatusOK, gin.H{
- "error": e.Error(),
- })
- }
- func (ctl *BaseCtl) RespOk(c *gin.Context, data interface{}) {
- c.JSON(http.StatusOK, gin.H{
- "data": data,
- })
- }
|