增肌处理结果的响应数据
This commit is contained in:
@ -31,8 +31,15 @@ func RegisterGitHookRouter(router *gin.Engine, handler IGitHookEventHandler) err
|
||||
if err = ctx.ShouldBindJSON(&hookData); nil != err {
|
||||
ctx.JSON(http.StatusBadRequest, gin.H{"code": -1, "message": err.Error()})
|
||||
}
|
||||
handler(ctx, &hookData)
|
||||
// TODO : 响应数据
|
||||
responseData := handler(ctx, &hookData)
|
||||
if nil == responseData {
|
||||
responseData = &ResponseData{
|
||||
Code: 100,
|
||||
Message: "处理完成(未设置返回值,系统默认返回此信息)",
|
||||
Data: map[string]interface{}
|
||||
}
|
||||
}
|
||||
ctx.JSON(http.StatusOK, responseData)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user