Documentation
¶
Index ¶
- Variables
- type AuthRepo
- type AuthUseCase
- func (r *AuthUseCase) ChangeUserPassword(ctx context.Context, uuid, oldpassword, password string) error
- func (r *AuthUseCase) GetCosSessionKey(ctx context.Context, uuid string) (*Credentials, error)
- func (r *AuthUseCase) LoginByCode(ctx context.Context, phone, code string) (string, error)
- func (r *AuthUseCase) LoginByGitee(ctx context.Context, code string) (string, error)
- func (r *AuthUseCase) LoginByGithub(ctx context.Context, code string) (*Github, error)
- func (r *AuthUseCase) LoginByPassword(ctx context.Context, account, password, mode string) (string, error)
- func (r *AuthUseCase) LoginByQQ(ctx context.Context, code string) (string, error)
- func (r *AuthUseCase) LoginByWechat(ctx context.Context, code string) (string, error)
- func (r *AuthUseCase) LoginPasswordReset(ctx context.Context, account, password, code, mode string) error
- func (r *AuthUseCase) SendEmailCode(ctx context.Context, template, email string) error
- func (r *AuthUseCase) SendPhoneCode(ctx context.Context, template, phone string) error
- func (r *AuthUseCase) SetUserEmail(ctx context.Context, uuid, email, code string) error
- func (r *AuthUseCase) SetUserGitee(ctx context.Context, uuid, code, redirectUrl string) error
- func (r *AuthUseCase) SetUserGithub(ctx context.Context, uuid, code string) error
- func (r *AuthUseCase) SetUserPassword(ctx context.Context, uuid, password string) error
- func (r *AuthUseCase) SetUserPhone(ctx context.Context, uuid, phone, code string) error
- func (r *AuthUseCase) SetUserQQ(ctx context.Context, uuid, code string) error
- func (r *AuthUseCase) SetUserWechat(ctx context.Context, uuid, code string) error
- func (r *AuthUseCase) UnbindUserEmail(ctx context.Context, ...) error
- func (r *AuthUseCase) UnbindUserGitee(ctx context.Context, ...) error
- func (r *AuthUseCase) UnbindUserGithub(ctx context.Context, ...) error
- func (r *AuthUseCase) UnbindUserPhone(ctx context.Context, ...) error
- func (r *AuthUseCase) UnbindUserQQ(ctx context.Context, ...) error
- func (r *AuthUseCase) UnbindUserWechat(ctx context.Context, ...) error
- func (r *AuthUseCase) UserRegister(ctx context.Context, email, password, code string) error
- func (r *AuthUseCase) VerifyAccount(ctx context.Context, ...) (*User, error)
- type Credentials
- type Follow
- type Follows
- type Github
- type ImageReview
- type Profile
- type ProfileUpdate
- type ProfileUpdateMap
- type Recovery
- type SendUserStatisticMap
- type SetFollowMap
- type Transaction
- type User
- type UserRepo
- type UserSearch
- type UserSearchMap
- type UserUseCase
- func (r *UserUseCase) AddAvatarReviewDbAndCache(ctx context.Context, review *ImageReview) error
- func (r *UserUseCase) AddCoverReviewDbAndCache(ctx context.Context, review *ImageReview) error
- func (r *UserUseCase) AvatarIrregular(ctx context.Context, review *ImageReview) error
- func (r *UserUseCase) CancelFollowDbAndCache(ctx context.Context, uuid, userId string) error
- func (r *UserUseCase) CancelUserFollow(ctx context.Context, uuid, userId string) error
- func (r *UserUseCase) CoverIrregular(ctx context.Context, review *ImageReview) error
- func (r *UserUseCase) GetAccount(ctx context.Context, uuid string) (*User, error)
- func (r *UserUseCase) GetAvatarReview(ctx context.Context, page int32, uuid string) ([]*ImageReview, error)
- func (r *UserUseCase) GetCoverReview(ctx context.Context, page int32, uuid string) ([]*ImageReview, error)
- func (r *UserUseCase) GetFollowList(ctx context.Context, page int32, uuid string) ([]*Follow, error)
- func (r *UserUseCase) GetFollowListCount(ctx context.Context, uuid string) (int32, error)
- func (r *UserUseCase) GetFollowedList(ctx context.Context, page int32, uuid string) ([]*Follow, error)
- func (r *UserUseCase) GetFollowedListCount(ctx context.Context, uuid string) (int32, error)
- func (r *UserUseCase) GetProfile(ctx context.Context, uuid string) (*Profile, error)
- func (r *UserUseCase) GetProfileList(ctx context.Context, uuids []string) ([]*Profile, error)
- func (r *UserUseCase) GetProfileUpdate(ctx context.Context, uuid string) (*ProfileUpdate, error)
- func (r *UserUseCase) GetUserFollow(ctx context.Context, uuid, userUuid string) (bool, error)
- func (r *UserUseCase) GetUserFollows(ctx context.Context, uuid string) (map[string]bool, error)
- func (r *UserUseCase) GetUserSearch(ctx context.Context, page int32, search string) ([]*UserSearch, int32, error)
- func (r *UserUseCase) ProfileReviewNotPass(ctx context.Context, uuid string) error
- func (r *UserUseCase) ProfileReviewPass(ctx context.Context, uuid, update string) error
- func (r *UserUseCase) SetFollowDbAndCache(ctx context.Context, uuid, userId string) error
- func (r *UserUseCase) SetProfileUpdate(ctx context.Context, profile *ProfileUpdate) error
- func (r *UserUseCase) SetUserFollow(ctx context.Context, uuid, userId string) error
- type ValidateUseCase
Constants ¶
This section is empty.
Variables ¶
var ProviderSet = wire.NewSet(NewUserUseCase, NewAuthUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type AuthRepo ¶
type AuthRepo interface {
GetWechatAccessToken(ctx context.Context, code string) (string, string, error)
GetQQAccessToken(ctx context.Context, code string) (string, error)
GetQQOpenId(ctx context.Context, token string) (string, error)
GetGithubAccessToken(ctx context.Context, code string) (string, error)
GetGiteeAccessToken(ctx context.Context, code, redirectUrl string) (string, error)
GetWechatUserInfo(ctx context.Context, token, openid string) (map[string]interface{}, error)
GetQQUserInfo(ctx context.Context, token, openId string) (map[string]interface{}, error)
GetGithubUserInfo(ctx context.Context, token string) (map[string]interface{}, error)
GetGiteeUserInfo(ctx context.Context, token string) (map[string]interface{}, error)
FindUserByPhone(ctx context.Context, phone string) (*User, error)
FindUserByEmail(ctx context.Context, email string) (*User, error)
FindUserByWechat(ctx context.Context, wechat string) (*User, error)
FindUserByQQ(ctx context.Context, qq string) (*User, error)
FindUserByGithub(ctx context.Context, github int32) (*User, error)
FindUserByGitee(ctx context.Context, gitee int32) (*User, error)
CreateUserWithPhone(ctx context.Context, phone string) (*User, error)
CreateUserWithEmail(ctx context.Context, email, password string) (*User, error)
CreateUserWithWechat(ctx context.Context, wechat string) (*User, error)
CreateUserWithQQ(ctx context.Context, qq string) (*User, error)
CreateUserWithGithub(ctx context.Context, github int32) (*User, error)
CreateUserWithGitee(ctx context.Context, gitee int32) (*User, error)
CreateUserProfile(ctx context.Context, account, uuid string) error
CreateUserProfileWithGithub(ctx context.Context, account, github, uuid string) error
CreateUserProfileWithGitee(ctx context.Context, account, gitee, uuid string) error
CreateUserProfileUpdate(ctx context.Context, account, uuid string) error
CreateUserProfileUpdateWithGithub(ctx context.Context, account, uuid, github string) error
CreateUserProfileUpdateWithGitee(ctx context.Context, account, uuid, gitee string) error
CreateUserSearch(ctx context.Context, account, uuid string) error
SetUserPhone(ctx context.Context, uuid, phone string) error
SetUserEmail(ctx context.Context, uuid, email string) error
SetUserPassword(ctx context.Context, uuid, password string) error
SetUserWechat(ctx context.Context, uuid, wechat string) error
SetUserQQ(ctx context.Context, uuid, qq string) error
SetUserGitee(ctx context.Context, uuid string, gitee int32) error
SetUserGithub(ctx context.Context, uuid string, github int32) error
SetUserAvatar(ctx context.Context, uuid, avatar string)
SendPhoneCode(ctx context.Context, template, phone string) error
SendEmailCode(ctx context.Context, template, phone string) error
VerifyPhoneCode(ctx context.Context, phone, code string) error
VerifyEmailCode(ctx context.Context, email, code string) error
VerifyPassword(ctx context.Context, account, password, mode string) (*User, error)
PasswordResetByPhone(ctx context.Context, phone, password string) error
PasswordResetByEmail(ctx context.Context, email, password string) error
GetCosSessionKey(ctx context.Context, uuid string) (*Credentials, error)
UnbindUserPhone(ctx context.Context, uuid string) error
UnbindUserEmail(ctx context.Context, uuid string) error
UnbindUserWechat(ctx context.Context, uuid string) error
UnbindUserQQ(ctx context.Context, uuid string) error
UnbindUserGitee(ctx context.Context, uuid string) error
UnbindUserGithub(ctx context.Context, uuid string) error
}
type AuthUseCase ¶
type AuthUseCase struct {
// contains filtered or unexported fields
}
func NewAuthUseCase ¶
func NewAuthUseCase(conf *conf.Auth, repo AuthRepo, re Recovery, userRepo UserRepo, tm Transaction, logger log.Logger) *AuthUseCase
func (*AuthUseCase) ChangeUserPassword ¶
func (r *AuthUseCase) ChangeUserPassword(ctx context.Context, uuid, oldpassword, password string) error
func (*AuthUseCase) GetCosSessionKey ¶
func (r *AuthUseCase) GetCosSessionKey(ctx context.Context, uuid string) (*Credentials, error)
func (*AuthUseCase) LoginByCode ¶
func (*AuthUseCase) LoginByGitee ¶
func (*AuthUseCase) LoginByGithub ¶
func (*AuthUseCase) LoginByPassword ¶
func (*AuthUseCase) LoginByWechat ¶
func (*AuthUseCase) LoginPasswordReset ¶
func (r *AuthUseCase) LoginPasswordReset(ctx context.Context, account, password, code, mode string) error
func (*AuthUseCase) SendEmailCode ¶
func (r *AuthUseCase) SendEmailCode(ctx context.Context, template, email string) error
func (*AuthUseCase) SendPhoneCode ¶
func (r *AuthUseCase) SendPhoneCode(ctx context.Context, template, phone string) error
func (*AuthUseCase) SetUserEmail ¶
func (r *AuthUseCase) SetUserEmail(ctx context.Context, uuid, email, code string) error
func (*AuthUseCase) SetUserGitee ¶
func (r *AuthUseCase) SetUserGitee(ctx context.Context, uuid, code, redirectUrl string) error
func (*AuthUseCase) SetUserGithub ¶
func (r *AuthUseCase) SetUserGithub(ctx context.Context, uuid, code string) error
func (*AuthUseCase) SetUserPassword ¶
func (r *AuthUseCase) SetUserPassword(ctx context.Context, uuid, password string) error
func (*AuthUseCase) SetUserPhone ¶
func (r *AuthUseCase) SetUserPhone(ctx context.Context, uuid, phone, code string) error
func (*AuthUseCase) SetUserQQ ¶
func (r *AuthUseCase) SetUserQQ(ctx context.Context, uuid, code string) error
func (*AuthUseCase) SetUserWechat ¶
func (r *AuthUseCase) SetUserWechat(ctx context.Context, uuid, code string) error
func (*AuthUseCase) UnbindUserEmail ¶
func (r *AuthUseCase) UnbindUserEmail(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
func (*AuthUseCase) UnbindUserGitee ¶
func (r *AuthUseCase) UnbindUserGitee(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
func (*AuthUseCase) UnbindUserGithub ¶
func (r *AuthUseCase) UnbindUserGithub(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
func (*AuthUseCase) UnbindUserPhone ¶
func (r *AuthUseCase) UnbindUserPhone(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
func (*AuthUseCase) UnbindUserQQ ¶
func (r *AuthUseCase) UnbindUserQQ(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
func (*AuthUseCase) UnbindUserWechat ¶
func (r *AuthUseCase) UnbindUserWechat(ctx context.Context, uuid, phone, email, account, password, code, choose, mode, redirectUri string) error
func (*AuthUseCase) UserRegister ¶
func (r *AuthUseCase) UserRegister(ctx context.Context, email, password, code string) error
func (*AuthUseCase) VerifyAccount ¶
type Credentials ¶
type ImageReview ¶
type ImageReview struct {
Id int32
CreateAt string
Uuid string
JobId string
Url string
Label string
Result int32
Category string
SubLabel string
Mode string
Score int32
}
func (ImageReview) MarshalEasyJSON ¶
func (v ImageReview) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ImageReview) MarshalJSON ¶
func (v ImageReview) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ImageReview) UnmarshalEasyJSON ¶
func (v *ImageReview) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ImageReview) UnmarshalJSON ¶
func (v *ImageReview) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ProfileUpdate ¶
func (ProfileUpdate) MarshalEasyJSON ¶
func (v ProfileUpdate) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProfileUpdate) MarshalJSON ¶
func (v ProfileUpdate) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProfileUpdate) UnmarshalEasyJSON ¶
func (v *ProfileUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProfileUpdate) UnmarshalJSON ¶
func (v *ProfileUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ProfileUpdateMap ¶
func (ProfileUpdateMap) MarshalEasyJSON ¶
func (v ProfileUpdateMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProfileUpdateMap) MarshalJSON ¶
func (v ProfileUpdateMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProfileUpdateMap) UnmarshalEasyJSON ¶
func (v *ProfileUpdateMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProfileUpdateMap) UnmarshalJSON ¶
func (v *ProfileUpdateMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SendUserStatisticMap ¶
func (SendUserStatisticMap) MarshalEasyJSON ¶
func (v SendUserStatisticMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SendUserStatisticMap) MarshalJSON ¶
func (v SendUserStatisticMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SendUserStatisticMap) UnmarshalEasyJSON ¶
func (v *SendUserStatisticMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SendUserStatisticMap) UnmarshalJSON ¶
func (v *SendUserStatisticMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SetFollowMap ¶
func (SetFollowMap) MarshalEasyJSON ¶
func (v SetFollowMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SetFollowMap) MarshalJSON ¶
func (v SetFollowMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SetFollowMap) UnmarshalEasyJSON ¶
func (v *SetFollowMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SetFollowMap) UnmarshalJSON ¶
func (v *SetFollowMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Transaction ¶
type UserRepo ¶
type UserRepo interface {
GetAccount(ctx context.Context, uuid string) (*User, error)
GetProfile(ctx context.Context, uuid string) (*Profile, error)
GetProfileList(ctx context.Context, uuids []string) ([]*Profile, error)
GetUserFollow(ctx context.Context, uuid, userUuid string) (bool, error)
GetUserFollows(ctx context.Context, uuid string) ([]string, error)
GetProfileUpdate(ctx context.Context, uuid string) (*ProfileUpdate, error)
GetFollowList(ctx context.Context, page int32, uuid string) ([]*Follow, error)
GetFollowListCount(ctx context.Context, uuid string) (int32, error)
GetFollowedList(ctx context.Context, page int32, uuid string) ([]*Follow, error)
GetFollowedListCount(ctx context.Context, uuid string) (int32, error)
GetUserSearch(ctx context.Context, page int32, search string) ([]*UserSearch, int32, error)
GetAvatarReview(ctx context.Context, page int32, uuid string) ([]*ImageReview, error)
GetCoverReview(ctx context.Context, page int32, uuid string) ([]*ImageReview, error)
EditUserSearch(ctx context.Context, uuid string, profile *ProfileUpdate) error
SetAvatarIrregular(ctx context.Context, review *ImageReview) (*ImageReview, error)
SetAvatarIrregularToCache(ctx context.Context, review *ImageReview) error
SetCoverIrregular(ctx context.Context, review *ImageReview) (*ImageReview, error)
SetCoverIrregularToCache(ctx context.Context, review *ImageReview) error
SetProfile(ctx context.Context, profile *ProfileUpdate) error
SetProfileUpdate(ctx context.Context, profile *ProfileUpdate, status int32) (*ProfileUpdate, error)
SetUserFollow(ctx context.Context, uuid, userId string) error
SetUserFollowToCache(ctx context.Context, uuid, userId string) error
SetFollowToMq(ctx context.Context, follow *Follow, mode string) error
CancelUserFollow(ctx context.Context, uuid, userId string) error
CancelUserFollowFromCache(ctx context.Context, uuid, userId string) error
SendImageIrregularToMq(ctx context.Context, review *ImageReview) error
SendProfileToMq(ctx context.Context, profile *ProfileUpdate) error
SendUserStatisticToMq(ctx context.Context, uuid, userUuid, mode string) error
ModifyProfileUpdateStatus(ctx context.Context, uuid, update string) error
}
type UserSearch ¶
type UserSearchMap ¶
func (UserSearchMap) MarshalEasyJSON ¶
func (v UserSearchMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserSearchMap) MarshalJSON ¶
func (v UserSearchMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserSearchMap) UnmarshalEasyJSON ¶
func (v *UserSearchMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserSearchMap) UnmarshalJSON ¶
func (v *UserSearchMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UserUseCase ¶
type UserUseCase struct {
// contains filtered or unexported fields
}
func NewUserUseCase ¶
func NewUserUseCase(repo UserRepo, re Recovery, tm Transaction, logger log.Logger) *UserUseCase
func (*UserUseCase) AddAvatarReviewDbAndCache ¶
func (r *UserUseCase) AddAvatarReviewDbAndCache(ctx context.Context, review *ImageReview) error
func (*UserUseCase) AddCoverReviewDbAndCache ¶
func (r *UserUseCase) AddCoverReviewDbAndCache(ctx context.Context, review *ImageReview) error
func (*UserUseCase) AvatarIrregular ¶
func (r *UserUseCase) AvatarIrregular(ctx context.Context, review *ImageReview) error
func (*UserUseCase) CancelFollowDbAndCache ¶
func (r *UserUseCase) CancelFollowDbAndCache(ctx context.Context, uuid, userId string) error
func (*UserUseCase) CancelUserFollow ¶
func (r *UserUseCase) CancelUserFollow(ctx context.Context, uuid, userId string) error
func (*UserUseCase) CoverIrregular ¶
func (r *UserUseCase) CoverIrregular(ctx context.Context, review *ImageReview) error
func (*UserUseCase) GetAccount ¶
func (*UserUseCase) GetAvatarReview ¶
func (r *UserUseCase) GetAvatarReview(ctx context.Context, page int32, uuid string) ([]*ImageReview, error)
func (*UserUseCase) GetCoverReview ¶
func (r *UserUseCase) GetCoverReview(ctx context.Context, page int32, uuid string) ([]*ImageReview, error)
func (*UserUseCase) GetFollowList ¶
func (*UserUseCase) GetFollowListCount ¶
func (*UserUseCase) GetFollowedList ¶
func (*UserUseCase) GetFollowedListCount ¶
func (*UserUseCase) GetProfile ¶
func (*UserUseCase) GetProfileList ¶
func (*UserUseCase) GetProfileUpdate ¶
func (r *UserUseCase) GetProfileUpdate(ctx context.Context, uuid string) (*ProfileUpdate, error)
func (*UserUseCase) GetUserFollow ¶
func (*UserUseCase) GetUserFollows ¶
func (*UserUseCase) GetUserSearch ¶
func (r *UserUseCase) GetUserSearch(ctx context.Context, page int32, search string) ([]*UserSearch, int32, error)
func (*UserUseCase) ProfileReviewNotPass ¶
func (r *UserUseCase) ProfileReviewNotPass(ctx context.Context, uuid string) error
func (*UserUseCase) ProfileReviewPass ¶
func (r *UserUseCase) ProfileReviewPass(ctx context.Context, uuid, update string) error
func (*UserUseCase) SetFollowDbAndCache ¶
func (r *UserUseCase) SetFollowDbAndCache(ctx context.Context, uuid, userId string) error
func (*UserUseCase) SetProfileUpdate ¶
func (r *UserUseCase) SetProfileUpdate(ctx context.Context, profile *ProfileUpdate) error
func (*UserUseCase) SetUserFollow ¶
func (r *UserUseCase) SetUserFollow(ctx context.Context, uuid, userId string) error
type ValidateUseCase ¶
type ValidateUseCase struct{}
func NewValidateUseCase ¶
func NewValidateUseCase(conf *conf.Auth, repo AuthRepo, re Recovery, userRepo UserRepo, tm Transaction, logger log.Logger) *ValidateUseCase