add comments, code refactor, fix typo

This commit is contained in:
MaysWind
2020-12-23 00:09:35 +08:00
parent bb10498893
commit 17d1cd8719
10 changed files with 49 additions and 13 deletions
+2
View File
@@ -11,6 +11,7 @@ import (
"github.com/mayswind/lab/pkg/errs"
)
// PrintSuccessResult writes success response to current http context
func PrintSuccessResult(c *core.Context, result interface{}) {
c.JSON(http.StatusOK, gin.H{
"success": true,
@@ -18,6 +19,7 @@ func PrintSuccessResult(c *core.Context, result interface{}) {
})
}
// PrintErrorResult writes error response to current http context
func PrintErrorResult(c *core.Context, err *errs.Error) {
c.SetResponseError(err)