增肌处理结果的响应数据

This commit is contained in:
2021-11-12 11:40:08 +08:00
parent cf07d30ca7
commit a63f196e0b
3 changed files with 21 additions and 3 deletions

View File

@ -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
}