12345678910111213141516171819202122 |
- package util
- import (
- "net/http"
- "youngee_b_api/consts"
- "youngee_b_api/model/http_model"
- "github.com/gin-gonic/gin"
- )
- func PackErrorResp(c *gin.Context, status int32) {
- resp := http_model.CommonResponse{
- Status: status,
- Message: consts.GetErrorToast(status),
- Data: nil,
- }
- c.JSON(http.StatusOK, resp)
- }
- func HandlerPackErrorResp(resp *http_model.CommonResponse, status int32) {
- resp.Status = status
- resp.Message = consts.GetErrorToast(status)
- }
|