Documentation ¶
Index ¶
- Constants
- func BigNumberStringer(num int64) string
- func DecorateNumberToText(v interface{}) string
- func FilterBackgroundUrl(m beego.M) beego.M
- func FilterUserAvatarUrl(m beego.M) beego.M
- func GetQueryTypesParser() *queryTypeRepository
- func NewQueryTypeRepository() *queryTypeRepository
- func TransBigNumberToText(m beego.M, keys ...string) beego.M
- type AppRepository
- type AttachmentRepository
- type AttachmentRepositoryImpl
- func (this *AttachmentRepositoryImpl) DownloadByMediaId(mediaIds ...string)
- func (this *AttachmentRepositoryImpl) GetByMediaId(mediaIds ...string)
- func (this *AttachmentRepositoryImpl) List() common.ResponseJson
- func (this *AttachmentRepositoryImpl) Ticket() common.ResponseJson
- func (this *AttachmentRepositoryImpl) Upload() common.ResponseJson
- func (this *AttachmentRepositoryImpl) Uploads() common.ResponseJson
- type AuthenticateRepository
- type Avatar
- type BaseUser
- type BehaviorRepository
- type CaptchaRepository
- type CaptchaRepositoryImpl
- type CommentRepository
- type Dispatcher
- type DtoRepository
- func (this *DtoRepository) Cache(key string, v interface{}, alive ...time.Duration) *DtoRepository
- func (this *DtoRepository) Flash() *DtoRepository
- func (this *DtoRepository) GC(key ...string) *DtoRepository
- func (this *DtoRepository) Get(key string) interface{}
- func (this *DtoRepository) GetAvatar(id string, gender int) *Avatar
- func (this *DtoRepository) GetBaseUser(data *models.User) *BaseUser
- func (this *DtoRepository) GetBaseUserByMapper(data map[string]interface{}) *BaseUser
- func (this *DtoRepository) GetPrivacyUser(data interface{}) *PrivacyUser
- func (this *DtoRepository) GetPrivacyUserByMapper(data map[string]interface{}) *PrivacyUser
- func (this *DtoRepository) GetSimpleUserDetail(data interface{}) *SimpleUser
- func (this *DtoRepository) GetSimpleUserDetailById(id string) *SimpleUser
- func (this *DtoRepository) GetThumbsUpService() services.ThumbsUpService
- func (this *DtoRepository) GetUrlByAttachId(id string) string
- func (this *DtoRepository) GetUser(data map[string]interface{}) *SimpleUser
- func (this *DtoRepository) GetUserById(id string) *BaseUser
- func (this *DtoRepository) GetUserByMapper(data beego.M) *SimpleUser
- func (this *DtoRepository) GetUserRoleService() services.UserRoleService
- func (this *DtoRepository) IsFollowed(userId, followerUserId string) bool
- func (this *DtoRepository) IsThumbsUp(postId string, userId string, status ...int) bool
- func (this *DtoRepository) Key(value ...interface{}) string
- func (this *DtoRepository) Len() int
- func (this *DtoRepository) Stop()
- type EventRepository
- type LoginRepository
- type LoginRepositoryImpl
- type PopularizationRepository
- type PostsRepository
- type PrivacyUser
- type SimpleUser
- type Subscriber
- type TagsRepository
- type TaskRepository
- type ThumbsUpRepository
- type TypeAlias
- type TypeDefinedMgr
- type User
- type UserCollectionRepository
- type UserInfoRepository
- type UserInfoRepositoryImpl
- func (this *UserInfoRepositoryImpl) AdminResetPassword() common.ResponseJson
- func (this *UserInfoRepositoryImpl) GetProfile(userId string) common.ResponseJson
- func (this *UserInfoRepositoryImpl) GetUserFriends(ids ...string) common.ResponseJson
- func (this *UserInfoRepositoryImpl) GetUserInfo() common.ResponseJson
- func (this *UserInfoRepositoryImpl) GetUserNumbers(userId string) *UserNumbersObject
- func (this *UserInfoRepositoryImpl) GetUserPublic(userId string) *UserPublicInfo
- func (this *UserInfoRepositoryImpl) GetUserPublicInfo(id string) common.ResponseJson
- func (this *UserInfoRepositoryImpl) PasswordCheck(pass string) common.Errors
- func (this *UserInfoRepositoryImpl) ResetPassword() common.ResponseJson
- func (this *UserInfoRepositoryImpl) Search(query string) common.ResponseJson
- func (this *UserInfoRepositoryImpl) UpdateUserInfo() common.ResponseJson
- type UserNumbersObject
- type UserPublicInfo
- type UserRegisterRepository
- type UserRegisterRepositoryImpl
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 DecorateNumberToText ¶
func DecorateNumberToText(v interface{}) string
DecorateNumberToText 大数字装饰器
func GetQueryTypesParser ¶
func GetQueryTypesParser() *queryTypeRepository
func NewQueryTypeRepository ¶
func NewQueryTypeRepository() *queryTypeRepository
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) }
func NewAttachmentRepository ¶
func NewAttachmentRepository(ctx common.BaseRequestContext) AttachmentRepository
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 ¶
func (this *AttachmentRepositoryImpl) List() common.ResponseJson
List 罗列附件接口
func (*AttachmentRepositoryImpl) Ticket ¶
func (this *AttachmentRepositoryImpl) Ticket() common.ResponseJson
Ticket 跨站上传ticket
func (*AttachmentRepositoryImpl) Upload ¶
func (this *AttachmentRepositoryImpl) Upload() common.ResponseJson
Upload 单文件上传
func (*AttachmentRepositoryImpl) Uploads ¶
func (this *AttachmentRepositoryImpl) Uploads() common.ResponseJson
Uploads 多文件上传
type AuthenticateRepository ¶
type AuthenticateRepository interface { QQ() common.ResponseJson WeChat() common.ResponseJson Apple() common.ResponseJson }
func NewAuthenticateRepository ¶
func NewAuthenticateRepository(ctx common.BaseRequestContext) AuthenticateRepository
type BaseUser ¶
type BaseUser struct { UserId string `json:"userId"` // 用户ID Nickname string `json:"nickname"` // 用户昵称 AvatarInfo *Avatar `json:"avatar"` // 用户头像 UpdatedTime int64 `json:"updatedTime"` // 更新时间 }
BaseUser 基础用户信息
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 用户相关行为
func NewBehaviorRepository ¶
func NewBehaviorRepository(ctx common.BaseRequestContext) 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) 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) 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 }
func NewPopularizationRepository ¶
func NewPopularizationRepository(ctx common.BaseRequestContext) PopularizationRepository
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 }
func NewThumbsUpRepository ¶
func NewThumbsUpRepository(ctx common.BaseRequestContext) ThumbsUpRepository
type TypeDefinedMgr ¶
type TypeDefinedMgr struct {
// contains filtered or unexported fields
}
func NewTypeDefinedMgr ¶
func NewTypeDefinedMgr() *TypeDefinedMgr
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 }
func NewUserCollectionRepository ¶
func NewUserCollectionRepository(ctx common.BaseRequestContext) UserCollectionRepository
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 }
func NewUserInfoRepository ¶
func NewUserInfoRepository(ctx common.BaseRequestContext) UserInfoRepository
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 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) }
func NewUserRegisterRepository ¶
func NewUserRegisterRepository(ctx common.BaseRequestContext) UserRegisterRepository
type UserRegisterRepositoryImpl ¶
type UserRegisterRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*UserRegisterRepositoryImpl) Register ¶
func (this *UserRegisterRepositoryImpl) Register() common.ResponseJson
username + password mobile + sms-code email + email-code third-party => { auth_code, user_info } 注册逻辑
func (*UserRegisterRepositoryImpl) RegisterByQuick ¶
func (this *UserRegisterRepositoryImpl) RegisterByQuick() (*models.User, error)
Source Files ¶
- app_repository.go
- attachment_repository.go
- authenticate_repository.go
- behavior_repository.go
- captcha_repository.go
- comment_repository.go
- dto_repository.go
- event_repository.go
- login_repository.go
- popularization_repository.go
- posts_repository.go
- register_repository.go
- repository.go
- tags_repository.go
- task_repository.go
- thumbs_up_repository.go
- types_repository.go
- user_collectionrepository.go
- user_info_repository.go
Click to show internal directories.
Click to hide internal directories.