services

package
v0.0.0-...-c9b56a8 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwardSimple

type AwardSimple struct {
	AwardRanking string
	ProveImgURL  string
}

组队系统中查找用户,需要信息包括:头像、真实姓名、昵称、学院、获奖情况等

type FindUserInTeamReq

type FindUserInTeamReq struct {
	ProjectID uint
}

type FindUserInTeamRes

type FindUserInTeamRes struct {
	AvatarURI    string
	RealName     string
	NickName     string
	School       string //通过Student
	AwardSimples []AwardSimple
}

type GetProfileReq

type GetProfileReq struct {
}

type GetProfileRes

type GetProfileRes struct {
	User    models.User
	Student models.Student
}

type PatchProfileReq

type PatchProfileReq struct {
	Gender      null.Bool
	NickName    string
	Password    string
	RealName    string
	University  string
	School      string
	UntrustedID string
	TrustedID   string
	UserName    string
}

type PatchProfileRes

type PatchProfileRes struct {
	Completed bool
}

type SMSCodeLoginReq

type SMSCodeLoginReq struct {
	PhoneNumber string `validate:"required,e164"` // like +86xxxxxx
	Code        string `validate:"required,numeric,len=6"`
	Session     string `validate:"required"`
}

type SMSCodeLoginRes

type SMSCodeLoginRes struct {
	TokenUser *auth.TokenUser
	User      *models.User
}

type SMSSendCodeReq

type SMSSendCodeReq struct {
	PhoneNumber string `validate:"required,e164"` // like +86xxxxxx
}

type SMSSendCodeRes

type SMSSendCodeRes struct {
	Session string
}

type UserLoginReq

type UserLoginReq struct {
	UserName string
	Password string
}

type UserLoginRes

type UserLoginRes struct {
	Token string
}

type UserService

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

func NewUserService

func NewUserService(db *gorm.DB) *UserService

func (*UserService) FindUserInTeam

func (s *UserService) FindUserInTeam(ctx *rpc.Context, req *FindUserInTeamReq, res *FindUserInTeamRes) (err error)

func (*UserService) GetProfile

func (s *UserService) GetProfile(ctx *rpc.Context, req *GetProfileReq, res *GetProfileRes) (err error)

func (*UserService) Login

func (s *UserService) Login(ctx context.Context, req *UserLoginReq, res *UserLoginRes) (err error)

用户名、密码组合登陆

func (*UserService) PatchProfile

func (s *UserService) PatchProfile(ctx *rpc.Context, req *PatchProfileReq, res *PatchProfileRes) error

func (*UserService) SMSCodeLogin

func (s *UserService) SMSCodeLogin(ctx *rpc.Context, req *SMSCodeLoginReq, res *SMSCodeLoginRes) (err error)

手机号验证码登陆

func (*UserService) SMSSendCode

func (s *UserService) SMSSendCode(ctx *rpc.Context, req *SMSSendCodeReq, res *SMSSendCodeRes) (err error)

手机号验证码登陆/发送验证码

Jump to

Keyboard shortcuts

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