You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/servants/core/core.go

27 lines
393 B

package core
import (
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model"
)
type BaseServant struct {
// TODO
}
type BaseBinding struct {
// TODO
}
type BaseRender struct {
// TODO
}
func (BaseServant) userFrom(c *gin.Context) (*model.User, bool) {
if u, exists := c.Get("USER"); exists {
user, ok := u.(*model.User)
return user, ok
}
return nil, false
}