generated

package
v0.0.0-...-7d7365f Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 15 Imported by: 0

README

DO NOT EDIT ANY CODE IN THIS DIRECTORY

禁止修改此目录下的任何代码

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllRole = []Role{
	RoleGeneralUser,
	RoleAdmin,
}

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type AuthPayload

type AuthPayload struct {
	AccessTokenString string `json:"accessTokenString"`
	UserID            string `json:"userID"`
}

type Captcha

type Captcha struct {
	Base64Captcha string `json:"base64Captcha"`
	CaptchaID     string `json:"captchaId"`
}

type ComplexityRoot

type ComplexityRoot struct {
	AuthPayload struct {
		AccessTokenString func(childComplexity int) int
		UserID            func(childComplexity int) int
	}

	Captcha struct {
		Base64Captcha func(childComplexity int) int
		CaptchaID     func(childComplexity int) int
	}

	Mutation struct {
		Healthcheck     func(childComplexity int) int
		LoginByPassword func(childComplexity int, input *LoginByPassword) int
		Registry        func(childComplexity int, input *Registry) int
	}

	Query struct {
		Captcha     func(childComplexity int) int
		Healthcheck func(childComplexity int) int
		Now         func(childComplexity int) int
		User        func(childComplexity int) int
	}

	UserInformation struct {
		Account     func(childComplexity int) int
		AccountID   func(childComplexity int) int
		AccountName func(childComplexity int) int
		Role        func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
	OAuth      func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	HasLogined func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type LoginByPassword

type LoginByPassword struct {
	CaptchaID   string `json:"captchaID"`
	CaptchaCode string `json:"captchaCode"`
	Account     string `json:"account"`
	Password    string `json:"password"`
}

type MutationResolver

type MutationResolver interface {
	Healthcheck(ctx context.Context) (string, error)
	LoginByPassword(ctx context.Context, input *LoginByPassword) (*AuthPayload, error)
	Registry(ctx context.Context, input *Registry) (*wrapperspb.BoolValue, error)
}

type QueryResolver

type QueryResolver interface {
	Healthcheck(ctx context.Context) (string, error)
	Now(ctx context.Context) (*timestamppb.Timestamp, error)
	User(ctx context.Context) (*UserInformation, error)
	Captcha(ctx context.Context) (*Captcha, error)
}

type Registry

type Registry struct {
	CaptchaID   string `json:"captchaID"`
	CaptchaCode string `json:"captchaCode"`
	Account     string `json:"account"`
	Name        string `json:"name"`
	Password    string `json:"password"`
}

type Resolver

type Resolver struct{}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns MutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
}

type Role

type Role string
const (
	RoleGeneralUser Role = "GeneralUser"
	RoleAdmin       Role = "Admin"
)

func (Role) IsValid

func (e Role) IsValid() bool

func (Role) MarshalGQL

func (e Role) MarshalGQL(w io.Writer)

func (Role) String

func (e Role) String() string

func (*Role) UnmarshalGQL

func (e *Role) UnmarshalGQL(v interface{}) error

type UserInformation

type UserInformation struct {
	AccountID   string `json:"accountId"`
	Role        Role   `json:"role"`
	Account     string `json:"account"`
	AccountName string `json:"accountName"`
}

Jump to

Keyboard shortcuts

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