Refactor video handling and integrate new services
- Removed legacy video handling code and models to streamline the codebase. - Updated main.go to include new services for removing watermarks and smoke logging. - Enhanced route registration to accommodate new handlers for watermark removal and smoke logging. - Improved database migration to include new models for watermark processing.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"wx_service/internal/model"
|
||||
)
|
||||
|
||||
// CurrentUser 从 gin.Context 中取出鉴权中间件写入的当前用户。
|
||||
// 返回值 ok=false 表示:未经过鉴权中间件,或 token 无效导致未设置用户。
|
||||
func CurrentUser(c *gin.Context) (*model.User, bool) {
|
||||
userVal, exists := c.Get(ContextCurrentUserKey)
|
||||
if !exists {
|
||||
return nil, false
|
||||
}
|
||||
user, ok := userVal.(*model.User)
|
||||
return user, ok
|
||||
}
|
||||
Reference in New Issue
Block a user