æ·feat: commplete init process

This commit is contained in:
engigu
2023-12-30 17:40:20 +08:00
parent 9307bec4ab
commit 77af985b76
92 changed files with 12054 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
package app
import (
"fmt"
"github.com/astaxie/beego/validation"
"github.com/gin-gonic/gin"
"message-nest/pkg/logging"
)
// MarkErrors logs error logs
func MarkErrors(errors []*validation.Error) {
for _, err := range errors {
logging.Logger.Error(err.Key, err.Message)
}
return
}
// 从请求中获取当前用户
func GetCurrentUserName(c *gin.Context) string {
userName, ok := c.Get("currentUserName")
if !ok {
return ""
} else {
return fmt.Sprintf("%s", userName)
}
}