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) LoginByPassword(ctx context.Context, account, password, mode 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) SetUserPassword(ctx context.Context, uuid, password string) error
- func (r *AuthUseCase) SetUserPhone(ctx context.Context, uuid, phone, code string) error
- func (r *AuthUseCase) UnbindUserEmail(ctx context.Context, uuid, email, code string) error
- func (r *AuthUseCase) UnbindUserPhone(ctx context.Context, uuid, phone, code string) error
- func (r *AuthUseCase) UserRegister(ctx context.Context, email, password, code string) error
- type Credentials
- type Follow
- type Follows
- 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
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 { FindUserByPhone(ctx context.Context, phone string) (*User, error) FindUserByEmail(ctx context.Context, email string) (*User, error) CreateUserWithPhone(ctx context.Context, phone string) (*User, error) CreateUserWithEmail(ctx context.Context, email, password string) (*User, error) CreateUserProfile(ctx context.Context, account, uuid string) error CreateUserProfileUpdate(ctx context.Context, account, uuid 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 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 }
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) LoginByPassword ¶
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) 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) UnbindUserEmail ¶
func (r *AuthUseCase) UnbindUserEmail(ctx context.Context, uuid, email, code string) error
func (*AuthUseCase) UnbindUserPhone ¶
func (r *AuthUseCase) UnbindUserPhone(ctx context.Context, uuid, phone, code string) error
func (*AuthUseCase) UserRegister ¶
func (r *AuthUseCase) UserRegister(ctx context.Context, email, password, code string) error
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 ¶ added in v1.2.0
func (v ImageReview) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ImageReview) MarshalJSON ¶ added in v1.2.0
func (v ImageReview) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ImageReview) UnmarshalEasyJSON ¶ added in v1.2.0
func (v *ImageReview) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ImageReview) UnmarshalJSON ¶ added in v1.2.0
func (v *ImageReview) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ProfileUpdate ¶
func (ProfileUpdate) MarshalEasyJSON ¶ added in v1.2.0
func (v ProfileUpdate) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProfileUpdate) MarshalJSON ¶ added in v1.2.0
func (v ProfileUpdate) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProfileUpdate) UnmarshalEasyJSON ¶ added in v1.2.0
func (v *ProfileUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProfileUpdate) UnmarshalJSON ¶ added in v1.2.0
func (v *ProfileUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ProfileUpdateMap ¶ added in v1.2.0
func (ProfileUpdateMap) MarshalEasyJSON ¶ added in v1.2.0
func (v ProfileUpdateMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProfileUpdateMap) MarshalJSON ¶ added in v1.2.0
func (v ProfileUpdateMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProfileUpdateMap) UnmarshalEasyJSON ¶ added in v1.2.0
func (v *ProfileUpdateMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProfileUpdateMap) UnmarshalJSON ¶ added in v1.2.0
func (v *ProfileUpdateMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SendUserStatisticMap ¶ added in v1.2.0
func (SendUserStatisticMap) MarshalEasyJSON ¶ added in v1.2.0
func (v SendUserStatisticMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SendUserStatisticMap) MarshalJSON ¶ added in v1.2.0
func (v SendUserStatisticMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SendUserStatisticMap) UnmarshalEasyJSON ¶ added in v1.2.0
func (v *SendUserStatisticMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SendUserStatisticMap) UnmarshalJSON ¶ added in v1.2.0
func (v *SendUserStatisticMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SetFollowMap ¶ added in v1.2.0
func (SetFollowMap) MarshalEasyJSON ¶ added in v1.2.0
func (v SetFollowMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SetFollowMap) MarshalJSON ¶ added in v1.2.0
func (v SetFollowMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SetFollowMap) UnmarshalEasyJSON ¶ added in v1.2.0
func (v *SetFollowMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SetFollowMap) UnmarshalJSON ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (UserSearchMap) MarshalEasyJSON ¶ added in v1.2.0
func (v UserSearchMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserSearchMap) MarshalJSON ¶ added in v1.2.0
func (v UserSearchMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserSearchMap) UnmarshalEasyJSON ¶ added in v1.2.0
func (v *UserSearchMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserSearchMap) UnmarshalJSON ¶ added in v1.2.0
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