generated

package
v0.0.0-...-1efb92b Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 13 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 CheckSms

type CheckSms struct {
	Ok bool `json:"ok"`
}

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
	}

	CheckSMS struct {
		Ok func(childComplexity int) int
	}

	Friendships struct {
		Friendships func(childComplexity int) int
	}

	Mutation struct {
		Healthcheck      func(childComplexity int) int
		SendSms          func(childComplexity int, input *PhoneInput) int
		UploadFile       func(childComplexity int, file graphql.Upload) int
		UserRegistration func(childComplexity int, input *UserRegistration) int
	}

	Query struct {
		Captcha     func(childComplexity int) int
		CheckSms    func(childComplexity int, smsID string, smsCode string) int
		Friendship  func(childComplexity int) int
		Healthcheck func(childComplexity int) int
		Now         func(childComplexity int) int
		SearchUser  func(childComplexity int, keyword string) int
		User        func(childComplexity int) int
		UserLogin   func(childComplexity int, smsID string, smsCode string) int
	}

	Result struct {
		Ok func(childComplexity int) int
	}

	SMS struct {
		SmsID func(childComplexity int) int
	}

	SearchUser struct {
		Users func(childComplexity int) int
	}

	UserInformation struct {
		About     func(childComplexity int) int
		Account   func(childComplexity int) int
		AccountID func(childComplexity int) int
		Avatar    func(childComplexity int) int
		Birthday  func(childComplexity int) int
		Email     func(childComplexity int) int
		FullName  func(childComplexity int) int
		NickName  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 Friendships

type Friendships struct {
	Friendships []UserInformation `json:"friendships"`
}

type MutationResolver

type MutationResolver interface {
	Healthcheck(ctx context.Context) (string, error)
	UploadFile(ctx context.Context, file graphql.Upload) (string, error)
	SendSms(ctx context.Context, input *PhoneInput) (*Sms, error)
	UserRegistration(ctx context.Context, input *UserRegistration) (*AuthPayload, error)
}

type PhoneInput

type PhoneInput struct {
	PhoneNumber string `json:"phoneNumber"`
}

type QueryResolver

type QueryResolver interface {
	Healthcheck(ctx context.Context) (string, error)
	Now(ctx context.Context) (*timestamppb.Timestamp, error)
	User(ctx context.Context) (*UserInformation, error)
	CheckSms(ctx context.Context, smsID string, smsCode string) (*CheckSms, error)
	Captcha(ctx context.Context) (*Captcha, error)
	UserLogin(ctx context.Context, smsID string, smsCode string) (*AuthPayload, error)
	Friendship(ctx context.Context) (*Friendships, error)
	SearchUser(ctx context.Context, keyword string) (*SearchUser, error)
}

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 Result

type Result struct {
	Ok bool `json:"ok"`
}

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 SearchUser

type SearchUser struct {
	Users []UserInformation `json:"users"`
}

type Sms

type Sms struct {
	SmsID string `json:"smsId"`
}

type UserInformation

type UserInformation struct {
	AccountID string `json:"accountId"`
	Account   string `json:"account"`
	FullName  string `json:"fullName"`
	NickName  string `json:"nickName"`
	Birthday  string `json:"birthday"`
	Email     string `json:"email"`
	About     string `json:"about"`
	Avatar    string `json:"avatar"`
}

type UserRegistration

type UserRegistration struct {
	FullName string `json:"fullName"`
	NickName string `json:"nickName"`
	Birthday string `json:"birthday"`
	Email    string `json:"email"`
	About    string `json:"about"`
	Avatar   string `json:"avatar"`
	SmsID    string `json:"smsId"`
	SmsCode  string `json:"smsCode"`
}

Jump to

Keyboard shortcuts

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