Documentation
¶
Index ¶
- type AuthController
- func (this *AuthController) CheckUserIsClientManagerOrSelf(targetUserId interface{}) bool
- func (this *AuthController) CheckUserPrivilege(requiredPrivilege interface{}) bool
- func (this *AuthController) CheckUserPrivilegeRedirect(requiredPrivilege interface{}, redirectUrl string) (ret bool)
- func (this *AuthController) GetUserAuthImpl() AuthImplInterface
- func (this *AuthController) LoadUserContext() interface{}
- func (this *AuthController) LoadUserToken() string
- type AuthControllerInterface
- type AuthImplInterface
- type Controller
- func (this *Controller) AjaxDbList(pageable *pkBeans.Pageable, list interface{}, listSize int, total int64, ...)
- func (this *Controller) AjaxDbRecord(ob interface{}, oldCodeFormat ...bool)
- func (this *Controller) AjaxError(message string, codes ...int)
- func (this *Controller) AjaxMsg(code int, data interface{}, message ...string)
- func (this *Controller) AjaxUnAuthorized(message string, codes ...int)
- func (this *Controller) Cookie(key string) *http.Cookie
- func (this *Controller) CookieValue(key string) string
- func (this *Controller) GetClientIpAddr() string
- func (this *Controller) GetInt(key string, defValues ...int) int
- func (this *Controller) GetInt64(key string, defValues ...int64) int64
- func (this *Controller) GetPageableFromRequest() *pkBeans.Pageable
- func (this *Controller) GetRequest() *http.Request
- func (this *Controller) GetResponseWriter() http.ResponseWriter
- func (this *Controller) GetString(key string, defValues ...string) string
- func (this *Controller) Header(key string) string
- func (this *Controller) JsonResult(out interface{})
- func (this *Controller) OnLeave()
- func (this *Controller) OnPrepare()
- func (this *Controller) Query(key string) string
- func (this *Controller) Redirect(url string)
- func (this *Controller) RenderViewSimple(viewPath string, args ...interface{})
- func (this *Controller) RequestBodyToJsonObject(ob interface{}) error
- func (this *Controller) SetCookieValue(key string, val string, maxAgeSecondss ...int)
- func (this *Controller) SetRequest(r *http.Request)
- func (this *Controller) SetResponseWriter(w http.ResponseWriter)
- func (this *Controller) SetUrlParameters(p map[string]string)
- type ControllerInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthController ¶
type AuthController struct { Controller UserContext interface{} Token string UserAuthObj AuthImplInterface }
func (*AuthController) CheckUserIsClientManagerOrSelf ¶
func (this *AuthController) CheckUserIsClientManagerOrSelf(targetUserId interface{}) bool
func (*AuthController) CheckUserPrivilege ¶
func (this *AuthController) CheckUserPrivilege(requiredPrivilege interface{}) bool
登录状态验证
func (*AuthController) CheckUserPrivilegeRedirect ¶
func (this *AuthController) CheckUserPrivilegeRedirect(requiredPrivilege interface{}, redirectUrl string) (ret bool)
func (*AuthController) GetUserAuthImpl ¶
func (this *AuthController) GetUserAuthImpl() AuthImplInterface
func (*AuthController) LoadUserContext ¶
func (this *AuthController) LoadUserContext() interface{}
读取登录状态
func (*AuthController) LoadUserToken ¶
func (this *AuthController) LoadUserToken() string
type AuthControllerInterface ¶
type AuthControllerInterface interface { GetUserAuthImpl() AuthImplInterface LoadUserToken() string LoadUserContext() interface{} CheckUserPrivilege(requiredPrivilege interface{}) bool CheckUserIsClientManagerOrSelf(targetUserId interface{}) bool }
type AuthImplInterface ¶
type AuthImplInterface interface { TokenKey() string LoadUserToken(c ControllerInterface) string LoadTokenObj(token string) interface{} SaveTokenObj(token string, obj interface{}) CheckUserPrivilege(userContext interface{}, requiredPrivilege interface{}) bool IsClientManagerOrSelf(userContext interface{}, targetUserId interface{}) bool }
var DefaultAuthImpl AuthImplInterface
type Controller ¶
func (*Controller) AjaxDbList ¶
func (*Controller) AjaxDbRecord ¶
func (this *Controller) AjaxDbRecord(ob interface{}, oldCodeFormat ...bool)
func (*Controller) AjaxError ¶
func (this *Controller) AjaxError(message string, codes ...int)
func (*Controller) AjaxMsg ¶
func (this *Controller) AjaxMsg(code int, data interface{}, message ...string)
func (*Controller) AjaxUnAuthorized ¶
func (this *Controller) AjaxUnAuthorized(message string, codes ...int)
func (*Controller) Cookie ¶
func (this *Controller) Cookie(key string) *http.Cookie
Cookie returns request cookie item string by a given key. if non-existed, return empty string.
func (*Controller) CookieValue ¶
func (this *Controller) CookieValue(key string) string
func (*Controller) GetClientIpAddr ¶
func (this *Controller) GetClientIpAddr() string
func (*Controller) GetInt64 ¶
func (this *Controller) GetInt64(key string, defValues ...int64) int64
func (*Controller) GetPageableFromRequest ¶
func (this *Controller) GetPageableFromRequest() *pkBeans.Pageable
func (*Controller) GetRequest ¶
func (this *Controller) GetRequest() *http.Request
func (*Controller) GetResponseWriter ¶
func (this *Controller) GetResponseWriter() http.ResponseWriter
func (*Controller) GetString ¶
func (this *Controller) GetString(key string, defValues ...string) string
func (*Controller) Header ¶
func (this *Controller) Header(key string) string
Header returns request header item string by a given string. if non-existed, return empty string.
func (*Controller) JsonResult ¶
func (this *Controller) JsonResult(out interface{})
func (*Controller) OnLeave ¶
func (this *Controller) OnLeave()
func (*Controller) OnPrepare ¶
func (this *Controller) OnPrepare()
func (*Controller) Query ¶
func (this *Controller) Query(key string) string
\param key string, ":k": search in url path paramters, else search in url paramters
func (*Controller) Redirect ¶
func (this *Controller) Redirect(url string)
func (*Controller) RenderViewSimple ¶
func (this *Controller) RenderViewSimple(viewPath string, args ...interface{})
func (*Controller) RequestBodyToJsonObject ¶
func (this *Controller) RequestBodyToJsonObject(ob interface{}) error
func (*Controller) SetCookieValue ¶
func (this *Controller) SetCookieValue(key string, val string, maxAgeSecondss ...int)
func (*Controller) SetRequest ¶
func (this *Controller) SetRequest(r *http.Request)
func (*Controller) SetResponseWriter ¶
func (this *Controller) SetResponseWriter(w http.ResponseWriter)
func (*Controller) SetUrlParameters ¶
func (this *Controller) SetUrlParameters(p map[string]string)
type ControllerInterface ¶
type ControllerInterface interface { OnPrepare() OnLeave() RenderViewSimple(viewPath string, args ...interface{}) SetUrlParameters(p map[string]string) SetResponseWriter(w http.ResponseWriter) GetResponseWriter() http.ResponseWriter SetRequest(r *http.Request) GetRequest() *http.Request RequestBodyToJsonObject(ob interface{}) error GetClientIpAddr() string AjaxError(message string, codes ...int) Header(key string) string SetCookieValue(key string, val string, maxAgeSecondss ...int) CookieValue(key string) string GetInt(key string, defValues ...int) int GetInt64(key string, defValues ...int64) int64 GetString(key string, defValues ...string) string }
Click to show internal directories.
Click to hide internal directories.