Documentation ¶
Index ¶
- Constants
- Variables
- func GetWebMsgCode(errMsg string) string
- func InitHttpDemo(r *gin.Engine)
- type ApiResp
- type Auth
- func (a Auth) CheckAuth(c *gin.Context) error
- func (a Auth) DemoGetFn(ctx *gin.Context, req *DemoFnReq) (resp *DemoFnResp, err error)
- func (a Auth) DemoPostFn(ctx *gin.Context, req *DemoFnReq) (resp *DemoFnResp, err error)
- func (a Auth) SendBad(c *gin.Context, errMsg string)
- func (a Auth) SendOk(c *gin.Context, body any)
- func (a Auth) UriToFnName(uri string) string
- type Customer
- type DemoFnReq
- type DemoFnResp
- type WebError
Constants ¶
View Source
const CheckAuthErrMsg = "权限不足2333"
Variables ¶
View Source
var AuthObj = Auth{ UriToFnNameM: map[string]string{ "vege_api": "VegeApi", }, }
View Source
var CustomerObj = Customer{ UriToFnNameM: map[string]string{ "vege_api": "VegeApi", }, }
View Source
var JwtDefaultReq midware.JwtReq
Functions ¶
func GetWebMsgCode ¶ added in v1.0.15
func InitHttpDemo ¶
Types ¶
type ApiResp ¶
type ApiResp struct { Code string `json:"code"` Msg string `json:"msg"` Data any `json:"data,omitempty" swaggerignore:"true"` }
所有200 的接口 resp 为ApiResp
type Auth ¶ added in v1.1.1
func (Auth) DemoPostFn ¶ added in v1.1.1
func (Auth) UriToFnName ¶ added in v1.1.1
type Customer ¶ added in v1.1.1
func (Customer) UriToFnName ¶ added in v1.1.1
type DemoFnResp ¶ added in v1.0.15
type WebError ¶ added in v1.0.15
type WebError struct {
// contains filtered or unexported fields
}
func GetWebErrorFromErrMsg ¶ added in v1.0.15
Click to show internal directories.
Click to hide internal directories.