You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
544 B
Go
28 lines
544 B
Go
8 months ago
|
package response
|
||
|
|
||
|
import (
|
||
|
"github.com/exhibition-main/internal/model"
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func ResponseMsg(c *gin.Context, httpCode int, Resp model.Response) {
|
||
|
if httpCode == 0 {
|
||
|
httpCode = http.StatusOK
|
||
|
}
|
||
|
c.JSON(httpCode, model.Response{
|
||
|
Status: Resp.Status,
|
||
|
Msg: Resp.Msg,
|
||
|
Data: Resp.Data,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func ResponseQuickMsg(c *gin.Context, Status uint8, Msg string, Data interface{}) {
|
||
|
//var c gin.Context
|
||
|
c.JSON(http.StatusOK, model.Response{
|
||
|
Status: int(Status),
|
||
|
Msg: Msg,
|
||
|
Data: Data,
|
||
|
})
|
||
|
}
|