feat: request utils
This commit is contained in:
13
internal/util/request.go
Normal file
13
internal/util/request.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package util
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"gitea.local/admin/hspguard/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetRequestUserId(ctx context.Context) (string, bool) {
|
||||||
|
userId, ok := ctx.Value(types.UserIdKey).(string)
|
||||||
|
return userId, ok
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user