repositories

package
v0.0.0-...-d28bcca Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFileKey  = "file"
	DefaultFilesKey = "files"
)
View Source
const (
	DefaultMaxCacheItemNum    = 100
	DefaultCacheAliveDuration = 3 * time.Minute
)
View Source
const (
	PostImagesInfoKey = "imagesInfo"
	PostVideoInfoKey  = "videosInfo"
)
View Source
const (
	RegisterByAccount = "account"
	RegisterByMobile  = "mobile"
	RegisterByEmail   = "email"
	RegisterByThird   = "thirdParty"
)
View Source
const (
	ActionUp   = 1
	ActionDown = 0
)

Variables

This section is empty.

Functions

func BigNumberStringer

func BigNumberStringer(num int64) string

BigNumberStringer 大数字转换

func DecorateNumberToText

func DecorateNumberToText(v interface{}) string

DecorateNumberToText 大数字装饰器

func FilterBackgroundUrl

func FilterBackgroundUrl(m beego.M) beego.M

FilterBackgroundUrl 背景墙图

func FilterUserAvatarUrl

func FilterUserAvatarUrl(m beego.M) beego.M

FilterUserAvatarUrl 头像图

func GetQueryTypesParser

func GetQueryTypesParser() *queryTypeRepository

func NewQueryTypeRepository

func NewQueryTypeRepository() *queryTypeRepository

func TransBigNumberToText

func TransBigNumberToText(m beego.M, keys ...string) beego.M

TransBigNumberToText 大数转换器

Types

type AppRepository

type AppRepository interface {
	GetConfig(typ string) common.ResponseJson
	Apply() common.ResponseJson
}

func NewAppRepository

func NewAppRepository(ctx common.BaseRequestContext) AppRepository

type AttachmentRepository

type AttachmentRepository interface {
	Ticket() common.ResponseJson
	Upload() common.ResponseJson
	Uploads() common.ResponseJson
	List() common.ResponseJson
	GetByMediaId(...string)
	DownloadByMediaId(...string)
}

type AttachmentRepositoryImpl

type AttachmentRepositoryImpl struct {
	// contains filtered or unexported fields
}

func (*AttachmentRepositoryImpl) DownloadByMediaId

func (this *AttachmentRepositoryImpl) DownloadByMediaId(mediaIds ...string)

DownloadByMediaId 下载文件

func (*AttachmentRepositoryImpl) GetByMediaId

func (this *AttachmentRepositoryImpl) GetByMediaId(mediaIds ...string)

GetByMediaId 文件服务

func (*AttachmentRepositoryImpl) List

List 罗列附件接口

func (*AttachmentRepositoryImpl) Ticket

Ticket 跨站上传ticket

func (*AttachmentRepositoryImpl) Upload

Upload 单文件上传

func (*AttachmentRepositoryImpl) Uploads

Uploads 多文件上传

type AuthenticateRepository

type AuthenticateRepository interface {
	QQ() common.ResponseJson
	WeChat() common.ResponseJson
	Apple() common.ResponseJson
}

type Avatar

type Avatar struct {
	Id        string `json:"id"`
	AvatarUrl string `json:"avatarUrl"`
}

type BaseUser

type BaseUser struct {
	UserId      string  `json:"userId"`      // 用户ID
	Nickname    string  `json:"nickname"`    // 用户昵称
	AvatarInfo  *Avatar `json:"avatar"`      // 用户头像
	UpdatedTime int64   `json:"updatedTime"` // 更新时间
}

BaseUser 基础用户信息

func (*BaseUser) M

func (this *BaseUser) M(filters ...func(m beego.M) beego.M) beego.M

type BehaviorRepository

type BehaviorRepository interface {
	FocusOn(ids ...string) common.ResponseJson
	FocusOff(ids ...string) common.ResponseJson
	GetUserFollows(ids ...string) common.ResponseJson
	GetUserFans(ids ...string) common.ResponseJson
}

BehaviorRepository 用户相关行为

type CaptchaRepository

type CaptchaRepository interface {
	SendMobileCaptcha() common.ResponseJson
}

func NewCaptchaRepository

func NewCaptchaRepository(ctx common.BaseRequestContext) CaptchaRepository

type CaptchaRepositoryImpl

type CaptchaRepositoryImpl struct {
	// contains filtered or unexported fields
}

func (*CaptchaRepositoryImpl) SendMobileCaptcha

func (this *CaptchaRepositoryImpl) SendMobileCaptcha() common.ResponseJson

type CommentRepository

type CommentRepository interface {
	Create() common.ResponseJson
	Detail() common.ResponseJson
	Lists() common.ResponseJson
}

func NewCommentRepository

func NewCommentRepository(ctx common.BaseRequestContext) CommentRepository

type Dispatcher

type Dispatcher interface {
	Send(target string, data interface{})
}

type DtoRepository

type DtoRepository struct {
	// contains filtered or unexported fields
}

func GetDtoRepository

func GetDtoRepository() *DtoRepository

func (*DtoRepository) Cache

func (this *DtoRepository) Cache(key string, v interface{}, alive ...time.Duration) *DtoRepository

Cache 缓存数据

func (*DtoRepository) Flash

func (this *DtoRepository) Flash() *DtoRepository

func (*DtoRepository) GC

func (this *DtoRepository) GC(key ...string) *DtoRepository

GC 回收数据

func (*DtoRepository) Get

func (this *DtoRepository) Get(key string) interface{}

Get 获取缓存对象

func (*DtoRepository) GetAvatar

func (this *DtoRepository) GetAvatar(id string, gender int) *Avatar

func (*DtoRepository) GetBaseUser

func (this *DtoRepository) GetBaseUser(data *models.User) *BaseUser

func (*DtoRepository) GetBaseUserByMapper

func (this *DtoRepository) GetBaseUserByMapper(data map[string]interface{}) *BaseUser

func (*DtoRepository) GetPrivacyUser

func (this *DtoRepository) GetPrivacyUser(data interface{}) *PrivacyUser

func (*DtoRepository) GetPrivacyUserByMapper

func (this *DtoRepository) GetPrivacyUserByMapper(data map[string]interface{}) *PrivacyUser

func (*DtoRepository) GetSimpleUserDetail

func (this *DtoRepository) GetSimpleUserDetail(data interface{}) *SimpleUser

func (*DtoRepository) GetSimpleUserDetailById

func (this *DtoRepository) GetSimpleUserDetailById(id string) *SimpleUser

func (*DtoRepository) GetThumbsUpService

func (this *DtoRepository) GetThumbsUpService() services.ThumbsUpService

func (*DtoRepository) GetUrlByAttachId

func (this *DtoRepository) GetUrlByAttachId(id string) string

func (*DtoRepository) GetUser

func (this *DtoRepository) GetUser(data map[string]interface{}) *SimpleUser

func (*DtoRepository) GetUserById

func (this *DtoRepository) GetUserById(id string) *BaseUser

func (*DtoRepository) GetUserByMapper

func (this *DtoRepository) GetUserByMapper(data beego.M) *SimpleUser

func (*DtoRepository) GetUserRoleService

func (this *DtoRepository) GetUserRoleService() services.UserRoleService

func (*DtoRepository) IsFollowed

func (this *DtoRepository) IsFollowed(userId, followerUserId string) bool

IsFollowed 是否已关注

func (*DtoRepository) IsThumbsUp

func (this *DtoRepository) IsThumbsUp(postId string, userId string, status ...int) bool

IsThumbsUp 是否已点赞

func (*DtoRepository) Key

func (this *DtoRepository) Key(value ...interface{}) string

func (*DtoRepository) Len

func (this *DtoRepository) Len() int

Len 缓存数量

func (*DtoRepository) Stop

func (this *DtoRepository) Stop()

type EventRepository

type EventRepository interface {
	Dispatch(target string, data interface{}, queue string)         // 派发事件到队列
	AddListener(target string, handler func(data interface{}) bool) // 添加事件监听器
	Once(target string, handler func(data interface{}) bool)        // 一次性事件
	Subscriber(subscriber Subscriber)                               //  注册订阅器
	Emit(target string, data interface{})                           // 发送事件
	Dispatcher(name string, dispatcher Dispatcher)                  // 添加事件派发器
}

func GetEventProvider

func GetEventProvider() EventRepository

type LoginRepository

type LoginRepository interface {
	Login() common.ResponseJson
	Logout() common.ResponseJson
}

func NewLoginRepository

func NewLoginRepository(ctx common.BaseRequestContext) LoginRepository

type LoginRepositoryImpl

type LoginRepositoryImpl struct {
	// contains filtered or unexported fields
}

func (*LoginRepositoryImpl) Login

func (this *LoginRepositoryImpl) Login() common.ResponseJson

Login 登录逻辑总汇

func (*LoginRepositoryImpl) Logout

func (this *LoginRepositoryImpl) Logout() common.ResponseJson

Logout 登出

type PopularizationRepository

type PopularizationRepository interface {
	GetChannel() common.ResponseJson
	GetChannelInfo() common.ResponseJson
	GetChannelQrcode() common.ResponseJson
}

type PostsRepository

type PostsRepository interface {
	Create() common.ResponseJson
	Update() common.ResponseJson
	Audit() common.ResponseJson
	GetLikes(ids ...string) common.ResponseJson
	GetRanking() common.ResponseJson
	GetFollows() common.ResponseJson
	Lists(...string) common.ResponseJson
	GetById(...string) common.ResponseJson
	RemoveId(...string) common.ResponseJson
	AutoVideosCover() common.ResponseJson
	GetAll() common.ResponseJson
	ListsByPostType(typ string) common.ResponseJson
	GetPostTransform() func(m beego.M) beego.M
}

func NewPostsRepository

func NewPostsRepository(ctx common.BaseRequestContext) PostsRepository

type PrivacyUser

type PrivacyUser struct {
	SimpleUser
	Gender     int    `json:"gender"`     // 性别
	GenderDesc string `json:"genderDesc"` // 性别描述
	Birthday   int64  `json:"birthday"`   // 生日
	Address    string `json:"address"`    // 地址
}

PrivacyUser 用户隐私数据

type SimpleUser

type SimpleUser struct {
	BaseUser
	InviteCode string `json:"inviteCode"` // 邀请码
	Intro      string `json:"intro"`      // 简介
	Role       int    `json:"role"`       // 账号类型Id
	RoleDesc   string `json:"roleDesc"`   // 账号类型描述
}

SimpleUser 简单用户信息

type Subscriber

type Subscriber interface {
	Target() string
	Register(repository EventRepository)
	Handle(data interface{}) bool
}

type TagsRepository

type TagsRepository interface {
	GetPostTags() common.ResponseJson
}

func NewTagRepository

func NewTagRepository(ctx common.BaseRequestContext) TagsRepository

type TaskRepository

type TaskRepository interface {
	SyncAssetsTask() common.ResponseJson
}

func NewTaskRepository

func NewTaskRepository(ctx common.BaseRequestContext) TaskRepository

type ThumbsUpRepository

type ThumbsUpRepository interface {
	Up() common.ResponseJson
	Down() common.ResponseJson
	Count() common.ResponseJson
}

type TypeAlias

type TypeAlias string

func (TypeAlias) String

func (t TypeAlias) String() string

type TypeDefinedMgr

type TypeDefinedMgr struct {
	// contains filtered or unexported fields
}

func NewTypeDefinedMgr

func NewTypeDefinedMgr() *TypeDefinedMgr

func (*TypeDefinedMgr) Get

func (this *TypeDefinedMgr) Get(k string) ([]int, bool)

func (*TypeDefinedMgr) Load

func (this *TypeDefinedMgr) Load(data typeDefinedMap) *TypeDefinedMgr

type User

type User struct {
	PrivacyUser
	PasswordHash string    `json:"passwordHash"` // 密码
	Mobile       string    `json:"mobile"`       // 密码
	CreatedAt    time.Time `json:"createdAt"`    // 创建时间
	UpdatedAt    time.Time `json:"updatedAt"`    // 更新时间
}

User 用户数据

type UserCollectionRepository

type UserCollectionRepository interface {
	Add(id, userId string) common.ResponseJson
	Remove(id, userId string) common.ResponseJson
	Lists(id string, page, count int) common.ResponseJson
}

type UserInfoRepository

type UserInfoRepository interface {
	GetUserInfo() common.ResponseJson
	Search(string) common.ResponseJson
	ResetPassword() common.ResponseJson
	UpdateUserInfo() common.ResponseJson
	GetProfile(string) common.ResponseJson
	GetUserPublicInfo(string) common.ResponseJson
	GetUserFriends(ids ...string) common.ResponseJson
	AdminResetPassword() common.ResponseJson
}

type UserInfoRepositoryImpl

type UserInfoRepositoryImpl struct {
	// contains filtered or unexported fields
}

func (*UserInfoRepositoryImpl) AdminResetPassword

func (this *UserInfoRepositoryImpl) AdminResetPassword() common.ResponseJson

func (*UserInfoRepositoryImpl) GetProfile

func (this *UserInfoRepositoryImpl) GetProfile(userId string) common.ResponseJson

func (*UserInfoRepositoryImpl) GetUserFriends

func (this *UserInfoRepositoryImpl) GetUserFriends(ids ...string) common.ResponseJson

func (*UserInfoRepositoryImpl) GetUserInfo

func (this *UserInfoRepositoryImpl) GetUserInfo() common.ResponseJson

GetUserInfo 获取 全部用户信息 [个人]

func (*UserInfoRepositoryImpl) GetUserNumbers

func (this *UserInfoRepositoryImpl) GetUserNumbers(userId string) *UserNumbersObject

GetUserNumbers 用户相关数值数据

func (*UserInfoRepositoryImpl) GetUserPublic

func (this *UserInfoRepositoryImpl) GetUserPublic(userId string) *UserPublicInfo

GetUserPublic 获取用户 公共信息

func (*UserInfoRepositoryImpl) GetUserPublicInfo

func (this *UserInfoRepositoryImpl) GetUserPublicInfo(id string) common.ResponseJson

func (*UserInfoRepositoryImpl) PasswordCheck

func (this *UserInfoRepositoryImpl) PasswordCheck(pass string) common.Errors

PasswordCheck 密码规则检查

func (*UserInfoRepositoryImpl) ResetPassword

func (this *UserInfoRepositoryImpl) ResetPassword() common.ResponseJson

func (*UserInfoRepositoryImpl) Search

func (this *UserInfoRepositoryImpl) Search(query string) common.ResponseJson

func (*UserInfoRepositoryImpl) UpdateUserInfo

func (this *UserInfoRepositoryImpl) UpdateUserInfo() common.ResponseJson

type UserNumbersObject

type UserNumbersObject struct {
	FollowNum   int64 `json:"followNum"`
	FansNum     int64 `json:"fansNum"`
	ThumbsUpNum int64 `json:"thumbsUpNum"`
}

type UserPublicInfo

type UserPublicInfo struct {
	UserNumbersObject
	BaseUser
	Intro              string `json:"intro"`              // 简介
	BackgroundCoverUrl string `json:"backgroundCoverUrl"` // 背景图
	Role               int    `json:"role"`               // 账号类型Id
	RoleDesc           string `json:"roleDesc"`           // 账号类型描述
	Gender             int    `json:"gender"`             // 性别
	GenderDesc         string `json:"genderDesc"`         // 性别描述
	Address            string `json:"address"`            // 地址
	IsFollowed         bool   `json:"isFollowed"`         // 是否已经关注
}

type UserRegisterRepository

type UserRegisterRepository interface {
	Register() common.ResponseJson
	RegisterByQuick() (*models.User, error)
}

type UserRegisterRepositoryImpl

type UserRegisterRepositoryImpl struct {
	// contains filtered or unexported fields
}

func (*UserRegisterRepositoryImpl) Register

username + password mobile + sms-code email + email-code third-party => { auth_code, user_info } 注册逻辑

func (*UserRegisterRepositoryImpl) RegisterByQuick

func (this *UserRegisterRepositoryImpl) RegisterByQuick() (*models.User, error)

Jump to

Keyboard shortcuts

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