web

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditReq

type EditReq struct {
	Avatar   string `json:"avatar"`
	Nickname string `json:"nickname"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(

	weSvc service.OAuth2Service,

	weMiniSvc service.OAuth2Service,
	userSvc service.UserService,
	memberSvc member.Service,
	permissionSvc permission.Service,
	sp session.Provider,
	creators []string) *Handler

func (*Handler) Callback

func (h *Handler) Callback(ctx *ginx.Context, req WechatCallback) (ginx.Result, error)

func (*Handler) Edit

func (h *Handler) Edit(ctx *ginx.Context, req EditReq, sess session.Session) (ginx.Result, error)

Edit 用户编辑信息

func (*Handler) Logout added in v0.3.3

func (h *Handler) Logout(ctx *ginx.Context) (ginx.Result, error)

func (*Handler) MiniCallback added in v0.1.3

func (h *Handler) MiniCallback(ctx *ginx.Context, req WechatCallback) (ginx.Result, error)

MiniCallback 微信小程序登录回调

func (*Handler) MockLogin added in v0.1.0

func (h *Handler) MockLogin(ctx *ginx.Context) (ginx.Result, error)

func (*Handler) PrivateRoutes

func (h *Handler) PrivateRoutes(server *gin.Engine)

func (*Handler) Profile

func (h *Handler) Profile(ctx *ginx.Context, sess session.Session) (ginx.Result, error)

func (*Handler) PublicRoutes

func (h *Handler) PublicRoutes(server *gin.Engine)

func (*Handler) RefreshAccessToken

func (h *Handler) RefreshAccessToken(ctx *ginx.Context) (ginx.Result, error)

func (*Handler) WechatAuthURL

func (h *Handler) WechatAuthURL(ctx *ginx.Context) (ginx.Result, error)

type Profile

type Profile struct {
	Id        int64  `json:"id,omitempty"`
	Nickname  string `json:"nickname,omitempty"`
	Avatar    string `json:"avatar,omitempty"`
	SN        string `json:"sn,omitempty"`
	IsCreator bool   `json:"isCreator,omitempty"`
	// 毫秒数
	MemberDDL int64 `json:"memberDDL,omitempty"`
}

type WechatCallback

type WechatCallback struct {
	Code  string `json:"code"`
	State string `json:"state"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL