ums_member

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	REDIS_DATABASE         = configs.Get().Redis.Database
	REDIS_EXPIRE           = time.Duration(configs.Get().Redis.Expire.Common) * time.Second
	REDIS_EXPIRE_AUTH_CODE = time.Duration(configs.Get().Redis.Expire.AuthCode) * time.Second
	REDIS_KEY_MEMBER       = configs.Get().Redis.Key.Member
	REDIS_KEY_AUTH_CODE    = configs.Get().Redis.Key.AuthCode
)

Functions

This section is empty.

Types

type MemberUserDetails

type MemberUserDetails struct {
	UmsMember *ums_member.UmsMember
}

func (*MemberUserDetails) GetPassword

func (au *MemberUserDetails) GetPassword() string

func (*MemberUserDetails) GetUsername

func (au *MemberUserDetails) GetUsername() string

func (*MemberUserDetails) IsAccountNonExpired

func (au *MemberUserDetails) IsAccountNonExpired() bool

func (*MemberUserDetails) IsAccountNonLocked

func (au *MemberUserDetails) IsAccountNonLocked() bool

func (*MemberUserDetails) IsCredentialsNonExpired

func (au *MemberUserDetails) IsCredentialsNonExpired() bool

func (*MemberUserDetails) IsEnabled

func (au *MemberUserDetails) IsEnabled() bool

type Service

type Service interface {

	/**
	 * 根据用户名获取会员
	 */
	GetByUsername(ctx context.Context, username string) (*ums_member.UmsMember, error)

	/**
	 * 根据会员编号获取会员
	 */
	GetById(ctx context.Context, id int64) (*ums_member.UmsMember, error)

	/**
	 * 用户注册
	 */
	Register(ctx context.Context, username, passwd, telephone, authCode string) error

	/**
	 * 生成验证码
	 */
	GenerateAuthCode(ctx context.Context, telephone string) string

	/**
	 * 修改密码
	 */
	UpdatePassword(ctx context.Context, telephone, passwd, authCode string) error

	/**
	 * 根据会员id修改会员积分
	 */
	UpdateIntegration(ctx context.Context, id int64, integration int32) error

	/**
	 * 获取当前登录会员
	 */
	GetCurrentMember(ctx context.Context) (*dto.UmsMember, error)

	/**
	 * 获取用户信息
	 */
	LoadUserByUsername(ctx context.Context, username string) (*MemberUserDetails, error)

	/**
	 * 登录后获取token
	 */
	Login(ctx context.Context, username, passwd string) (string, error)

	/**
	 * 刷新token
	 */
	RefreshToken(ctx context.Context, oldToken string) (string, error)
	// contains filtered or unexported methods
}

func New

func New() Service

type UmsMemberCacheService

type UmsMemberCacheService struct{}

func NewCacheService

func NewCacheService() *UmsMemberCacheService

func (*UmsMemberCacheService) DelMember

func (s *UmsMemberCacheService) DelMember(ctx context.Context, memberId int64)

func (*UmsMemberCacheService) GetAuthCode

func (s *UmsMemberCacheService) GetAuthCode(ctx context.Context, telephone string) string

func (*UmsMemberCacheService) GetMember

func (s *UmsMemberCacheService) GetMember(ctx context.Context, username string) *ums_member.UmsMember

func (*UmsMemberCacheService) SetAuthCode

func (s *UmsMemberCacheService) SetAuthCode(ctx context.Context, telephone, authCode string)

func (*UmsMemberCacheService) SetMember

func (s *UmsMemberCacheService) SetMember(ctx context.Context, member *ums_member.UmsMember)

type UmsMemberCacheServiceI

type UmsMemberCacheServiceI interface {

	/**
	 * 删除会员用户缓存
	 */
	DelMember(ctx context.Context, memberId int64)

	/**
	 * 获取会员用户缓存
	 */
	GetMember(ctx context.Context, username string) *ums_member.UmsMember

	/**
	 * 设置会员用户缓存
	 */
	SetMember(ctx context.Context, member *ums_member.UmsMember)

	/**
	 * 设置验证码
	 */
	SetAuthCode(ctx context.Context, telephone, authCode string)

	/**
	 * 获取验证码
	 */
	GetAuthCode(ctx context.Context, telephone string) string
}

会员信息缓存业务类Service

Jump to

Keyboard shortcuts

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