Documentation
¶
Index ¶
- Constants
- Variables
- type Address
- type AddressRepo
- type AddressUseCase
- func (uc *AddressUseCase) Create(ctx context.Context, addr *Address) error
- func (uc *AddressUseCase) Delete(ctx context.Context, id, userId int64) error
- func (uc *AddressUseCase) Get(ctx context.Context, id, userId int64) (*Address, error)
- func (uc *AddressUseCase) List(ctx context.Context, userId int64, page, pageSize int64) ([]*Address, int64, error)
- func (uc *AddressUseCase) Update(ctx context.Context, userId int64, addr *Address) error
- type User
- type UserRepo
- type UserUseCase
- func (uc *UserUseCase) CheckUserOK(ctx context.Context, id int64) (bool, error)
- func (uc *UserUseCase) GetUserById(ctx context.Context, id int64) (*User, error)
- func (uc *UserUseCase) LoginByUsername(ctx context.Context, user *User) (string, error)
- func (uc *UserUseCase) LoginByVerifyCode(ctx context.Context, mobile, code string) (string, error)
- func (uc *UserUseCase) Register(ctx context.Context, user *User) error
Constants ¶
View Source
const SystemBadRequestErrorMsg = "请求参数错误"
View Source
const SystemForbiddenErrorMsg = "暂无权限访问"
View Source
const SystemInternalErrorMsg = "系统繁忙,请稍后再试"
View Source
const SystemNotfoundErrorMsg = "数据不存在"
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewUserUseCase, NewAddressUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Id int64 UserId int64 Country string `validate:"required,min=1,max=50" label:"国家"` Province string `validate:"required,min=1,max=50" label:"省份"` City string `validate:"required,min=1,max=50" label:"城市"` CountryDistrict string `validate:"required,min=1,max=50" label:"县/区"` DetailedAddress string `validate:"required,min=1,max=50" label:"详细地址"` IsDefault int64 `validate:"oneof=1 2" label:"是否默认"` Status int64 `validate:"oneof=1 2" label:"状态"` }
type AddressRepo ¶
type AddressRepo interface { ListAddress(ctx context.Context, params map[string]interface{}, page, pageSize int) ([]*Address, int64, error) GetAddress(ctx context.Context, params map[string]interface{}) (*Address, error) CreateAddress(ctx context.Context, addr *Address) error UpdateAddress(ctx context.Context, addr *Address) error DeleteAddress(ctx context.Context, id int64) error }
type AddressUseCase ¶
type AddressUseCase struct {
// contains filtered or unexported fields
}
func NewAddressUseCase ¶
func NewAddressUseCase(repo AddressRepo, logger log.Logger) *AddressUseCase
func (*AddressUseCase) Create ¶
func (uc *AddressUseCase) Create(ctx context.Context, addr *Address) error
func (*AddressUseCase) Delete ¶
func (uc *AddressUseCase) Delete(ctx context.Context, id, userId int64) error
type User ¶
type User struct { Id int64 Username string `validate:"required,min=6,max=30" label:"用户名"` Password string `validate:"required,min=6,max=30" label:"密码"` Mobile string `validate:"required,numeric,len=11" label:"手机号码"` Nickname string `validate:"required,min=2,max=20" label:"昵称"` Avatar string `validate:"required,url,max=100" label:"头像"` Salt string LastLoginAt *time.Time Status int64 CreatedAt *time.Time UpdatedAt *time.Time }
type UserUseCase ¶
type UserUseCase struct {
// contains filtered or unexported fields
}
func NewUserUseCase ¶
func NewUserUseCase(repo UserRepo, logger log.Logger) *UserUseCase
func (*UserUseCase) CheckUserOK ¶
func (*UserUseCase) GetUserById ¶
func (*UserUseCase) LoginByUsername ¶
func (*UserUseCase) LoginByVerifyCode ¶
Click to show internal directories.
Click to hide internal directories.