api

package
v0.0.0-...-997d260 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthController

type AuthController struct {
	g.Meta `path:"/"`
}

func (AuthController) Login

func (AuthController) Login(ctx context.Context, req *LoginReq) (res *res.AccessTokenRes, err error)

func (AuthController) Register

func (AuthController) Register(ctx context.Context, req *RegisterReq) (res *RegisterRes, err error)

type CallbackReq

type CallbackReq struct {
	g.Meta `path:"/callback" method:"get" auth:"false"`
}

type CallbackRes

type CallbackRes struct {
	Id          string    `json:"id"`
	AccessToken string    `json:"accessToken"`
	ExpiresAt   time.Time `json:"expires"`
}

type CaptchaController

type CaptchaController struct {
	g.Meta `path:"/captcha"`
}

type ChangePasswordReq

type ChangePasswordReq struct {
	g.Meta      `path:"/changePassword" method:"post"`
	Password    string `json:"password" example:"密码"`
	NewPassword string `json:"newPassword" example:"新密码"`
}

ChangePasswordReq @Description:

type ChangePasswordRes

type ChangePasswordRes struct {
}

type GenerateReq

type GenerateReq struct {
	g.Meta `path:"/" method:"post"`
}

type GenerateRes

type GenerateRes struct {
}

type GetLoginUrlReq

type GetLoginUrlReq struct {
	g.Meta `path:"/getLoginUrl" method:"get" auth:"false"`
}

type GetLoginUrlRes

type GetLoginUrlRes struct {
	Url string
}

type LoginReq

type LoginReq struct {
	g.Meta    `path:"/login" method:"post" auth:"false" `
	Captcha   string `json:"captcha" example:"验证码"`
	Username  string `json:"username" example:"用户名"`
	Password  string `json:"password" example:"密码"`
	CaptchaId string `json:"captchaId" example:"验证码id"`
}

LoginReq -----------------------------------------------------

type MeReq

type MeReq struct {
	g.Meta `path:"/me" method:"post" per:"false"`
}

MeReq -----------------------------------------------------

type MeRes

type MeRes struct {
	model.User
}

type OauthController

type OauthController struct {
	g.Meta `path:"/oauth/casdoor"`
}

func (*OauthController) Callback

func (OauthController *OauthController) Callback(ctx context.Context, req *CallbackReq) (*CallbackRes, error)

func (*OauthController) GetLoginUrl

func (OauthController *OauthController) GetLoginUrl(ctx context.Context, req *GetLoginUrlReq) (*GetLoginUrlRes, error)

type RegisterReq

type RegisterReq struct {
	g.Meta   `path:"/register" method:"post" auth:"false"`
	Avatar   string `json:"avatar"`
	Username string `json:"username"`
	Password string `json:"password"`
	NickName string `json:"nickName"`
}

RegisterReq -----------------------------------------------------

type RegisterRes

type RegisterRes struct {
	Id uint
}

type UpdateReq

type UpdateReq struct {
	g.Meta   `path:"/update" method:"post"`
	Avatar   string `json:"avatar" example:"用户头像"`
	NickName string `json:"nickName" example:"用户昵称"`
}

UpdateReq -----------------------------------------------------

type UpdateRes

type UpdateRes struct {
	model.User
}

type UserController

type UserController struct {
	g.Meta `path:"/user"`
}

func (UserController) ChangePassword

func (UserController) ChangePassword(ctx context.Context, req *ChangePasswordReq) (res *ChangePasswordRes, err error)

ChangePassword @Description: @receiver UserController @param ctx @param req @return *response.Response

func (UserController) Generate

func (UserController) Me

func (UserController) Me(ctx context.Context, req *MeReq) (res *MeRes, err error)

func (UserController) Update

func (UserController) Update(ctx context.Context, req *UpdateReq) (res *UpdateRes, err error)

Jump to

Keyboard shortcuts

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