fix
This commit is contained in:
parent
f1310d093e
commit
a2e3bfab77
|
@ -15,12 +15,11 @@ type Reply struct {
|
||||||
|
|
||||||
func (reply *Reply) Success(ctx *gin.Context, data any) {
|
func (reply *Reply) Success(ctx *gin.Context, data any) {
|
||||||
reply.Code = 200
|
reply.Code = 200
|
||||||
|
reply.Data = data
|
||||||
if data == nil {
|
if data == nil {
|
||||||
reply.Data = ""
|
reply.Data = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.JSON(200, reply)
|
ctx.JSON(200, reply)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
func (reply *Reply) Error(ctx *gin.Context, err error) {
|
func (reply *Reply) Error(ctx *gin.Context, err error) {
|
||||||
reply.Code = 500
|
reply.Code = 500
|
||||||
|
@ -34,5 +33,4 @@ func (reply *Reply) Error(ctx *gin.Context, err error) {
|
||||||
|
|
||||||
// Send error
|
// Send error
|
||||||
ctx.JSON(200, reply)
|
ctx.JSON(200, reply)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue