social

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSocialService

func RegisterSocialService(social string, service SocialService) error

Types

type SocialManager

type SocialManager struct {
	Services map[string]SocialService
}

func (*SocialManager) GetSocialService

func (m *SocialManager) GetSocialService(social string) SocialService

func (*SocialManager) RegisterSocialService

func (m *SocialManager) RegisterSocialService(social string, service SocialService) error

type SocialService

type SocialService interface {
	GetSocialUserByCode(ctx context.Context, socialChannelId string, code string) *SocialUser
}

func GetSocialService

func GetSocialService(social string) SocialService

type SocialUser

type SocialUser struct {
	DelFlag       bool       `gorm:"column:del_flag" json:"delFlag"`
	Type          string     `gorm:"column:type" json:"type"`
	OpenId        *string    `gorm:"column:open_id" json:"openId,omitempty"`
	SocialId      *string    `gorm:"column:social_id" json:"socialId,omitempty"`
	Mobile        *string    `gorm:"column:mobile" json:"mobile,omitempty"`
	Email         *string    `gorm:"column:email" json:"email,omitempty"`
	Name          *string    `gorm:"column:name" json:"name,omitempty"`
	Status        *int       `gorm:"column:status;default:1" json:"status"`
	Avatar        *string    `gorm:"column:avatar" json:"avatar,omitempty"`
	LoginTimes    int        `gorm:"column:login_times" json:"loginTimes"`
	Remark        *string    `gorm:"column:remark" json:"remark,omitempty"`
	LastLoginTime *time.Time `gorm:"column:last_login_time" json:"lastLoginTime,omitempty"`
	LastLoginIp   *string    `gorm:"column:last_login_ip" json:"lastLoginIp,omitempty"`
	NickName      *string    `gorm:"column:nick_name" json:"nickName,omitempty"`
	Title         *string    `gorm:"column:title;" json:"title,omitempty"`
	UserId        *string    `gorm:"column:user_id" json:"userId,omitempty"`
}

func (*SocialUser) GetId

func (u *SocialUser) GetId() string

func (*SocialUser) SetSocialId

func (u *SocialUser) SetSocialId(socialType string, socialId string) *SocialUser

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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