Documentation ¶
Index ¶
- Constants
- func CacheUserJson2Session(token string, userJson string)
- func DeleteSession(token string)
- func GetAccessToken(ctx *gin.Context) string
- func GetCurrentUserJson() string
- func GetUserJsonByToken(token string) string
- func NewBizErr(msg string) error
- func NewBizErr2(code int, msg string) error
- func SameAsStruct(rtResult reflect.Type) bool
- func StartHttpServer(register IGinConfiguration)
- func StartHttpServerDefault()
- type DefaultGinConfiguration
- type IController
- type IGinConfiguration
- type MvcPostProcessor
- type MvcPreProcessor
- type RestController
- type Result
Constants ¶
View Source
const ( AccessToken = "accessToken" // 请求token变量名 RequireLogin = "RequireLogin" // Tag的value项,Permission的固定选项值 )
View Source
const ( Path = "Path" Permission = "Permission" // 权限tag,支持整个controller类和属性 Default = "default" // 默认值tag )
controller类tag,代表整个controller的统一属性
View Source
const ( GetMapping = "GetMapping" PostMapping = "PostMapping" PutMapping = "PutMapping" DeleteMapping = "DeleteMapping" MappingHandler = "MappingHandler" RequestParam = "RequestParam" )
controller字段tag,这里表示的是方法的属性
View Source
const ( SucCode = 200 SucResult = true FailCode = -1 FailResult = false )
Variables ¶
This section is empty.
Functions ¶
func CacheUserJson2Session ¶
func DeleteSession ¶
func DeleteSession(token string)
func GetAccessToken ¶
func GetCurrentUserJson ¶
func GetCurrentUserJson() string
func GetUserJsonByToken ¶
func NewBizErr2 ¶
func SameAsStruct ¶
func StartHttpServer ¶
func StartHttpServer(register IGinConfiguration)
Types ¶
type DefaultGinConfiguration ¶
type DefaultGinConfiguration struct { }
func (*DefaultGinConfiguration) ContextPath ¶
func (dgc *DefaultGinConfiguration) ContextPath() string
func (*DefaultGinConfiguration) RegisControllers ¶
func (dgc *DefaultGinConfiguration) RegisControllers() []IController
func (*DefaultGinConfiguration) ServerPort ¶
func (dgc *DefaultGinConfiguration) ServerPort() string
type IController ¶
type IController interface {
RequestMapping() string
}
type IGinConfiguration ¶
type IGinConfiguration interface { // ContextPath 项目路径配置 ContextPath() string // ServerPort 服务端口配置 ServerPort() string // RegisControllers 注册控制器 RegisControllers() []IController }
IGinConfiguration 接口,要使用ginplus必须实现该接口
type MvcPostProcessor ¶
type MvcPostProcessor interface { }
type MvcPreProcessor ¶
type MvcPreProcessor interface { }
type RestController ¶
type RestController struct {
Path string
}
RestController 所有控制器需要继承的父类
func (RestController) RequestMapping ¶
func (rc RestController) RequestMapping() string
Click to show internal directories.
Click to hide internal directories.