restful

package
v0.0.0-...-6905dba Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: LGPL-2.1 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(ctx *gin.Context)

func AuthPassword

func AuthPassword(ctx *gin.Context)

func CreateUser

func CreateUser(ctx *gin.Context)

func GetUser

func GetUser(ctx *gin.Context)

func InitRestful

func InitRestful(w *scaffold.WebappScaffold)

func Login

func Login(ctx *gin.Context)

func SsoUserInfo

func SsoUserInfo(ctx *gin.Context)

func Token

func Token(ctx *gin.Context)

Types

type AuthPasswordRequest

type AuthPasswordRequest struct {
	UserName string `json:"user_name" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type AuthRequest

type AuthRequest struct {
	ResponseType string   `form:"response_type" binding:"required" json:"response_type"`
	ClientId     string   `form:"client_id" binding:"required" json:"client_id"`
	RedirectUri  string   `form:"redirect_uri" binding:"required" json:"redirect_uri"`
	Scope        []string `form:"scope" binding:"required" json:"scope"`
	State        string   `form:"state" binding:"required" json:"state"`
}

type CacheItem

type CacheItem struct {
	ClientId     string   `json:"client_id"`
	ClientSecret string   `json:"client_secret"`
	RedirectUri  string   `json:"redirect_uri"`
	Scope        []string `json:"scope"`
	State        string   `json:"state"`
	AuthCode     string   `json:"auth_code"`
	CallbackUrl  string   `json:"callback_url"`
	SsoAppId     int64    `json:"sso_app_id"`
	AppTokenId   int64    `json:"app_token_id"`

	UserId          int64  `json:"user_id"`
	UserName        string `json:"user_name"`
	UserDisplayName string `json:"user_display_name"`
}

type CreateUserRequest

type CreateUserRequest struct {
	UserType    int16  `json:"user_type" binding:"required"`
	UserName    string `json:"user_name" binding:"required"`
	Password    string `json:"password" binding:"required"`
	DisplayName string `json:"display_name" binding:"required"`
}

type GeneralFailReply

type GeneralFailReply struct {
	ErrorMessage string
}

type TokenFailReply

type TokenFailReply struct {
	Error string `json:"error"`
}

type TokenReply

type TokenReply struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"` // second
}

type TokenRequest

type TokenRequest struct {
	GrantType    string `form:"grant_type" binding:"required"`
	Code         string `form:"code" binding:"required"`
	RedirectUri  string `form:"redirect_uri" binding:"required"`
	ClientId     string `form:"client_id" binding:"required"`
	ClientSecret string `form:"client_secret" binding:"required"`
}

type UserInfo

type UserInfo struct {
	UserId          int64  `json:"user_id"`
	UserName        string `json:"user_name"`
	UserDisplayName string `json:"user_display_name"`
}

type UserResult

type UserResult struct {
	UserId      int64  `json:"user_id"`
	UserName    string `json:"user_name"`
	DisplayName string `json:"display_name"`
}

Jump to

Keyboard shortcuts

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