models

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: 29 Imported by: 0

Documentation

Overview

travel 数据模型包 编写 规范,纯数据 结构 struct + 对应数据结构 Model 包括 :

用户模型 User, UserModel (注册用户) 游记模型 TravelNotes , PostModel (记录用户发布的游记) 附件模型 Attachment ,AttachmentModel (系统文件保存记录)

Index

Constants

View Source
const (
	AddressTableName     = "address"
	AddressLevelProvince = 0  // 省
	AddressLevelCity     = 1  // 市
	AddressLevelDistrict = 2  // 区
	AddressLevelTown     = 3  // 镇
	AddressLevelVillage  = 4  // 乡
	AddressLevelUnKnown  = -1 // 异常
)
View Source
const (
	DefaultAppName  = "游迹"
	DefaultVersion  = "1.0.0"
	AppVersionTable = "app_versions_info"
)
View Source
const (
	ApplyInfoTable     = "apply_infos" // 表名
	ApplyTypeReport    = "report"      // 举报
	ApplyTypeSuggest   = "suggest"     // 建议|反馈
	ApplyTypeAllege    = "allege"      // 申诉
	ApplyStatusWait    = 0             // 待处理
	ApplyStatusPassed  = 1             // 处理完毕
	ApplyStatusDealing = 2             // 处理中
	ApplyStatusReject  = 3             // 拒绝处理
)
View Source
const (
	AttachmentTable       = "attachments"
	AttachTypeImage       = "image"
	AttachTypeImageAvatar = "avatar"
	AttachTypeDoc         = "doc"
	AttachTypeText        = "txt"
	AttachTypeVideo       = "video"
	AttachTypeAudio       = "audio"
	UrlTicketParam        = "ticket"
	UrlServerFaced        = "UrlAccessService"
	DefaultAliveTime      = int64(30 * 24 * time.Hour)
)
View Source
const (
	SaverProvider      = "saverProvider"
	AttributesProvider = "attributesProvider"
	DataProvider       = "dataProvider"
	DefaultProvider    = "defaultProvider"
)
View Source
const (
	CollectTable          = "user_collects"
	CollectTargetTypePost = "post"
	CollectTargetVideo    = "video"
	StatusActivity        = 1
)
View Source
const (
	CommentTable             = "comments"
	StatusAuditUnPass        = -1
	StatusAuditPass          = 1
	StatusAuditWait          = 0
	StatusOff                = 2
	CommentTargetTypeComment = "post"
	CommentTargetTypeReview  = "comment"
)
View Source
const (
	ConfigTable       = "configs"
	DefaultConfigRoot = "app"
	ConfigStateUnInit = 0
	ConfigStateOk     = 1
	ConfigStateDel    = 2
)
View Source
const (
	TravelNotesTable = "travel_posts"
	PublicPrivacy    = 1
	OnlySelfPrivacy  = 2

	ImageType    = 1
	VideoType    = 2
	ContentType  = 3
	StrategyType = 4
	PostType     = 5

	ImageTypeCode    = "image"
	VideoTypeCode    = "video"
	ContentTypeCode  = "content"
	StrategyTypeCode = "strategy"
	PostTypeCode     = "post"

	StatusAuditNotPass = -1
	StatusWaitAudit    = 0
	StatusAuditOk      = 1
	StatusAuditOff     = 2
)
View Source
const (
	SensitiveWordsTable      = "sensitive_words" // 表名
	SensitiveWordsTypeGlobal = "global"
	InvalidWords             = " ,~,!,@,#,$,%,^,&,*,(,),_,-,+,=,?,<,>,.,—,,,。,/,\\,|,《,》,?,;,:,:,',‘,;,“," // 无效字符
)
View Source
const (
	SmsLogTableName     = "sms_log"
	DefaultProviderName = "aliyun-dysms"
)
View Source
const (
	ThumbsTypePost    = "post"    // 游记点
	ThumbsTypeComment = "comment" // 评论点赞
)
View Source
const (
	AddressTypeTmp        = 0
	AddressTypeRegister   = 1
	AddressTypeCompany    = 2
	AddressTypeHome       = 3
	AddressTypeSchool     = 4
	AddressTypeLogin      = 5
	AddressTypeVirtual    = 6
	AddressTypeExpress    = 7
	AddressStateNil       = 0
	AddressStateActivate  = 1
	AddressStateDelete    = 2
	AddressStateExpired   = 3
	UserAddressModelTable = "user_address"
	DefaultCountry        = "中国"
	DefaultCountryId      = 48
)
View Source
const (
	UserTable        = "users"
	GenderUnknown    = 0 // 未知
	GenderMan        = 1 // 男
	GenderWoman      = 2 // 女
	GenderSecrecy    = 3 // 保密
	GenderBoth       = 4 // 中间人
	GenderSecrecyKey = "secrecy"
	GenderUnknownKey = "default"
	GenderManKey     = "man"
	GenderWomanKey   = "woman"
	GenderBothKey    = "both"
	UserStatusOk     = 1  // 正常
	UserStatusForbid = 2  // 禁用
	UserStatusBack   = -1 // 拉黑
)
View Source
const (
	UserRelationTable = "user_relations" // 表名
	TargetTypeFriend  = "friend"         // 朋友关系
	StatusUnKnown     = 0                // 状态 初始化
	StatusOk          = 1                // 状态 正常
	StatusCancel      = 2                // 状态 取消
)
View Source
const (
	UserRootRole          = 7
	UserRoleTypeTableName = "user_roles_config"
)
View Source
const (
	AuditLogTable = "audit_logs"
)
View Source
const (
	MessageLogTable = "message_log"
)
View Source
const (
	MessageTemplateModelTableName = "message_template"
)
View Source
const (
	PopularizationChannelsTable = "popularization_channels"
)
View Source
const (
	RequestLogTableName = "request_logs"
)
View Source
const (
	TagModelTableName = "tags"
)
View Source
const (
	ThumbsUpTable = "thumbs_up"
)
View Source
const (
	UserFocusTable = "user_focus"
)
View Source
const (
	UserLoginLogTable = "user_login_log"
)

Variables

View Source
var (
	ErrFileNotExists = errors.New("file not exists")
	ErrEmptyInclude  = errors.New("empty include json")
	ErrEmptyJson     = errors.New("empty json object")
	ErrUnSupportJson = errors.New("unSupport json struct")
)
View Source
var (
	ApplyTypes = []string{
		ApplyTypeReport,
		ApplyTypeSuggest,
		ApplyTypeAllege,
	}
	ApplyStatusDesc = map[int]string{
		ApplyStatusWait:    "待处理",
		ApplyStatusPassed:  "处理完毕",
		ApplyStatusDealing: "处理中",
		ApplyStatusReject:  "拒绝处理",
	}
)
View Source
var (
	// AttachmentTypes 类型列表
	AttachmentTypes = []string{
		AttachTypeImage,
		AttachTypeImageAvatar,
		AttachTypeDoc,
		AttachTypeText,
		AttachTypeVideo,
		AttachTypeAudio,
	}
	// AttachmentTypesMatcher 类型匹配器
	AttachmentTypesMatcher = []*StrArrayEntry{
		{AttachTypeImage, StrArray{".png", ".jpg", ".gif", ".bmp", ".webp", ".svg"}},
		{AttachTypeImageAvatar, StrArray{".png", ".jpg"}},
		{AttachTypeDoc, StrArray{".doc", ".docx", ".pdf", ".ppt", ".pptx", ".xsl", ".xslx", ".mmap", ".xmind"}},
		{AttachTypeText, StrArray{".txt", ".ini", ".yml", ".yaml", ".toml", ".xml", ".json", ".conf", ".env", ".sh", ".cmd", ".ps1", ".gitignore"}},
		{AttachTypeVideo, StrArray{".mp4"}},
		{AttachTypeAudio, StrArray{".mp3"}},
	}
)
View Source
var (
	CommentStatusMap = map[int]string{
		StatusAuditWait: "待审核", StatusAuditPass: "审核通过", StatusAuditUnPass: "审核未通过", StatusOff: "下架",
	}
	CommentTypes = []string{
		CommentTargetTypeReview, CommentTargetTypeComment,
	}
)
View Source
var (
	PrivacyMapDesc   = map[int]string{PublicPrivacy: "公开", OnlySelfPrivacy: "仅自己可见"}
	PostTypeMapDesc  = map[int]string{ImageType: "图像", VideoType: "视频", ContentType: "文本", StrategyType: "攻略", PostType: "帖子"}
	StatusMapDesc    = map[int]string{StatusAuditNotPass: "审核不通过", StatusWaitAudit: "待审核", StatusAuditOk: "审核通过", StatusAuditOff: "下架"}
	PostTypeMapCodes = map[int]string{ImageType: ImageTypeCode, VideoType: VideoTypeCode, ContentType: ContentTypeCode, StrategyType: StrategyTypeCode, PostType: PostTypeCode}
)
View Source
var (
	ErrEmptyData = errors.New("empty data call")
)
View Source
var (
	ErrEmptyRequestId = errors.New("empty requestId")
)
View Source
var (
	GlobalMgoSessionContainer = sync.Map{}
)
View Source
var (
	MissAreaCodeError = errors.New("miss areaCode")
)

Functions

func AppendQueryPostsCodesWithKey

func AppendQueryPostsCodesWithKey(query map[string]interface{}, codes []string, key string) map[string]interface{}

AppendQueryPostsCodesWithKey 最近类型查询限定

func AppendQueryTypes

func AppendQueryTypes(query map[string]interface{}, codes []string) map[string]interface{}

AppendQueryTypes 追加类型限定查询

func AppendQueryTypesWithKey

func AppendQueryTypesWithKey(query map[string]interface{}, codes []string, key string) map[string]interface{}

AppendQueryTypesWithKey 最近类型查询限定

func ArrayFirst

func ArrayFirst(arr []interface{}) interface{}

func GenderText

func GenderText(gender int) string

func GetAttachTypes

func GetAttachTypes(ty string) []string

GetAttachTypes 获取对应类型

func GetDate

func GetDate() int64

func GetDfaInstance

func GetDfaInstance() *dfaLogic

func GetGenderEnum

func GetGenderEnum(gender string) int

func GetGenderKey

func GetGenderKey(gender int) string

func GetLevelByDesc

func GetLevelByDesc(desc string) int

GetLevelByDesc 通过表现获取行政等级

func GetLevelDesc

func GetLevelDesc(level int) string

GetLevelDesc 获取行政区域 描述

func GetLevelText

func GetLevelText(level int) string

GetLevelText 获取行政区域 文本

func GetModelProfiles

func GetModelProfiles() *map[string]interface{}

GetModelProfiles 获取相关配置

func GetPostCodesMap

func GetPostCodesMap() map[uint]string

GetPostCodesMap 获取文章类型对应类型码 映射表

func GetPostTypesMap

func GetPostTypesMap() map[string]uint

GetPostTypesMap 获取文章码对应文章类型 映射表

func GetProfile

func GetProfile(key string, defaults ...interface{}) interface{}

func GetStateDesc

func GetStateDesc(state int) string

func GetTypeCode

func GetTypeCode(typ int) string

func GetTypeDesc

func GetTypeDesc(typ int) string

func GetTypeId

func GetTypeId(typ string) int

func GetTypeIdByDesc

func GetTypeIdByDesc(desc string) int

func GetUserBackgroundUrl

func GetUserBackgroundUrl(id string, ty string) string

获取用户背景封面图

func GetUserCommentNumber

func GetUserCommentNumber(userId string) int64

作品评论数

func GetUserDownPostNumber

func GetUserDownPostNumber(userId string) int64

获取用户作品下架数

func GetUserFansNumber

func GetUserFansNumber(userId string) int64

该用户粉丝数

func GetUserFollowNumber

func GetUserFollowNumber(userId string) int64

该用户关注用户数

func GetUserLikeNumber

func GetUserLikeNumber(userId string) int64

该用户喜欢作品用户数

func GetUserNotPassPostNumber

func GetUserNotPassPostNumber(userId string) int64

用户作品未通过审核数

func GetUserPassPostNumber

func GetUserPassPostNumber(userId string) int64

用户作品通过审核数

func GetUserPostNumber

func GetUserPostNumber(userId string) int64

作品可见作品数

func GetUserPostTotal

func GetUserPostTotal(userId string) int64

用户作品总数

func GetUserThumbsUpNumber

func GetUserThumbsUpNumber(userId string) int64

作品点赞数

func InSupportLevel

func InSupportLevel(level int) bool

InSupportLevel 是否支持的行政等级

func IncludesPostTypes

func IncludesPostTypes(t uint) bool

IncludesPostTypes 是否包含

func IsDuplicate

func IsDuplicate(err error) bool

func IsEmpty

func IsEmpty(v interface{}) bool

IsEmpty 是否为空

func IsErrCursor

func IsErrCursor(err error) bool

func IsForbid

func IsForbid(data *User) bool

func IsNotFound

func IsNotFound(err error) bool

func IsNumber

func IsNumber(v interface{}) bool

IsNumber 是否数字类型

func Merger

func Merger(m beego.M, m2 beego.M) beego.M

func ParsePostTypesByCodes

func ParsePostTypesByCodes(codes []string) []uint

ParsePostTypesByCodes 解析内容类型

func SetProfile

func SetProfile(key string, v interface{})

Types

type Address

type Address struct {
	Id         bson.ObjectId `json:"id" bson:"_id"`                // ID
	Level      int           `json:"level" bson:"level"`           // 行政层级
	ParentCode int64         `json:"parentCode" bson:"parentCode"` // 父级行政代码
	AreaCode   int64         `json:"areaCode" json:"areaCode"`     // 行政代码
	ZipCode    string        `json:"zipCode" bson:"zipCode"`       // 邮政编码
	CityCode   string        `json:"cityCode" bson:"cityCode"`     // 区号
	Name       string        `json:"name" bson:"name"`             // 名称
	ShortName  string        `json:"shortName" bson:"shortName"`   // 简称
	MergerName string        `json:"mergerName" bson:"mergerName"` // 组合名
	Pinyin     string        `json:"pinyin" bson:"pinyin"`         // 拼音
	Lng        float64       `json:"lng" bson:"lng"`               // 经度
	Lat        float64       `json:"lat" bson:"lat"`               // 纬度
	CreatedAt  time.Time     `json:"createdAt"`                    // 创建时间
	DeletedAt  int64         `json:"deletedAt" json:"deletedAt"`   // 删除时间 | 废弃时间
	// contains filtered or unexported fields
}

Address 中国行政区域

func NewAddress

func NewAddress() *Address

NewAddress 新地址

func (*Address) AddExcludeKeys

func (this *Address) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*Address) AddFilters

func (this *Address) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*Address) Defaults

func (this *Address) Defaults() *Address

Defaults 默认值填充

func (*Address) Excludes

func (this *Address) Excludes(key string) bool

Excludes 是否排除键

func (*Address) Foreach

func (this *Address) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*Address) GetFormatterTime

func (this *Address) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*Address) GetId

func (this *Address) GetId() bson.ObjectId

func (*Address) GetKeysFilter

func (this *Address) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*Address) GetNow

func (this *Address) GetNow() time.Time

func (*Address) GetTransformFilter

func (this *Address) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*Address) GetTransformFilterByKey

func (this *Address) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*Address) Init

func (this *Address) Init()

Init 地址对象初始化

func (*Address) InitDefault

func (this *Address) InitDefault()

InitDefault 初始化默认值

func (*Address) IsEmpty

func (this *Address) IsEmpty(v interface{}) bool

func (*Address) Keys

func (this *Address) Keys() []string

Keys 数据键集合

func (*Address) Load

func (this *Address) Load(data map[string]interface{}) *Address

加载数据

func (*Address) M

func (this *Address) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*Address) Map

func (this *Address) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*Address) Merger

func (this *Address) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*Address) RemoveExcludeKeys

func (this *Address) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*Address) Save

func (this *Address) Save() error

Save 保存

func (*Address) Set

func (this *Address) Set(key string, v interface{}) *Address

Set setter

func (*Address) SetAttributes

func (this *Address) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*Address) SetBool

func (this *Address) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*Address) SetBsonMapper

func (this *Address) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*Address) SetMap

func (this *Address) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*Address) SetMapper

func (this *Address) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*Address) SetNumInt

func (this *Address) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*Address) SetNumIntN

func (this *Address) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*Address) SetObjectId

func (this *Address) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*Address) SetProvider

func (this *Address) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*Address) SetSameTypeValue

func (this *Address) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*Address) SetString

func (this *Address) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*Address) SetStringArr

func (this *Address) SetStringArr(arr *[]string, v interface{}) bool

func (*Address) SetTime

func (this *Address) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*Address) Values

func (this *Address) Values() []interface{}

Values 数据值集合

type AddressInfo

type AddressInfo struct {
	Address  string `json:"address"`
	Country  string `json:"country"`
	Province string `json:"province"`
	City     string `json:"city"`
	District string `json:"district"`
	Street   string `json:"street"`
}

地址信息

func NewAddressInfo

func NewAddressInfo(address string, userId string) *AddressInfo

type AddressModel

type AddressModel struct {
	BaseModel
}

func AddressModelOf

func AddressModelOf() *AddressModel

AddressModelOf 地址模型

func (*AddressModel) CreateIndex

func (this *AddressModel) CreateIndex(force ...bool)

CreateIndex 创建索引

func (*AddressModel) GetAddress

func (this *AddressModel) GetAddress(query map[string]interface{}) *Address

GetAddress 地址查询

func (*AddressModel) ImportFromJsonFile

func (this *AddressModel) ImportFromJsonFile(file string) (int, error)

ImportFromJsonFile 通过json 倒入

func (*AddressModel) TableName

func (this *AddressModel) TableName() string

TableName 文档名

type AppBaseConfig

type AppBaseConfig struct {
	AppCode          string `json:"appCode"`          // 授权码
	Download         string `json:"download"`         // 下载页面
	AppHelpUrl       string `json:"appHelpUrl"`       // 帮助页
	AppPrivacy       string `json:"appPrivacy"`       // 隐私条款页
	AppAboutUs       string `json:"appAboutUs"`       // 关于我们
	AppUserAgreement string `json:"appUserAgreement"` // 用户协议页
	Email            string `json:"email"`            // 客服邮箱
	QQ               string `json:"QQ"`               // 客服QQ
	WeChat           string `json:"wechat"`           // 微信
	// contains filtered or unexported fields
}

App 配置信息

func (*AppBaseConfig) AddExcludeKeys

func (this *AppBaseConfig) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*AppBaseConfig) AddFilters

func (this *AppBaseConfig) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*AppBaseConfig) Excludes

func (this *AppBaseConfig) Excludes(key string) bool

Excludes 是否排除键

func (*AppBaseConfig) Foreach

func (this *AppBaseConfig) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*AppBaseConfig) GetAppAboutUs

func (this *AppBaseConfig) GetAppAboutUs(drivers ...string) string

func (*AppBaseConfig) GetAppCode

func (this *AppBaseConfig) GetAppCode(drivers ...string) string

获取AppCode

func (*AppBaseConfig) GetAppPrivacy

func (this *AppBaseConfig) GetAppPrivacy(drivers ...string) string

func (*AppBaseConfig) GetAppUserAgreement

func (this *AppBaseConfig) GetAppUserAgreement(drivers ...string) string

func (*AppBaseConfig) GetDownloadUrl

func (this *AppBaseConfig) GetDownloadUrl(drivers ...string) string

func (*AppBaseConfig) GetFormatterTime

func (this *AppBaseConfig) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*AppBaseConfig) GetHelpUrl

func (this *AppBaseConfig) GetHelpUrl(drivers ...string) string

func (*AppBaseConfig) GetId

func (this *AppBaseConfig) GetId() bson.ObjectId

func (*AppBaseConfig) GetKeysFilter

func (this *AppBaseConfig) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*AppBaseConfig) GetMail

func (this *AppBaseConfig) GetMail(drivers ...string) string

func (*AppBaseConfig) GetNow

func (this *AppBaseConfig) GetNow() time.Time

func (*AppBaseConfig) GetQQ

func (this *AppBaseConfig) GetQQ(drivers ...string) string

func (*AppBaseConfig) GetTransformFilter

func (this *AppBaseConfig) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*AppBaseConfig) GetTransformFilterByKey

func (this *AppBaseConfig) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*AppBaseConfig) GetWeChat

func (this *AppBaseConfig) GetWeChat(drivers ...string) string

func (*AppBaseConfig) Init

func (this *AppBaseConfig) Init()

func (*AppBaseConfig) InitDefault

func (this *AppBaseConfig) InitDefault()

InitDefault 初始化默认值

func (*AppBaseConfig) IsEmpty

func (this *AppBaseConfig) IsEmpty(v interface{}) bool

func (*AppBaseConfig) Keys

func (this *AppBaseConfig) Keys() []string

Keys 数据键集合

func (*AppBaseConfig) Load

func (this *AppBaseConfig) Load(driver ...string) *AppBaseConfig

func (*AppBaseConfig) M

func (this *AppBaseConfig) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*AppBaseConfig) Map

func (this *AppBaseConfig) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*AppBaseConfig) Merger

func (this *AppBaseConfig) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*AppBaseConfig) RemoveExcludeKeys

func (this *AppBaseConfig) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*AppBaseConfig) Save

func (this *AppBaseConfig) Save() error

Save 保存

func (*AppBaseConfig) Set

func (this *AppBaseConfig) Set(key string, v interface{}) *AppBaseConfig

func (*AppBaseConfig) SetAttributes

func (this *AppBaseConfig) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*AppBaseConfig) SetBool

func (this *AppBaseConfig) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*AppBaseConfig) SetBsonMapper

func (this *AppBaseConfig) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*AppBaseConfig) SetMap

func (this *AppBaseConfig) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*AppBaseConfig) SetMapper

func (this *AppBaseConfig) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*AppBaseConfig) SetNumInt

func (this *AppBaseConfig) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*AppBaseConfig) SetNumIntN

func (this *AppBaseConfig) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*AppBaseConfig) SetObjectId

func (this *AppBaseConfig) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*AppBaseConfig) SetProvider

func (this *AppBaseConfig) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*AppBaseConfig) SetSameTypeValue

func (this *AppBaseConfig) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*AppBaseConfig) SetString

func (this *AppBaseConfig) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*AppBaseConfig) SetStringArr

func (this *AppBaseConfig) SetStringArr(arr *[]string, v interface{}) bool

func (*AppBaseConfig) SetTime

func (this *AppBaseConfig) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*AppBaseConfig) Values

func (this *AppBaseConfig) Values() []interface{}

Values 数据值集合

type AppInfo

type AppInfo struct {
	Id           bson.ObjectId `json:"id" bson:"_id"`                  // ID
	Driver       string        `json:"driver" bson:"driver"`           // 设备类型 ios,android,win
	Download     string        `json:"download" bson:"download"`       // 下载链接
	Version      string        `json:"version" bson:"version"`         // 版本号
	Content      string        `json:"content" bson:"content"`         // 更新内容
	ForcedUpdate bool          `json:"state" bson:"forcedUpdate"`      // 是否强制更新
	PublishTime  int64         `json:"publishTime" bson:"publishTime"` // 版本发布时间
	Remark       string        `json:"remark" bson:"remark"`           // 备注
	AppName      string        `json:"appName" bson:"appName"`         // 应用名
	AppBuild     int           `json:"appBuild" bson:"appBuild"`       // 构建版本数字版本
	CreatedAt    time.Time     `json:"createdAt" bson:"createdAt"`     // 创建时间
	// contains filtered or unexported fields
}

AppInfo app Built 信息模型

func NewAppInfo

func NewAppInfo() *AppInfo

func (*AppInfo) AddExcludeKeys

func (this *AppInfo) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*AppInfo) AddFilters

func (this *AppInfo) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*AppInfo) Excludes

func (this *AppInfo) Excludes(key string) bool

Excludes 是否排除键

func (*AppInfo) Foreach

func (this *AppInfo) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*AppInfo) GetAppBuild

func (this *AppInfo) GetAppBuild() int

func (*AppInfo) GetAppName

func (this *AppInfo) GetAppName() string

func (*AppInfo) GetDownloadUrl

func (this *AppInfo) GetDownloadUrl() string

func (*AppInfo) GetFormatterTime

func (this *AppInfo) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*AppInfo) GetId

func (this *AppInfo) GetId() bson.ObjectId

func (*AppInfo) GetKeysFilter

func (this *AppInfo) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*AppInfo) GetNow

func (this *AppInfo) GetNow() time.Time

func (*AppInfo) GetTransformFilter

func (this *AppInfo) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*AppInfo) GetTransformFilterByKey

func (this *AppInfo) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*AppInfo) Init

func (this *AppInfo) Init()

func (*AppInfo) InitDefault

func (this *AppInfo) InitDefault()

InitDefault 初始化默认值

func (*AppInfo) IsEmpty

func (this *AppInfo) IsEmpty(v interface{}) bool

func (*AppInfo) Keys

func (this *AppInfo) Keys() []string

Keys 数据键集合

func (*AppInfo) M

func (this *AppInfo) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*AppInfo) Map

func (this *AppInfo) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*AppInfo) Merger

func (this *AppInfo) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*AppInfo) RemoveExcludeKeys

func (this *AppInfo) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*AppInfo) Save

func (this *AppInfo) Save() error

Save 保存

func (*AppInfo) Set

func (this *AppInfo) Set(key string, v interface{}) *AppInfo

func (*AppInfo) SetAttributes

func (this *AppInfo) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*AppInfo) SetBool

func (this *AppInfo) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*AppInfo) SetBsonMapper

func (this *AppInfo) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*AppInfo) SetMap

func (this *AppInfo) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*AppInfo) SetMapper

func (this *AppInfo) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*AppInfo) SetNumInt

func (this *AppInfo) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*AppInfo) SetNumIntN

func (this *AppInfo) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*AppInfo) SetObjectId

func (this *AppInfo) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*AppInfo) SetProvider

func (this *AppInfo) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*AppInfo) SetSameTypeValue

func (this *AppInfo) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*AppInfo) SetString

func (this *AppInfo) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*AppInfo) SetStringArr

func (this *AppInfo) SetStringArr(arr *[]string, v interface{}) bool

func (*AppInfo) SetTime

func (this *AppInfo) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*AppInfo) Values

func (this *AppInfo) Values() []interface{}

Values 数据值集合

type AppModel

type AppModel struct {
	BaseModel
}

func AppModelOf

func AppModelOf() *AppModel

func (*AppModel) Adds

func (this *AppModel) Adds(items []map[string]interface{}) error

批量添加更新

func (*AppModel) CreateIndex

func (this *AppModel) CreateIndex(force ...bool)

创建索引

func (*AppModel) GetAppBuild

func (this *AppModel) GetAppBuild(driver string) int

获取最新版本号

func (*AppModel) GetAppDownloadUrl

func (this *AppModel) GetAppDownloadUrl(driver string) string

获取最新版本号

func (*AppModel) GetAppVersion

func (this *AppModel) GetAppVersion(driver string) string

获取最新版本号

func (*AppModel) GetByUnique

func (this *AppModel) GetByUnique(data map[string]interface{}) *AppInfo

通过唯一索引查询

func (*AppModel) TableName

func (this *AppModel) TableName() string

表名

type ApplyInfo

type ApplyInfo struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`              // 工单ID
	Title     string        `json:"title" bson:"title"`         // 标题
	UserId    string        `json:"userId" bson:"userId"`       // 申请|举报人
	Type      string        `json:"type" bson:"type"`           // 类型
	Target    string        `json:"target" bson:"target"`       // 举报|申请目标 | mobile
	Images    []string      `json:"images" bson:"images"`       // 图片集合
	Status    int           `json:"status" bson:"status"`       // 状态
	Content   string        `json:"content" bson:"content"`     // 内容
	Extras    beego.M       `json:"extras" bson:"extras"`       // 扩展
	Date      int64         `json:"date" bson:"date"`           // 日期
	UpdatedAt time.Time     `json:"updatedAt" bson:"updatedAt"` // 更新时间
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"` // 创建时间
	// contains filtered or unexported fields
}

工单 (申请|举报) 记录

func NewApplyInfo

func NewApplyInfo() *ApplyInfo

func (*ApplyInfo) AddExcludeKeys

func (this *ApplyInfo) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*ApplyInfo) AddFilters

func (this *ApplyInfo) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*ApplyInfo) AppendImages

func (this *ApplyInfo) AppendImages(images ...string) *ApplyInfo

验证图片是否可用

func (*ApplyInfo) CheckType

func (this *ApplyInfo) CheckType() bool

func (*ApplyInfo) Excludes

func (this *ApplyInfo) Excludes(key string) bool

Excludes 是否排除键

func (*ApplyInfo) Foreach

func (this *ApplyInfo) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*ApplyInfo) GetFormatterTime

func (this *ApplyInfo) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*ApplyInfo) GetId

func (this *ApplyInfo) GetId() bson.ObjectId

func (*ApplyInfo) GetKeysFilter

func (this *ApplyInfo) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*ApplyInfo) GetNow

func (this *ApplyInfo) GetNow() time.Time

func (*ApplyInfo) GetTransformFilter

func (this *ApplyInfo) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*ApplyInfo) GetTransformFilterByKey

func (this *ApplyInfo) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*ApplyInfo) InitDefault

func (this *ApplyInfo) InitDefault()

InitDefault 初始化默认值

func (*ApplyInfo) IsEmpty

func (this *ApplyInfo) IsEmpty(v interface{}) bool

func (*ApplyInfo) Keys

func (this *ApplyInfo) Keys() []string

Keys 数据键集合

func (*ApplyInfo) M

func (this *ApplyInfo) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*ApplyInfo) Map

func (this *ApplyInfo) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*ApplyInfo) Merger

func (this *ApplyInfo) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*ApplyInfo) RemoveExcludeKeys

func (this *ApplyInfo) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*ApplyInfo) Save

func (this *ApplyInfo) Save() error

Save 保存

func (*ApplyInfo) Set

func (this *ApplyInfo) Set(key string, value interface{}) *ApplyInfo

func (*ApplyInfo) SetAttributes

func (this *ApplyInfo) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*ApplyInfo) SetBool

func (this *ApplyInfo) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*ApplyInfo) SetBsonMapper

func (this *ApplyInfo) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*ApplyInfo) SetMap

func (this *ApplyInfo) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*ApplyInfo) SetMapper

func (this *ApplyInfo) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*ApplyInfo) SetNumInt

func (this *ApplyInfo) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*ApplyInfo) SetNumIntN

func (this *ApplyInfo) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*ApplyInfo) SetObjectId

func (this *ApplyInfo) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*ApplyInfo) SetProvider

func (this *ApplyInfo) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*ApplyInfo) SetSameTypeValue

func (this *ApplyInfo) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*ApplyInfo) SetString

func (this *ApplyInfo) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*ApplyInfo) SetStringArr

func (this *ApplyInfo) SetStringArr(arr *[]string, v interface{}) bool

func (*ApplyInfo) SetTime

func (this *ApplyInfo) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*ApplyInfo) Values

func (this *ApplyInfo) Values() []interface{}

Values 数据值集合

type ApplyInfoModel

type ApplyInfoModel struct {
	BaseModel
}

func ApplyInfoModelOf

func ApplyInfoModelOf() *ApplyInfoModel

func (*ApplyInfoModel) Count

func (this *ApplyInfoModel) Count(query bson.M) int

func (*ApplyInfoModel) CreateIndex

func (this *ApplyInfoModel) CreateIndex(force ...bool)

func (*ApplyInfoModel) GetByUnique

func (this *ApplyInfoModel) GetByUnique(m beego.M) *ApplyInfo

func (*ApplyInfoModel) TableName

func (this *ApplyInfoModel) TableName() string

type Attachment

type Attachment struct {
	Id            bson.ObjectId `json:"id" bson:"_id"`                                          // id media_id
	FileName      string        `json:"filename" bson:"filename"`                               // 文件名
	Hash          string        `json:"hash" bson:"hash"`                                       // 文件hash值
	Ticket        string        `json:"ticket" bson:"ticket"`                                   // 文件上传时的密钥
	AppId         string        `json:"appId" bson:"appId"`                                     // 文件上传的应用
	UserId        bson.ObjectId `json:"userId,omitempty" bson:"userId,omitempty"`               // 文件上传用户
	ExtrasInfo    bson.M        `json:"extrasInfo,omitempty" bson:"extrasInfo,omitempty"`       // 文件扩展信息
	Tags          []string      `json:"tags,omitempty" bson:"tags,omitempty"`                   // 文件标签
	Url           string        `json:"url" bson:"url"`                                         // 远程访问链接
	Cdn           string        `json:"cdn,omitempty" bson:"cdn,omitempty"`                     // cdn 服务名
	CdnUrl        string        `json:"cdnUrl,omitempty" bson:"cdnUrl,omitempty"`               // cdn访问链接
	OssBucket     string        `json:"ossBucket,omitempty" bson:"ossBucket,omitempty"`         // oss bucket
	Oss           string        `json:"oss,omitempty" bson:"oss,omitempty"`                     // oss 服务名
	AccessTimes   int64         `json:"accessTimes,omitempty" bson:"accessTimes,omitempty"`     // 被访问次数
	DownloadTimes int64         `json:"downloadTimes,omitempty" bson:"downloadTimes,omitempty"` // 被下载次数
	Path          string        `json:"path" bson:"path"`                                       // 系统本地存储路径
	ReferName     string        `json:"referName" bson:"referName"`                             // 记录涉及的document名
	ReferId       string        `json:"referId" bson:"referId"`                                 // 记录涉及的document的ID
	Size          int64         `json:"size" bson:"size"`                                       // 文件大小 单位: byte
	SizeText      string        `json:"sizeText" bson:"sizeText"`                               // 带单的文件大小 eg: ..1G,120MB,1KB,1B,1byte
	FileType      string        `json:"fileType" bson:"fileType"`                               // 文件类型 [doc,image,avatar,mp4,mp3,txt....]
	Status        int           `json:"status" bson:"status"`                                   // 文件状态 [1,2,3]
	Privately     bool          `json:"privately" bson:"privately"`                             // 文件是否私有
	Watermark     bool          `json:"watermark" bson:"watermark"`                             // 文件是否有水印
	UpdatedAt     time.Time     `json:"updatedAt" bson:"updatedAt"`                             // 记录更新时间
	Duration      time.Duration `json:"duration,omitempty" bson:"duration,omitempty"`           // 音视频文件时长
	CoverId       bson.ObjectId `json:"coverId,omitempty" bson:"coverId,omitempty"`             // 音视频文件封面
	Width         int           `json:"width,omitempty" bson:"width,omitempty"`                 // 图片文件时宽
	Height        int           `json:"height,omitempty" bson:"height,omitempty"`               // 图片文件时高
	CreatedAt     time.Time     `json:"createdAt" bson:"createdAt"`                             // 创建时间
	DeletedAt     int64         `json:"deletedAt" bson:"deletedAt"`                             // 删除时间
}

附件模型

func NewAttachment

func NewAttachment() *Attachment

func (*Attachment) AutoType

func (this *Attachment) AutoType() *Attachment

func (*Attachment) CertificateUrl

func (this *Attachment) CertificateUrl(url string, expire ...int64) string

获取认证访问的url

func (*Attachment) CheckType

func (this *Attachment) CheckType() bool

func (*Attachment) Defaults

func (this *Attachment) Defaults() *Attachment

func (*Attachment) GetBase

func (this *Attachment) GetBase(seps ...string) string

func (*Attachment) GetCoverInfo

func (this *Attachment) GetCoverInfo(id bson.ObjectId) *Attachment

func (*Attachment) GetLocal

func (this *Attachment) GetLocal() string

func (*Attachment) GetUrl

func (this *Attachment) GetUrl() string

func (*Attachment) Image

func (this *Attachment) Image() *Image

func (*Attachment) Load

func (this *Attachment) Load(data map[string]interface{}) *Attachment

func (*Attachment) M

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

func (*Attachment) Video

func (this *Attachment) Video() *Video

type AttachmentModel

type AttachmentModel struct {
	BaseModel
}

func AttachmentModelOf

func AttachmentModelOf() *AttachmentModel

func (*AttachmentModel) CreateIndex

func (this *AttachmentModel) CreateIndex(force ...bool)

func (*AttachmentModel) GetByMediaId

func (this *AttachmentModel) GetByMediaId(id string) (*Attachment, error)

func (*AttachmentModel) GetImageById

func (this *AttachmentModel) GetImageById(id string) *Image

GetImageById 获取图片

func (*AttachmentModel) GetVideoById

func (this *AttachmentModel) GetVideoById(id string) *Video

GetVideoById 获取视频对象

func (*AttachmentModel) ImageOk

func (this *AttachmentModel) ImageOk(id string) bool

ImageOk 图片是否可用

func (*AttachmentModel) TableName

func (this *AttachmentModel) TableName() string

func (*AttachmentModel) TypeMediaOk

func (this *AttachmentModel) TypeMediaOk(id string, ty string) bool

TypeMediaOk 类型文件是存在

func (*AttachmentModel) VideoOk

func (this *AttachmentModel) VideoOk(id string) bool

VideoOk 视频是否可用

type AuditLog

type AuditLog struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`              // ID
	UserId    string        `json:"userId" json:"userId"`       // 审核用户ID
	Platform  int           `json:"platform" bson:"platform"`   // 审核端 [1:ios,2,android,3,pc]
	PostId    string        `json:"postId" bson:"postId"`       // 文件ID
	AuditType string        `json:"auditType" bson:"auditType"` // 类型
	Comment   string        `json:"comment" bson:"comment"`     // 备注
	UpdatedAt time.Time     `json:"updatedAt" bson:"updatedAt"` // 更新时间时间
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"` // 创建时间
	// contains filtered or unexported fields
}

审核日志

func NewAuditLog

func NewAuditLog() *AuditLog

func (*AuditLog) AddExcludeKeys

func (this *AuditLog) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*AuditLog) AddFilters

func (this *AuditLog) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*AuditLog) Excludes

func (this *AuditLog) Excludes(key string) bool

Excludes 是否排除键

func (*AuditLog) Foreach

func (this *AuditLog) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*AuditLog) GetFormatterTime

func (this *AuditLog) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*AuditLog) GetId

func (this *AuditLog) GetId() bson.ObjectId

func (*AuditLog) GetKeysFilter

func (this *AuditLog) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*AuditLog) GetNow

func (this *AuditLog) GetNow() time.Time

func (*AuditLog) GetTransformFilter

func (this *AuditLog) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*AuditLog) GetTransformFilterByKey

func (this *AuditLog) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*AuditLog) Init

func (this *AuditLog) Init()

func (*AuditLog) InitDefault

func (this *AuditLog) InitDefault()

InitDefault 初始化默认值

func (*AuditLog) IsEmpty

func (this *AuditLog) IsEmpty(v interface{}) bool

func (*AuditLog) Keys

func (this *AuditLog) Keys() []string

Keys 数据键集合

func (*AuditLog) M

func (this *AuditLog) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*AuditLog) Map

func (this *AuditLog) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*AuditLog) Merger

func (this *AuditLog) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*AuditLog) RemoveExcludeKeys

func (this *AuditLog) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*AuditLog) Save

func (this *AuditLog) Save() error

Save 保存

func (*AuditLog) Set

func (this *AuditLog) Set(key string, v interface{}) *AuditLog

func (*AuditLog) SetAttributes

func (this *AuditLog) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*AuditLog) SetBool

func (this *AuditLog) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*AuditLog) SetBsonMapper

func (this *AuditLog) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*AuditLog) SetMap

func (this *AuditLog) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*AuditLog) SetMapper

func (this *AuditLog) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*AuditLog) SetNumInt

func (this *AuditLog) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*AuditLog) SetNumIntN

func (this *AuditLog) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*AuditLog) SetObjectId

func (this *AuditLog) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*AuditLog) SetProvider

func (this *AuditLog) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*AuditLog) SetSameTypeValue

func (this *AuditLog) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*AuditLog) SetString

func (this *AuditLog) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*AuditLog) SetStringArr

func (this *AuditLog) SetStringArr(arr *[]string, v interface{}) bool

func (*AuditLog) SetTime

func (this *AuditLog) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*AuditLog) Values

func (this *AuditLog) Values() []interface{}

Values 数据值集合

type AuditLogModel

type AuditLogModel struct {
	BaseModel
}

func AuditLogModelOf

func AuditLogModelOf() *AuditLogModel

func (*AuditLogModel) CreateIndex

func (this *AuditLogModel) CreateIndex(force ...bool)

func (*AuditLogModel) GetByUnique

func (this *AuditLogModel) GetByUnique(m beego.M) *AuditLog

func (*AuditLogModel) TableName

func (this *AuditLogModel) TableName() string

type AuthModel

type AuthModel struct {
	BaseModel
}

func AuthModelOf

func AuthModelOf() *AuthModel

type AvatarInfo

type AvatarInfo struct {
	AvatarUrl string `json:"avatarUrl"`
	AvatarId  string `json:"avatarId"`
}

头像信息

func NewAvatarInfo

func NewAvatarInfo(avatarId string) *AvatarInfo

type AwardWay

type AwardWay struct {
	Name   string `json:"name" bson:"name"`
	Config bson.M `json:"config" bson:"config"`
}

奖励方式 | 结算方式

type BaseModel

type BaseModel struct {
	Err error
	// contains filtered or unexported fields
}

func (*BaseModel) Add

func (this *BaseModel) Add(docs interface{}) error

func (*BaseModel) AddScopeQuery

func (this *BaseModel) AddScopeQuery(m bson.M)

AddScopeQuery 添加局部查询

func (*BaseModel) All

func (this *BaseModel) All(query interface{}, result interface{}, selects ...interface{}) error

func (*BaseModel) Bind

func (this *BaseModel) Bind(v interface{}) Model

Bind 绑定数据对象

func (*BaseModel) Collection

func (this *BaseModel) Collection(doc ...string) *mgo.Collection

func (*BaseModel) Commit

func (this *BaseModel) Commit(ctx TxnContext) error

Commit 提交事务

func (*BaseModel) Count

func (this *BaseModel) Count(query interface{}) int

func (*BaseModel) Db

func (this *BaseModel) Db(db ...string) *mgo.Database

func (*BaseModel) Deletes

func (this *BaseModel) Deletes(query interface{}, softDelete ...bool) (*mgo.ChangeInfo, error)

func (*BaseModel) Document

func (this *BaseModel) Document() *mgo.Collection

func (*BaseModel) Error

func (this *BaseModel) Error() error

func (*BaseModel) Exists

func (this *BaseModel) Exists(query interface{}) bool

func (*BaseModel) FindOne

func (this *BaseModel) FindOne(query interface{}, result interface{}, selects ...interface{}) error

func (*BaseModel) GetById

func (this *BaseModel) GetById(id string, result interface{}, selects ...interface{}) error

func (*BaseModel) GetByKey

func (this *BaseModel) GetByKey(key string, v interface{}, result interface{}) error

func (*BaseModel) GetByObjectId

func (this *BaseModel) GetByObjectId(id bson.ObjectId, result interface{}, selects ...interface{}) error

func (*BaseModel) GetConn

func (this *BaseModel) GetConn(conn ...string) *mgo.Session

func (*BaseModel) GetDatabaseName

func (this *BaseModel) GetDatabaseName(conn ...string) string

func (*BaseModel) GetProfile

func (this *BaseModel) GetProfile(key string, defaults ...interface{}) interface{}

func (*BaseModel) Gets

func (this *BaseModel) Gets(query interface{}, result interface{}, selects ...interface{}) error

func (*BaseModel) IncrBy

func (this *BaseModel) IncrBy(query interface{}, incr interface{}) error

func (*BaseModel) Init

func (this *BaseModel) Init()

func (*BaseModel) Insert

func (this *BaseModel) Insert(docs interface{}) error

func (*BaseModel) Inserts

func (this *BaseModel) Inserts(docs []interface{}) error

func (*BaseModel) IsDuplicate

func (this *BaseModel) IsDuplicate(err error) bool

IsDuplicate 是重复异常

func (*BaseModel) IsErrCursor

func (this *BaseModel) IsErrCursor(err error) bool

IsErrCursor 游标异常

func (*BaseModel) IsNotFound

func (this *BaseModel) IsNotFound(err error) bool

IsNotFound 记录不存在异常

func (*BaseModel) Lists

func (this *BaseModel) Lists(query interface{}, result interface{}, limit ListsParams, selects ...interface{}) (int, error)

func (*BaseModel) ListsQuery

func (this *BaseModel) ListsQuery(query interface{}, limit ListsParams, selects ...interface{}) *mgo.Query

func (*BaseModel) NewQuery

func (this *BaseModel) NewQuery(query bson.M) *mgo.Query

func (*BaseModel) Pipe

func (this *BaseModel) Pipe(handler func(pipe *mgo.Pipe) interface{}) interface{}

Pipe 高级查询

func (*BaseModel) Release

func (this *BaseModel) Release()

Release 释放

func (*BaseModel) Remove

func (this *BaseModel) Remove(query interface{}, softDelete ...bool) error

func (*BaseModel) Self

func (this *BaseModel) Self() Model

func (*BaseModel) Server

func (this *BaseModel) Server(server ...string) *mgo.Session

func (*BaseModel) SetProfile

func (this *BaseModel) SetProfile(key string, v interface{}) Model

func (*BaseModel) StartTxn

func (this *BaseModel) StartTxn(docs ...*mgo.Collection) (bson.ObjectId, *txn.Runner)

StartTxn 创建事务

func (*BaseModel) Sum

func (this *BaseModel) Sum(query bson.M, sum string) int

Sum 计算和 [

'$match' => $map],
 [
 '$group' => [
      '_id' => null,
      'total_money' => ['$sum' => '$money'],
      'total_money_usd' => ['$sum' => '$money_usd']
  ]

]

func (*BaseModel) Txn

func (this *BaseModel) Txn(handler func(runner *txn.Runner, txnId bson.ObjectId) error) error

Txn 执行事务 示例:

 ops := []txn.Op{{
				C:      "accounts",
				Id:     "aram",
				Assert: bson.M{"balance": bson.M{"$gte": 100}},
				Update: M{"$inc": M{"balance": -100}},
		}, {
				C:      "accounts",
				Id:     "ben",
				Assert: M{"valid": true},
				Update: M{"$inc": M{"balance": 100}},
		}}
	  runner.Run(ops, id, nil)

func (*BaseModel) UnUseSoftDel

func (this *BaseModel) UnUseSoftDel()

UnUseSoftDel 移出软删除条件

func (*BaseModel) Update

func (this *BaseModel) Update(query interface{}, data interface{}) error

func (*BaseModel) UpdateById

func (this *BaseModel) UpdateById(id string, data interface{}) error

func (*BaseModel) Updates

func (this *BaseModel) Updates(query interface{}, data interface{}) (*mgo.ChangeInfo, error)

func (*BaseModel) UseScopeQuery

func (this *BaseModel) UseScopeQuery(m bson.M) bson.M

UseScopeQuery 使用局部查询

func (*BaseModel) UseSoftDelete

func (this *BaseModel) UseSoftDelete(status ...int64)

UseSoftDelete 使用软删除查询

func (*BaseModel) WrapperScopeQuery

func (this *BaseModel) WrapperScopeQuery(query interface{}) interface{}

WrapperScopeQuery 查询作用域

type CaptchaModel

type CaptchaModel struct {
	BaseModel
}

func CaptchaModelOf

func CaptchaModelOf() *CaptchaModel

type ClassifyModel

type ClassifyModel struct {
	BaseModel
}

func ClassifyModelOf

func ClassifyModelOf() *ClassifyModel

type Collect

type Collect struct {
	Id         bson.ObjectId `json:"id" bson:"_id"`                // ID
	UserId     string        `json:"userId" bson:"userId"`         // 用户ID
	TargetId   string        `json:"targetId" bson:"targetId"`     // 收藏目标ID
	TargetType string        `json:"targetType" bson:"targetType"` // 收藏类型
	Status     int           `json:"status" bson:"status"`         // 状态
	Versions   []string      `json:"versions" bson:"versions"`     // 状态版本变化历史
	CreatedAt  time.Time     `json:"createdAt" bson:"createdAt"`   // 创建时间
	UpdatedAt  time.Time     `json:"updatedAt" bson:"updatedAt"`   // 更新时间
	DeletedAt  int64         `json:"deletedAt" bson:"deletedAt"`   // 删除时间
	// contains filtered or unexported fields
}

Collect 收藏记录

func NewCollect

func NewCollect() *Collect

func (*Collect) AddExcludeKeys

func (this *Collect) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*Collect) AddFilters

func (this *Collect) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*Collect) Excludes

func (this *Collect) Excludes(key string) bool

Excludes 是否排除键

func (*Collect) Foreach

func (this *Collect) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*Collect) GetFormatterTime

func (this *Collect) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*Collect) GetId

func (this *Collect) GetId() bson.ObjectId

func (*Collect) GetKeysFilter

func (this *Collect) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*Collect) GetNow

func (this *Collect) GetNow() time.Time

func (*Collect) GetTransformFilter

func (this *Collect) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*Collect) GetTransformFilterByKey

func (this *Collect) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*Collect) Init

func (this *Collect) Init()

func (*Collect) InitDefault

func (this *Collect) InitDefault()

InitDefault 初始化默认值

func (*Collect) IsEmpty

func (this *Collect) IsEmpty(v interface{}) bool

func (*Collect) Keys

func (this *Collect) Keys() []string

Keys 数据键集合

func (*Collect) M

func (this *Collect) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*Collect) Map

func (this *Collect) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*Collect) Merger

func (this *Collect) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*Collect) RemoveExcludeKeys

func (this *Collect) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*Collect) Save

func (this *Collect) Save() error

Save 保存

func (*Collect) Set

func (this *Collect) Set(key string, v interface{}) *Collect

func (*Collect) SetAttributes

func (this *Collect) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*Collect) SetBool

func (this *Collect) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*Collect) SetBsonMapper

func (this *Collect) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*Collect) SetMap

func (this *Collect) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*Collect) SetMapper

func (this *Collect) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*Collect) SetNumInt

func (this *Collect) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*Collect) SetNumIntN

func (this *Collect) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*Collect) SetObjectId

func (this *Collect) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*Collect) SetProvider

func (this *Collect) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*Collect) SetSameTypeValue

func (this *Collect) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*Collect) SetString

func (this *Collect) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*Collect) SetStringArr

func (this *Collect) SetStringArr(arr *[]string, v interface{}) bool

func (*Collect) SetTime

func (this *Collect) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*Collect) Values

func (this *Collect) Values() []interface{}

Values 数据值集合

type CollectModel

type CollectModel struct {
	BaseModel
}

CollectModel 收藏记录model

func CollectModelOf

func CollectModelOf() *CollectModel

func (*CollectModel) CreateIndex

func (this *CollectModel) CreateIndex(force ...bool)

func (*CollectModel) GetByUnique

func (this *CollectModel) GetByUnique(m beego.M) *Collect

func (*CollectModel) GetTravelNote

func (this *CollectModel) GetTravelNote(id string) *TravelNotes

func (*CollectModel) GetTravelNotesByIds

func (this *CollectModel) GetTravelNotesByIds(ids []string) []*TravelNotes

func (*CollectModel) TableName

func (this *CollectModel) TableName() string

type Comment

type Comment struct {
	Id          bson.ObjectId `json:"id" bson:"_id"`                                  // ID
	UserId      string        `json:"userId" bson:"userId"`                           // 评论人
	Content     string        `json:"content" bson:"content"`                         // 评论内容
	TargetId    string        `json:"targetId" bson:"targetId"`                       // 评论目标ID
	TargetType  string        `json:"targetType" bson:"targetType"`                   // 评论类型
	Status      int           `json:"status" bson:"status"`                           // 审核状态
	RefersIds   []string      `json:"refersIds,omitempty" bson:"refersIds,omitempty"` // 涉及ID
	ThumbsUpNum int64         `json:"thumbsUpNum" bson:"thumbsUpNum"`                 // 评论点赞数
	ReviewNum   int64         `json:"reviewNum" bson:"reviewNum"`                     // 评论回复数量
	Sort        int64         `json:"sort" bson:"sort"`                               // 排序
	Tags        []string      `json:"tags" bson:"tags"`                               // 评论标签
	CreatedAt   time.Time     `json:"createdAt" bson:"createdAt"`                     // 评论时间
	UpdatedAt   time.Time     `json:"updatedAt" bson:"updatedAt"`                     // 更新时间
	DeletedAt   int64         `json:"deletedAt" bson:"deletedAt"`                     // 删除时间戳
	// contains filtered or unexported fields
}

Comment 评论数据

func NewComment

func NewComment() *Comment

func (*Comment) AddExcludeKeys

func (this *Comment) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*Comment) AddFilters

func (this *Comment) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*Comment) CheckType

func (this *Comment) CheckType() bool

func (*Comment) Defaults

func (this *Comment) Defaults() *Comment

func (*Comment) Excludes

func (this *Comment) Excludes(key string) bool

Excludes 是否排除键

func (*Comment) Foreach

func (this *Comment) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*Comment) GetFormatterTime

func (this *Comment) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*Comment) GetId

func (this *Comment) GetId() bson.ObjectId

func (*Comment) GetKeysFilter

func (this *Comment) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*Comment) GetNow

func (this *Comment) GetNow() time.Time

func (*Comment) GetStatusText

func (this *Comment) GetStatusText() string

func (*Comment) GetTransformFilter

func (this *Comment) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*Comment) GetTransformFilterByKey

func (this *Comment) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*Comment) InitDefault

func (this *Comment) InitDefault()

InitDefault 初始化默认值

func (*Comment) IsEmpty

func (this *Comment) IsEmpty(v interface{}) bool

func (*Comment) Keys

func (this *Comment) Keys() []string

Keys 数据键集合

func (*Comment) Load

func (this *Comment) Load(data map[string]interface{}) *Comment

func (*Comment) M

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

func (*Comment) Map

func (this *Comment) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*Comment) Merger

func (this *Comment) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*Comment) RemoveExcludeKeys

func (this *Comment) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*Comment) Save

func (this *Comment) Save() error

func (*Comment) Set

func (this *Comment) Set(key string, v interface{}) *Comment

func (*Comment) SetAttributes

func (this *Comment) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*Comment) SetBool

func (this *Comment) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*Comment) SetBsonMapper

func (this *Comment) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*Comment) SetMap

func (this *Comment) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*Comment) SetMapper

func (this *Comment) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*Comment) SetNumInt

func (this *Comment) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*Comment) SetNumIntN

func (this *Comment) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*Comment) SetObjectId

func (this *Comment) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*Comment) SetProvider

func (this *Comment) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*Comment) SetSameTypeValue

func (this *Comment) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*Comment) SetString

func (this *Comment) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*Comment) SetStringArr

func (this *Comment) SetStringArr(arr *[]string, v interface{}) bool

func (*Comment) SetTime

func (this *Comment) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*Comment) Values

func (this *Comment) Values() []interface{}

Values 数据值集合

type CommentModel

type CommentModel struct {
	BaseModel
}

func CommentModelOf

func CommentModelOf() *CommentModel

func (*CommentModel) CreateIndex

func (this *CommentModel) CreateIndex(force ...bool)

func (*CommentModel) TableName

func (this *CommentModel) TableName() string

type Config

type Config struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`              // ID
	Key       string        `json:"key" bson:"key"`             // 键名
	Value     interface{}   `json:"value" json:"value"`         // 值
	Root      string        `json:"root" bson:"root"`           // 分组
	State     int           `json:"state" bson:"state"`         // 状态
	Title     string        `json:"title" bson:"title"`         // 备注
	UpdatedAt time.Time     `json:"updatedAt" bson:"updatedAt"` // 更新时间
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"` // 创建时间
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) AddExcludeKeys

func (this *Config) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*Config) AddFilters

func (this *Config) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*Config) Excludes

func (this *Config) Excludes(key string) bool

Excludes 是否排除键

func (*Config) Foreach

func (this *Config) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*Config) GetFormatterTime

func (this *Config) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*Config) GetId

func (this *Config) GetId() bson.ObjectId

func (*Config) GetKeysFilter

func (this *Config) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*Config) GetNow

func (this *Config) GetNow() time.Time

func (*Config) GetTransformFilter

func (this *Config) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*Config) GetTransformFilterByKey

func (this *Config) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*Config) Init

func (this *Config) Init()

func (*Config) InitDefault

func (this *Config) InitDefault()

InitDefault 初始化默认值

func (*Config) InitTimes

func (this *Config) InitTimes()

func (*Config) IsEmpty

func (this *Config) IsEmpty(v interface{}) bool

func (*Config) Keys

func (this *Config) Keys() []string

Keys 数据键集合

func (*Config) M

func (this *Config) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*Config) Map

func (this *Config) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*Config) Merger

func (this *Config) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*Config) RemoveExcludeKeys

func (this *Config) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*Config) Save

func (this *Config) Save() error

Save 保存

func (*Config) Set

func (this *Config) Set(key string, v interface{}) *Config

func (*Config) SetAttributes

func (this *Config) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*Config) SetBool

func (this *Config) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*Config) SetBsonMapper

func (this *Config) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*Config) SetMap

func (this *Config) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*Config) SetMapper

func (this *Config) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*Config) SetNumInt

func (this *Config) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*Config) SetNumIntN

func (this *Config) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*Config) SetObjectId

func (this *Config) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*Config) SetProvider

func (this *Config) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*Config) SetSameTypeValue

func (this *Config) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*Config) SetString

func (this *Config) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*Config) SetStringArr

func (this *Config) SetStringArr(arr *[]string, v interface{}) bool

func (*Config) SetTime

func (this *Config) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*Config) Values

func (this *Config) Values() []interface{}

Values 数据值集合

type ConfigModel

type ConfigModel struct {
	BaseModel
}

func ConfigModelOf

func ConfigModelOf() *ConfigModel

配置模型

func (*ConfigModel) CreateIndex

func (this *ConfigModel) CreateIndex(force ...bool)

创建索引

func (*ConfigModel) Get

func (this *ConfigModel) Get(key string, scope string, state ...int) *Config

获取

func (*ConfigModel) GetBool

func (this *ConfigModel) GetBool(key string, scope ...string) bool

获取字符串配置

func (*ConfigModel) GetByUnique

func (this *ConfigModel) GetByUnique(data map[string]interface{}, state ...int) *Config

通过唯一条件查询

func (*ConfigModel) GetItemsByScope

func (this *ConfigModel) GetItemsByScope(scope string, state ...int) []Config

获取对应数据配置

func (*ConfigModel) GetString

func (this *ConfigModel) GetString(key string, scope ...string) string

获取字符串配置

func (*ConfigModel) Remove

func (this *ConfigModel) Remove(key string, scope ...string) error

移除配置

func (*ConfigModel) Set

func (this *ConfigModel) Set(key string, v interface{}, scope ...string) error

设置配置

func (*ConfigModel) TableName

func (this *ConfigModel) TableName() string

表名

type ConnOption

type ConnOption struct {
	Db       string `json:"db"`     // 数据库
	Server   string `json:"server"` // 配置类型
	Document string `json:"table"`  // 表,文档
}

ConnOption 配置

type DataClass

type DataClass interface {
	Save() error
	InitDefault()
	Keys() []string
	Values() []interface{}
	Excludes(string) bool
	AddExcludeKeys(...string)
	RemoveExcludeKeys(...string)
	SetProvider(name string, v interface{})
	M(filter ...func(m beego.M) beego.M) beego.M
	AddFilters(filters ...func(m beego.M) beego.M)
	SetAttributes(m map[string]interface{}, safe ...bool)
}

type DiscoverModel

type DiscoverModel struct {
	BaseModel
}

func DiscoverModelOf

func DiscoverModelOf() *DiscoverModel

func (*DiscoverModel) Get

func (this *DiscoverModel) Get()

type FullListsParams

type FullListsParams interface {
	ListsParams

	OrderByParam
}

type HeaderSchema

type HeaderSchema struct {
	AppVersion   string  `json:"appVer" bson:"appVer"`                                    //  app 版本 eg: 1.0.0 [0000.00.00]
	Driver       string  `json:"driver" bson:"driver"`                                    //  设备类型 [ios,android,winPhone,win,mac,linux]
	Location     string  `json:"location,omitempty" bson:"location,omitempty"`            //  定位信息 eg: 中国-广东-广州-天河
	Lng          float64 `json:"lng,omitempty" bson:"lng,omitempty"`                      //  定位经度
	Lat          float64 `json:"lat,omitempty" bson:"lat,omitempty"`                      //  定位纬度
	AppId        string  `json:"appId" bson:"appId"`                                      //  appId | android-client:0,ios-client:1,pc:2
	Signature    string  `json:"sign" bson:"signature" `                                  //  参数签名
	Lang         string  `json:"lang" bson:"lang" `                                       //  语言 eg: 中文简体:zh-CN,中文繁体:zh-TW,英语:en, 马来语: my
	Country      string  `json:"country" bson:"country"`                                  //  国家简码 ,eg:CN
	UserOpenId   string  `json:"userOpenId" json:"userOpenId"`                            //  设备 uuid | 用户临时访问身份
	TimeStamp    int64   `json:"timestamp" bson:"timestamp"`                              //  访问时间戳
	Auth         string  `json:"authorization" bson:"authorization"`                      //  用户登陆token
	LaunchLink   string  `json:"launchLink" bson:"launchLink"`                            //  启动页路由|引导开发链接|推广链接
	Code         string  `json:"code,omitempty" bson:"code,omitempty"`                    //  追踪码|活动码
	From         string  `json:"from,omitempty" bson:"from,omitempty"`                    //  来源 0-分享 1-pc 2-h5 3-android 4-ios
	Tags         string  `json:"tags,omitempty" bson:"tags,omitempty"`                    //  tags eg: Travel
	RequestId    string  `json:"requestId,omitempty" bson:"requestId,omitempty"`          //  请求ID
	Crypto       string  `json:"X-Crypto,omitempty" bson:"crypto"`                        //  通信加密方式
	UserAgent    string  `json:"User-Agent" json:"userAgent"`                             //  http client user-agent
	Method       string  `json:":method" bson:"method"`                                   //  请求方法
	Authority    string  `json:":authority,omitempty" json:"authority,omitempty"`         //  请求域
	Path         string  `json:":path,omitempty" bson:"path,omitempty"`                   //  请求接口Path
	ClientIpAddr string  `json:"X-Forwarded-For,omitempty" bson:"clientIpAddr,omitempty"` //  请求ip
	RealIp       string  `json:"X-Real-Ip" bson:"realIp"`                                 //  请求ip
	RemoteAddr   string  `json:"Remote-Address,omitempty" json:"remoteAddr,omitempty"`    //  远程请求ip
	ContentType  string  `json:"Content-Type" bson:"contentType"`                         //  请求数据格式
	Scheme       string  `json:":scheme" bson:"scheme"`                                   //  请求 schema [http,https]
	// contains filtered or unexported fields
}

HeaderSchema 请求头部

func NewHeaderSchema

func NewHeaderSchema() *HeaderSchema

func (*HeaderSchema) AddExcludeKeys

func (this *HeaderSchema) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*HeaderSchema) AddFilters

func (this *HeaderSchema) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*HeaderSchema) Excludes

func (this *HeaderSchema) Excludes(key string) bool

Excludes 是否排除键

func (*HeaderSchema) Foreach

func (this *HeaderSchema) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*HeaderSchema) GetFormatterTime

func (this *HeaderSchema) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*HeaderSchema) GetId

func (this *HeaderSchema) GetId() bson.ObjectId

func (*HeaderSchema) GetKeysFilter

func (this *HeaderSchema) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*HeaderSchema) GetNow

func (this *HeaderSchema) GetNow() time.Time

func (*HeaderSchema) GetTransformFilter

func (this *HeaderSchema) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*HeaderSchema) GetTransformFilterByKey

func (this *HeaderSchema) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*HeaderSchema) Init

func (this *HeaderSchema) Init()

func (*HeaderSchema) InitDefault

func (this *HeaderSchema) InitDefault()

InitDefault 初始化默认值

func (*HeaderSchema) IsEmpty

func (this *HeaderSchema) IsEmpty(v interface{}) bool

func (*HeaderSchema) Keys

func (this *HeaderSchema) Keys() []string

Keys 数据键集合

func (*HeaderSchema) M

func (this *HeaderSchema) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*HeaderSchema) Map

func (this *HeaderSchema) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*HeaderSchema) Merger

func (this *HeaderSchema) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*HeaderSchema) RemoveExcludeKeys

func (this *HeaderSchema) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*HeaderSchema) Save

func (this *HeaderSchema) Save() error

Save 保存

func (*HeaderSchema) Set

func (this *HeaderSchema) Set(_ string, _ interface{}) *HeaderSchema

func (*HeaderSchema) SetAttributes

func (this *HeaderSchema) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*HeaderSchema) SetBool

func (this *HeaderSchema) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*HeaderSchema) SetBsonMapper

func (this *HeaderSchema) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*HeaderSchema) SetMap

func (this *HeaderSchema) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*HeaderSchema) SetMapper

func (this *HeaderSchema) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*HeaderSchema) SetNumInt

func (this *HeaderSchema) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*HeaderSchema) SetNumIntN

func (this *HeaderSchema) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*HeaderSchema) SetObjectId

func (this *HeaderSchema) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*HeaderSchema) SetProvider

func (this *HeaderSchema) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*HeaderSchema) SetSameTypeValue

func (this *HeaderSchema) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*HeaderSchema) SetString

func (this *HeaderSchema) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*HeaderSchema) SetStringArr

func (this *HeaderSchema) SetStringArr(arr *[]string, v interface{}) bool

func (*HeaderSchema) SetTime

func (this *HeaderSchema) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*HeaderSchema) Values

func (this *HeaderSchema) Values() []interface{}

Values 数据值集合

type Image

type Image struct {
	MediaId  string `json:"mediaId" bson:"mediaId"`   // id
	Url      string `json:"url" bson:"url"`           // url
	Size     int    `json:"size" bson:"size"`         // 大小
	SizeText string `json:"sizeText" bson:"sizeText"` // 大小描述
	Width    int    `json:"width" bson:"width"`       // 宽
	Height   int    `json:"height" bson:"height"`     // 高
}

Image 图片

func (*Image) M

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

type IndexConstructor

type IndexConstructor interface {
	CreateIndex(force ...bool)
}

type ListParamsExtras

type ListParamsExtras interface {
	ListsParams

	SetArg(string, interface{})
	GetArg(string) interface{}
}

type ListsParamImpl

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

func NewListParam

func NewListParam(page, size int) *ListsParamImpl

func (*ListsParamImpl) Count

func (this *ListsParamImpl) Count() int

func (*ListsParamImpl) GetArg

func (this *ListsParamImpl) GetArg(key string) interface{}

func (*ListsParamImpl) More

func (this *ListsParamImpl) More() bool

func (*ListsParamImpl) Order

func (this *ListsParamImpl) Order(key, order string)

func (*ListsParamImpl) Page

func (this *ListsParamImpl) Page() int

func (*ListsParamImpl) ParseOrder

func (this *ListsParamImpl) ParseOrder(query *mgo.Query)

func (*ListsParamImpl) SetArg

func (this *ListsParamImpl) SetArg(key string, v interface{})

func (*ListsParamImpl) SetTotal

func (this *ListsParamImpl) SetTotal(total int) ListsParams

func (*ListsParamImpl) Skip

func (this *ListsParamImpl) Skip() int

type ListsParams

type ListsParams interface {
	Page() int
	Count() int
	Skip() int
	SetTotal(int) ListsParams
	More() bool
}

type Location

type Location struct {
	Longitude float64 `json:"longitude" bson:"longitude"` // 经度 [东-西]
	Latitude  float64 `json:"latitude" bson:"latitude"`   // 纬度 [南-北]
}

定位

func NewLocation

func NewLocation(x, y float64) *Location

func (*Location) GetDesc

func (this *Location) GetDesc() []string

func (*Location) GetLatitudeDesc

func (this *Location) GetLatitudeDesc() string

func (*Location) GetLongitudeDesc

func (this *Location) GetLongitudeDesc() string

func (*Location) Json

func (this *Location) Json() []byte

func (*Location) PointX

func (this *Location) PointX() float64

func (*Location) PointY

func (this *Location) PointY() float64

func (*Location) Points

func (this *Location) Points() []float64

type Location3d

type Location3d struct {
	Location
	Altitude float64 `json:"altitude" bson:"altitude"` // 高度 [海拔]
}

3d 定位

func NewLocation3d

func NewLocation3d(x, y, z float64) *Location3d

func (*Location3d) GetAltitudeDesc

func (this *Location3d) GetAltitudeDesc() string

func (*Location3d) GetDesc

func (this *Location3d) GetDesc() []string

func (*Location3d) Json

func (this *Location3d) Json() []byte

func (*Location3d) PointZ

func (this *Location3d) PointZ() float64

func (*Location3d) Points

func (this *Location3d) Points() []float64

type MapperAble

type MapperAble interface {
	M(filters ...func(m beego.M) beego.M) beego.M
}

type MessageLog

type MessageLog struct {
	Id             bson.ObjectId `json:"id" bson:"id"`                                             // 消息ID
	Title          string        `json:"title" bson:"title"`                                       // 消息标题
	Type           string        `json:"type" bson:"type"`                                         // 消息类型 [register.sms,register.email,reset.sms,rebind.email,bind.sms]
	SenderProvider string        `json:"provider" bson:"provider"`                                 // 发送服务名
	Extras         bson.M        `json:"extras,omitempty" bson:"extras,omitempty"`                 // 扩展信息
	Content        string        `json:"content" bson:"content"`                                   // 消息内容
	SenderUserId   string        `json:"senderUserIdAt,omitempty" bson:"senderUserIdAt,omitempty"` // 发送人
	TargetUserId   string        `json:"targetUserId,omitempty" bson:"targetUserId,omitempty"`     // 接受人
	Mobile         string        `json:"mobile,omitempty" bson:"mobile,omitempty"`                 // 手机消息手机号
	Email          string        `json:"email,omitempty" bson:"email,omitempty"`                   // 邮箱信息邮箱号
	State          int           `json:"state" bson:"state"`                                       // 消息状态 [-3:拒绝接收,-2:发送失败,-1:待处理,0:未知,1:已发送,2:已阅读]
	Result         string        `json:"result,omitempty" bson:"result,omitempty"`                 // 第三方消息结果
	SentTime       int64         `json:"sentTime" bson:"sentTime"`                                 // 发送时间
	ExpireTime     int64         `json:"expireTime,omitempty" bson:"expireTime,omitempty"`         // 消息过期时间
	ReadTime       int64         `json:"readTime,omitempty" bson:"readTime,omitempty"`             // 消息阅读时间
	CreatedAt      time.Time     `json:"createdAt" bson:"createdAt"`                               // 记录创建时间
}

func NewMessageLog

func NewMessageLog() *MessageLog

func (*MessageLog) Defaults

func (this *MessageLog) Defaults() *MessageLog

func (*MessageLog) Load

func (this *MessageLog) Load(data map[string]interface{}) *MessageLog

func (*MessageLog) Set

func (this *MessageLog) Set(key string, v interface{}) *MessageLog

type MessageModel

type MessageModel struct {
	BaseModel
}

func MessageModelOf

func MessageModelOf() *MessageModel

func (*MessageModel) CreateIndex

func (this *MessageModel) CreateIndex(force ...bool)

func (*MessageModel) TableName

func (this *MessageModel) TableName() string

type MessageTemplate

type MessageTemplate struct {
	Id         bson.ObjectId `json:"id" bson:"_id"`                                    // 目标Id
	Type       string        `json:"type" bson:"type"`                                 // 模版类型名
	Title      string        `json:"title" bson:"title"`                               // 模版标题
	Name       string        `json:"name" bson:"name"`                                 // 模版名称
	Template   bson.M        `json:"template" bson:"template"`                         // 模版信息
	TemplateId string        `json:"templateId,omitempty" bson:"templateId,omitempty"` // 第三方模版ID
	Platform   string        `json:"platform" bson:"platform"`                         // 平台
	Comment    string        `json:"comment,omitempty" bson:"comment,omitempty"`       // 备注
	State      int           `json:"state" bson:"state"`                               // 状态 0:不可用,1:可用
	UpdatedAt  time.Time     `json:"updatedAt" bson:"updatedAt"`                       // 更新时间
	CreatedAt  time.Time     `json:"createdAt" bson:"createdAt"`                       // 创建时间
}

func NewMessageTemplate

func NewMessageTemplate() *MessageTemplate

func (*MessageTemplate) Defaults

func (this *MessageTemplate) Defaults() *MessageTemplate

func (*MessageTemplate) Load

func (this *MessageTemplate) Load(data map[string]interface{}) *MessageTemplate

func (*MessageTemplate) Set

func (this *MessageTemplate) Set(key string, v interface{}) *MessageTemplate

type MessageTemplateModel

type MessageTemplateModel struct {
	BaseModel
}

func MessageTemplateModelOf

func MessageTemplateModelOf() *MessageTemplateModel

func (*MessageTemplateModel) Adds

func (this *MessageTemplateModel) Adds(data []map[string]interface{}) error

Adds 批量添加

func (*MessageTemplateModel) CreateIndex

func (this *MessageTemplateModel) CreateIndex(force ...bool)

CreateIndex 创建索引

func (*MessageTemplateModel) GetByUnique

func (this *MessageTemplateModel) GetByUnique(data map[string]interface{}) *MessageTemplate

GetByUnique 通过唯一查询条件获取

func (*MessageTemplateModel) TableName

func (this *MessageTemplateModel) TableName() string

type Meta

type Meta struct {
	HasMore bool `json:"more"`
	P       int  `json:"page"`
	C       int  `json:"count"`
	Size    int  `json:"size"`
	Total   int  `json:"total"`
}

func NewMeta

func NewMeta() *Meta

func (*Meta) Boot

func (this *Meta) Boot()

func (*Meta) Count

func (this *Meta) Count() int

func (*Meta) Init

func (this *Meta) Init() *Meta

func (*Meta) M

func (this *Meta) M() beego.M

func (*Meta) More

func (this *Meta) More() bool

func (*Meta) Page

func (this *Meta) Page() int

func (*Meta) Set

func (this *Meta) Set(key string, v interface{}) *Meta

func (*Meta) SetTotal

func (this *Meta) SetTotal(i int) ListsParams

func (*Meta) Skip

func (this *Meta) Skip() int

type Model

type Model interface {
	Error() error
	Self() Model
	Bind(v interface{}) Model
	GetConn(name ...string) *mgo.Session
	SetProfile(key string, v interface{}) Model
	Db(db ...string) *mgo.Database
	Document() *mgo.Collection
	Collection(conn ...string) *mgo.Collection
	GetProfile(key string, defaults ...interface{}) interface{}
}

type Null

type Null struct{}

DFA 过滤

type OrderByParam

type OrderByParam interface {
	Order(key, order string)
	ParseOrder(query *mgo.Query)
}

type Permission

type Permission struct {
	Name string `json:"name" bson:"name"`
	On   int    `json:"on" bson:"on"`
}

权限

type PopularizationChannels

type PopularizationChannels struct {
	Id                    bson.ObjectId `json:"id" bson:"_id"`                                      // 渠道ID
	Name                  string        `json:"name" bson:"name"`                                   // 渠道名
	UserId                string        `json:"userId,omitempty" bson:"userId,omitempty"`           // 用户ID
	Mobile                string        `json:"mobile,omitempty" bson:"mobile,omitempty"`           // 推广用户|渠道联系号码
	QrcodeUrl             string        `json:"qrcodeUrl" bson:"qrcodeUrl"`                         // 二维码链接
	Email                 string        `json:"email,omitempty" bson:"email,omitempty"`             // 渠道邮箱
	WeChat                string        `json:"wechat" bson:"wechat"`                               // 微信号
	Awards                []*AwardWay   `json:"awards" bson:"awards"`                               // 奖励方式
	InvitedRegisterNumber int64         `json:"invitedRegisterNumber" bson:"invitedRegisterNumber"` // 邀请注册人数
	ValidNumber           int64         `json:"validNumber" bson:"validNumber"`                     // 有效邀请注册人数
	Channel               string        `json:"channel" bson:"channel"`                             // 6-128 渠道码
	Extras                beego.M       `json:"extras" bson:"extras"`                               // 备用信息
	Status                int           `json:"status" bson:"status"`                               // 状态 : 0 ,1, 2
	ParentId              bson.ObjectId `json:"parentId,omitempty" bson:"parentId,omitempty"`       // 父级推广渠道
	Permissions           []*Permission `json:"permissions" bson:"permissions"`                     // 渠道权限
	Comment               string        `json:"comment" bson:"comment"`                             // 备注
	CreatedAt             time.Time     `json:"createdAt" bson:"createdAt"`                         // 创建时间
	UpdatedAt             time.Time     `json:"updatedAt" bson:"updatedAt"`                         // 更新时间
	// contains filtered or unexported fields
}

推广渠道记录

func NewPopularizationChannel

func NewPopularizationChannel() *PopularizationChannels

func (*PopularizationChannels) AddExcludeKeys

func (this *PopularizationChannels) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*PopularizationChannels) AddFilters

func (this *PopularizationChannels) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*PopularizationChannels) Excludes

func (this *PopularizationChannels) Excludes(key string) bool

Excludes 是否排除键

func (*PopularizationChannels) Foreach

func (this *PopularizationChannels) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*PopularizationChannels) GetFormatterTime

func (this *PopularizationChannels) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*PopularizationChannels) GetId

func (this *PopularizationChannels) GetId() bson.ObjectId

func (*PopularizationChannels) GetKeysFilter

func (this *PopularizationChannels) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*PopularizationChannels) GetNow

func (this *PopularizationChannels) GetNow() time.Time

func (*PopularizationChannels) GetTransformFilter

func (this *PopularizationChannels) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*PopularizationChannels) GetTransformFilterByKey

func (this *PopularizationChannels) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*PopularizationChannels) Incr

func (this *PopularizationChannels) Incr(key string, incr ...int) bool

func (*PopularizationChannels) Init

func (this *PopularizationChannels) Init()

func (*PopularizationChannels) InitDefault

func (this *PopularizationChannels) InitDefault()

InitDefault 初始化默认值

func (*PopularizationChannels) IsEmpty

func (this *PopularizationChannels) IsEmpty(v interface{}) bool

func (*PopularizationChannels) IsOk

func (this *PopularizationChannels) IsOk() bool

func (*PopularizationChannels) Keys

func (this *PopularizationChannels) Keys() []string

Keys 数据键集合

func (*PopularizationChannels) M

func (this *PopularizationChannels) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*PopularizationChannels) Map

func (this *PopularizationChannels) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*PopularizationChannels) Merger

func (this *PopularizationChannels) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*PopularizationChannels) RemoveExcludeKeys

func (this *PopularizationChannels) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*PopularizationChannels) Save

func (this *PopularizationChannels) Save() error

Save 保存

func (*PopularizationChannels) Set

func (this *PopularizationChannels) Set(key string, v interface{}) *PopularizationChannels

func (*PopularizationChannels) SetAttributes

func (this *PopularizationChannels) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*PopularizationChannels) SetBool

func (this *PopularizationChannels) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*PopularizationChannels) SetBsonMapper

func (this *PopularizationChannels) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*PopularizationChannels) SetMap

func (this *PopularizationChannels) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*PopularizationChannels) SetMapper

func (this *PopularizationChannels) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*PopularizationChannels) SetNumInt

func (this *PopularizationChannels) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*PopularizationChannels) SetNumIntN

func (this *PopularizationChannels) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*PopularizationChannels) SetObjectId

func (this *PopularizationChannels) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*PopularizationChannels) SetProvider

func (this *PopularizationChannels) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*PopularizationChannels) SetSameTypeValue

func (this *PopularizationChannels) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*PopularizationChannels) SetString

func (this *PopularizationChannels) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*PopularizationChannels) SetStringArr

func (this *PopularizationChannels) SetStringArr(arr *[]string, v interface{}) bool

func (*PopularizationChannels) SetTime

func (this *PopularizationChannels) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*PopularizationChannels) Values

func (this *PopularizationChannels) Values() []interface{}

Values 数据值集合

func (*PopularizationChannels) Verify

func (this *PopularizationChannels) Verify() error

type PopularizationChannelsModel

type PopularizationChannelsModel struct {
	BaseModel
}

func PopularizationChannelsModelOf

func PopularizationChannelsModelOf() *PopularizationChannelsModel

func (*PopularizationChannelsModel) CreateIndex

func (this *PopularizationChannelsModel) CreateIndex(force ...bool)

func (*PopularizationChannelsModel) GetByUnique

func (*PopularizationChannelsModel) TableName

func (this *PopularizationChannelsModel) TableName() string

type PostsModel

type PostsModel struct {
	BaseModel
}

func PostsModelOf

func PostsModelOf() *PostsModel

func (*PostsModel) AutoScore

func (this *PostsModel) AutoScore(id string) bool

AutoScore 自动算分

func (*PostsModel) CreateIndex

func (this *PostsModel) CreateIndex(force ...bool)

func (*PostsModel) Incr

func (this *PostsModel) Incr(id string, typ string, num ...int) error

Incr 增加

func (*PostsModel) TableName

func (this *PostsModel) TableName() string

type RecommendModel

type RecommendModel struct {
	BaseModel
}

func RecommendModelOf

func RecommendModelOf() *RecommendModel

type RequestLog

type RequestLog struct {
	HeaderSchema
	Id        bson.ObjectId `json:"id" bson:"_id"`                            // ID
	UserId    string        `json:"userId,omitempty" bson:"userId,omitempty"` // 请求用户ID
	Body      string        `json:"body" bson:"body"`                         // 请求体
	Data      beego.M       `json:"data,omitempty" bson:"data,omitempty"`     // 格式化转换过的数据
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"`               // 创建时间
}

RequestLog 请求日志

func NewRequestLog

func NewRequestLog() *RequestLog

func (*RequestLog) AddExcludeKeys

func (this *RequestLog) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*RequestLog) AddFilters

func (this *RequestLog) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*RequestLog) Excludes

func (this *RequestLog) Excludes(key string) bool

Excludes 是否排除键

func (*RequestLog) Foreach

func (this *RequestLog) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*RequestLog) GetFormatterTime

func (this *RequestLog) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*RequestLog) GetId

func (this *RequestLog) GetId() bson.ObjectId

func (*RequestLog) GetKeysFilter

func (this *RequestLog) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*RequestLog) GetNow

func (this *RequestLog) GetNow() time.Time

func (*RequestLog) GetTransformFilter

func (this *RequestLog) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*RequestLog) GetTransformFilterByKey

func (this *RequestLog) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*RequestLog) Init

func (this *RequestLog) Init()

func (*RequestLog) InitDefault

func (this *RequestLog) InitDefault()

InitDefault 初始化默认值

func (*RequestLog) IsEmpty

func (this *RequestLog) IsEmpty(v interface{}) bool

func (*RequestLog) Keys

func (this *RequestLog) Keys() []string

Keys 数据键集合

func (*RequestLog) M

func (this *RequestLog) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*RequestLog) Map

func (this *RequestLog) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*RequestLog) Merger

func (this *RequestLog) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*RequestLog) RemoveExcludeKeys

func (this *RequestLog) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*RequestLog) Save

func (this *RequestLog) Save() error

Save 保存

func (*RequestLog) Set

func (this *RequestLog) Set(key string, v interface{}) *RequestLog

func (*RequestLog) SetAttributes

func (this *RequestLog) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*RequestLog) SetBool

func (this *RequestLog) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*RequestLog) SetBsonMapper

func (this *RequestLog) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*RequestLog) SetMap

func (this *RequestLog) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*RequestLog) SetMapper

func (this *RequestLog) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*RequestLog) SetNumInt

func (this *RequestLog) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*RequestLog) SetNumIntN

func (this *RequestLog) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*RequestLog) SetObjectId

func (this *RequestLog) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*RequestLog) SetProvider

func (this *RequestLog) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*RequestLog) SetSameTypeValue

func (this *RequestLog) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*RequestLog) SetString

func (this *RequestLog) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*RequestLog) SetStringArr

func (this *RequestLog) SetStringArr(arr *[]string, v interface{}) bool

func (*RequestLog) SetTime

func (this *RequestLog) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*RequestLog) Values

func (this *RequestLog) Values() []interface{}

Values 数据值集合

type RequestLogModel

type RequestLogModel struct {
	BaseModel
}

RequestLogModel 请求日志模型

func RequestLogModelOf

func RequestLogModelOf() *RequestLogModel

func (*RequestLogModel) CreateIndex

func (this *RequestLogModel) CreateIndex(force ...bool)

func (*RequestLogModel) TableName

func (this *RequestLogModel) TableName() string

TableName 表名

type SensitiveWords

type SensitiveWords struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`              // ID
	App       string        `json:"app" bson:"app"`             // 规则名
	Type      string        `json:"type" bson:"type"`           // 分类名
	Word      string        `json:"word" bson:"word"`           // 词
	Hash      string        `json:"hash" bson:"hash"`           // 唯一
	Status    int           `json:"status" bson:"status"`       // 状态
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"` // 创建时间
	UpdatedAt time.Time     `json:"updatedAt" bson:"updatedAt"` // 更新时间
	// contains filtered or unexported fields
}

SensitiveWords 敏感词记录

func NewSensitiveWords

func NewSensitiveWords() *SensitiveWords

func (*SensitiveWords) AddExcludeKeys

func (this *SensitiveWords) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*SensitiveWords) AddFilters

func (this *SensitiveWords) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*SensitiveWords) Excludes

func (this *SensitiveWords) Excludes(key string) bool

Excludes 是否排除键

func (*SensitiveWords) Foreach

func (this *SensitiveWords) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*SensitiveWords) GetFormatterTime

func (this *SensitiveWords) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*SensitiveWords) GetId

func (this *SensitiveWords) GetId() bson.ObjectId

func (*SensitiveWords) GetKeysFilter

func (this *SensitiveWords) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*SensitiveWords) GetNow

func (this *SensitiveWords) GetNow() time.Time

func (*SensitiveWords) GetTransformFilter

func (this *SensitiveWords) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*SensitiveWords) GetTransformFilterByKey

func (this *SensitiveWords) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*SensitiveWords) Init

func (this *SensitiveWords) Init()

func (*SensitiveWords) InitDefault

func (this *SensitiveWords) InitDefault()

InitDefault 初始化默认值

func (*SensitiveWords) IsEmpty

func (this *SensitiveWords) IsEmpty(v interface{}) bool

func (*SensitiveWords) Keys

func (this *SensitiveWords) Keys() []string

Keys 数据键集合

func (*SensitiveWords) M

func (this *SensitiveWords) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*SensitiveWords) Map

func (this *SensitiveWords) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*SensitiveWords) Merger

func (this *SensitiveWords) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*SensitiveWords) RemoveExcludeKeys

func (this *SensitiveWords) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*SensitiveWords) Save

func (this *SensitiveWords) Save() error

Save 保存

func (*SensitiveWords) Set

func (this *SensitiveWords) Set(key string, v interface{}) *SensitiveWords

func (*SensitiveWords) SetAttributes

func (this *SensitiveWords) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*SensitiveWords) SetBool

func (this *SensitiveWords) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*SensitiveWords) SetBsonMapper

func (this *SensitiveWords) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*SensitiveWords) SetMap

func (this *SensitiveWords) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*SensitiveWords) SetMapper

func (this *SensitiveWords) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*SensitiveWords) SetNumInt

func (this *SensitiveWords) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*SensitiveWords) SetNumIntN

func (this *SensitiveWords) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*SensitiveWords) SetObjectId

func (this *SensitiveWords) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*SensitiveWords) SetProvider

func (this *SensitiveWords) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*SensitiveWords) SetSameTypeValue

func (this *SensitiveWords) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*SensitiveWords) SetString

func (this *SensitiveWords) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*SensitiveWords) SetStringArr

func (this *SensitiveWords) SetStringArr(arr *[]string, v interface{}) bool

func (*SensitiveWords) SetTime

func (this *SensitiveWords) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*SensitiveWords) Values

func (this *SensitiveWords) Values() []interface{}

Values 数据值集合

type SensitiveWordsModel

type SensitiveWordsModel struct {
	BaseModel
}

func SensitiveWordsModelOf

func SensitiveWordsModelOf() *SensitiveWordsModel

func (*SensitiveWordsModel) Adds

func (this *SensitiveWordsModel) Adds(words []string, ty string, app ...string) error

Adds 批量添加

func (*SensitiveWordsModel) CreateIndex

func (this *SensitiveWordsModel) CreateIndex(force ...bool)

func (*SensitiveWordsModel) Filters

func (this *SensitiveWordsModel) Filters(words string) string

func (*SensitiveWordsModel) Foreach

func (this *SensitiveWordsModel) Foreach(each func(it *SensitiveWords) bool, limit ...int)

func (*SensitiveWordsModel) GetByUnique

func (this *SensitiveWordsModel) GetByUnique(m beego.M) *SensitiveWords

func (*SensitiveWordsModel) GetTotal

func (this *SensitiveWordsModel) GetTotal() int

func (*SensitiveWordsModel) TableName

func (this *SensitiveWordsModel) TableName() string

type SmsLog

type SmsLog struct {
	Id              bson.ObjectId `json:"id" bson:"id"`                           // 消息ID
	Provider        string        `json:"provider" bson:"provider"`               // 服务商
	Mobile          string        `json:"mobile" bson:"mobile"`                   // 手机号
	Content         string        `json:"content" bson:"content"`                 // 消息内容
	Result          string        `json:"result" bson:"result"`                   // 请求结果
	State           int           `json:"state" bson:"state"`                     // 消息状态
	Type            string        `json:"type" bson:"type"`                       // 消息类型
	Extras          string        `json:"extras" bson:"extras"`                   // 扩展信息
	Error           string        `json:"error,omitempty" bson:"error,omitempty"` // 异常
	ExpireTimeStamp int64         `json:"expireTimeStamp" bson:"expireTimeStamp"` // 过期时间戳
	CreatedAt       time.Time     `json:"createdAt" bson:"createdAt"`             // 创建时间
}

SmsLog 短信日志记录

func (*SmsLog) Defaults

func (this *SmsLog) Defaults() *SmsLog

func (*SmsLog) Load

func (this *SmsLog) Load(data map[string]interface{}) *SmsLog

func (*SmsLog) Set

func (this *SmsLog) Set(key string, v interface{}) *SmsLog

type SmsLogModel

type SmsLogModel struct {
	BaseModel
}

func SmsLogModelOf

func SmsLogModelOf() *SmsLogModel

func (*SmsLogModel) CreateIndex

func (this *SmsLogModel) CreateIndex(force ...bool)

func (*SmsLogModel) TableName

func (this *SmsLogModel) TableName() string

type SmsTemplate

type SmsTemplate struct {
	Content   string `json:"content"`
	Variables []*struct {
		Key   string `json:"key"`
		Value string `json:"value"`
		Desc  string `json:"desc"`
	} `json:"variables"`
}

SmsTemplate 短信消息模版

func NewSmsTemplate

func NewSmsTemplate() *SmsTemplate

func (*SmsTemplate) Load

func (this *SmsTemplate) Load(data map[string]interface{}) *SmsTemplate

func (*SmsTemplate) M

func (this *SmsTemplate) M() beego.M

type StrArray

type StrArray []string

StrArray 字符串数组

func (StrArray) Foreach

func (this StrArray) Foreach(each func(i int, value string) bool)

func (StrArray) Included

func (this StrArray) Included(v string, fold ...bool) bool

func (StrArray) Search

func (this StrArray) Search(v string, fold ...bool) int

type StrArrayEntry

type StrArrayEntry struct {
	Key   string
	Items []string
}

func NewStrArrayEntry

func NewStrArrayEntry() *StrArrayEntry

func (*StrArrayEntry) Append

func (this *StrArrayEntry) Append(value string) *StrArrayEntry

func (*StrArrayEntry) Cap

func (this *StrArrayEntry) Cap() int

func (*StrArrayEntry) Copy

func (this *StrArrayEntry) Copy() *StrArrayEntry

func (*StrArrayEntry) Count

func (this *StrArrayEntry) Count() int

func (*StrArrayEntry) Foreach

func (this *StrArrayEntry) Foreach(each func(i int, value string) bool)

func (*StrArrayEntry) GetKey

func (this *StrArrayEntry) GetKey() string

func (*StrArrayEntry) Included

func (this *StrArrayEntry) Included(v string, fold ...bool) bool

func (*StrArrayEntry) Init

func (this *StrArrayEntry) Init()

func (*StrArrayEntry) Joins

func (this *StrArrayEntry) Joins(joins ...[]string) *StrArrayEntry

func (*StrArrayEntry) Len

func (this *StrArrayEntry) Len() int

func (*StrArrayEntry) Pop

func (this *StrArrayEntry) Pop() string

func (*StrArrayEntry) Push

func (this *StrArrayEntry) Push(i int, value string) *StrArrayEntry

func (*StrArrayEntry) Search

func (this *StrArrayEntry) Search(v string, fold ...bool) int

func (*StrArrayEntry) SetKey

func (this *StrArrayEntry) SetKey(key string) *StrArrayEntry

func (*StrArrayEntry) ToMapper

func (this *StrArrayEntry) ToMapper() beego.M

func (*StrArrayEntry) Values

func (this *StrArrayEntry) Values() []string

type TableNameAble

type TableNameAble interface {
	TableName() string
}

type Tag

type Tag struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`              // ID
	Name      string        `json:"name" bson:"name"`           // 标签名
	Alias     string        `json:"alias" bson:"alias"`         // 别名
	Group     string        `json:"group" bson:"group"`         // 分组名
	Comment   string        `json:"comment" bson:"comment"`     // 备注
	State     int           `json:"state" bson:"state"`         // 状态 0:初始状态,1:正常,2:删除
	Sort      int           `json:"sort" bson:"sort"`           // 排序 越大越靠前
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"` // 创建时间
	// contains filtered or unexported fields
}

Tag 标签记录

func NewTag

func NewTag() *Tag

func (*Tag) AddExcludeKeys

func (this *Tag) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*Tag) AddFilters

func (this *Tag) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*Tag) Excludes

func (this *Tag) Excludes(key string) bool

Excludes 是否排除键

func (*Tag) Foreach

func (this *Tag) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*Tag) GetFormatterTime

func (this *Tag) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*Tag) GetId

func (this *Tag) GetId() bson.ObjectId

func (*Tag) GetKeysFilter

func (this *Tag) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*Tag) GetNow

func (this *Tag) GetNow() time.Time

func (*Tag) GetTransformFilter

func (this *Tag) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*Tag) GetTransformFilterByKey

func (this *Tag) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*Tag) Init

func (this *Tag) Init()

func (*Tag) InitDefault

func (this *Tag) InitDefault()

InitDefault 初始化默认值

func (*Tag) IsEmpty

func (this *Tag) IsEmpty(v interface{}) bool

func (*Tag) Keys

func (this *Tag) Keys() []string

Keys 数据键集合

func (*Tag) M

func (this *Tag) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*Tag) Map

func (this *Tag) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*Tag) Merger

func (this *Tag) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*Tag) RemoveExcludeKeys

func (this *Tag) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*Tag) Save

func (this *Tag) Save() error

Save 保存

func (*Tag) Set

func (this *Tag) Set(key string, v interface{}) *Tag

Set setter

func (*Tag) SetAttributes

func (this *Tag) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*Tag) SetBool

func (this *Tag) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*Tag) SetBsonMapper

func (this *Tag) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*Tag) SetMap

func (this *Tag) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*Tag) SetMapper

func (this *Tag) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*Tag) SetNumInt

func (this *Tag) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*Tag) SetNumIntN

func (this *Tag) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*Tag) SetObjectId

func (this *Tag) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*Tag) SetProvider

func (this *Tag) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*Tag) SetSameTypeValue

func (this *Tag) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*Tag) SetString

func (this *Tag) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*Tag) SetStringArr

func (this *Tag) SetStringArr(arr *[]string, v interface{}) bool

func (*Tag) SetTime

func (this *Tag) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*Tag) Values

func (this *Tag) Values() []interface{}

Values 数据值集合

type TagModel

type TagModel struct {
	BaseModel
}

func TagsModelOf

func TagsModelOf() *TagModel

func (*TagModel) Adds

func (this *TagModel) Adds(items []map[string]interface{}) error

批量添加更新

func (*TagModel) CreateIndex

func (this *TagModel) CreateIndex(force ...bool)

func (*TagModel) GetByUnique

func (this *TagModel) GetByUnique(data map[string]interface{}) *Tag

GetByUnique 通过唯一索引查询

func (*TagModel) GetTags

func (this *TagModel) GetTags(group string) []Tag

GetTags 获取对应所有标签

func (*TagModel) GetTagsByGroup

func (this *TagModel) GetTagsByGroup(group ...string) []string

func (*TagModel) TableName

func (this *TagModel) TableName() string

type ThumbsUp

type ThumbsUp struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`
	Status    int           `json:"status" bson:"status"`
	Type      string        `json:"type" bson:"type"` // 类型
	UserId    string        `json:"userId" bson:"userId"`
	TypeId    string        `json:"typeId" bson:"typeId"`
	Count     int           `json:"count" bson:"count"`
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"`
	UpdatedAt time.Time     `json:"updatedAt" bson:"updatedAt"`
}

ThumbsUp 点赞数据

func (*ThumbsUp) Defaults

func (this *ThumbsUp) Defaults() *ThumbsUp

func (*ThumbsUp) Load

func (this *ThumbsUp) Load(data map[string]interface{}) *ThumbsUp

func (*ThumbsUp) M

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

func (*ThumbsUp) Save

func (this *ThumbsUp) Save() error

func (*ThumbsUp) Set

func (this *ThumbsUp) Set(key string, v interface{}) *ThumbsUp

type ThumbsUpModel

type ThumbsUpModel struct {
	BaseModel
}

func ThumbsUpModelOf

func ThumbsUpModelOf() *ThumbsUpModel

func (*ThumbsUpModel) CreateIndex

func (this *ThumbsUpModel) CreateIndex(force ...bool)

func (*ThumbsUpModel) TableName

func (this *ThumbsUpModel) TableName() string

type TravelNotes

type TravelNotes struct {
	Id          bson.ObjectId `json:"id" bson:"_id"`
	Title       string        `json:"title" bson:"title"`                       // 标题
	Content     string        `json:"content" bson:"content"`                   // 内容
	Type        int           `json:"type" bson:"type"`                         // 类型
	Images      []string      `json:"images,omitempty" bson:"images,omitempty"` // 图片ID
	UserId      string        `json:"userId" bson:"userId"`                     // 用户ID
	Videos      []string      `json:"videos,omitempty" bson:"videos,omitempty"` // 视频ID
	Group       string        `json:"group" bson:"group"`                       // 分组类型名
	Tags        []string      `json:"tags" bson:"tags"`                         // 标签ID
	Status      int           `json:"status" bson:"status"`                     // 审核状态
	Address     string        `json:"address" bson:"address"`                   // 地址
	LinkUrl     string        `json:"link_url" bson:"link_url"`                 // 外链
	Privacy     int           `json:"privacy" bson:"privacy"`                   // 是否公开
	ThumbsUpNum int64         `json:"thumbsUpNum" bson:"thumbsUpNum"`           // 点赞数
	CommentNum  int64         `json:"commentNum" bson:"commentNum"`             // 评论数
	Score       int64         `json:"score" bson:"score"`                       // 作品评分
	UpdatedAt   time.Time     `json:"updatedAt" bson:"updatedAt"`               // 更新时间
	CreatedAt   time.Time     `json:"createdAt" bson:"createdAt"`               // 创建时间
	DeletedAt   int64         `json:"deletedAt" bson:"deletedAt"`               // 删除时间
}

TravelNotes 游记|攻略

func NewTravelNotes

func NewTravelNotes() *TravelNotes

func (*TravelNotes) CanHasVideo

func (this *TravelNotes) CanHasVideo() bool

func (*TravelNotes) Defaults

func (this *TravelNotes) Defaults() *TravelNotes

func (*TravelNotes) GetImages

func (this *TravelNotes) GetImages() []*Image

func (*TravelNotes) GetPrivacy

func (this *TravelNotes) GetPrivacy() string

func (*TravelNotes) GetState

func (this *TravelNotes) GetState() string

func (*TravelNotes) GetTagsText

func (this *TravelNotes) GetTagsText() []string

GetTagsText 获取标签描述

func (*TravelNotes) GetType

func (this *TravelNotes) GetType() string

func (*TravelNotes) GetTypeCode

func (this *TravelNotes) GetTypeCode() string

func (*TravelNotes) GetVideos

func (this *TravelNotes) GetVideos() []*Video

func (*TravelNotes) IsAutoAuditType

func (this *TravelNotes) IsAutoAuditType() bool

func (*TravelNotes) IsEmpty

func (this *TravelNotes) IsEmpty() bool

func (*TravelNotes) Load

func (this *TravelNotes) Load(data bson.M) *TravelNotes

func (*TravelNotes) M

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

func (*TravelNotes) Save

func (this *TravelNotes) Save() error

func (*TravelNotes) Set

func (this *TravelNotes) Set(key string, v interface{}) *TravelNotes

type TxnContext

type TxnContext struct {
	TxnOps    []txn.Op
	TxnRunner *txn.Runner
	TxnId     bson.ObjectId
	TxnResult interface{}
}

TxnContext 事务上下文

type UrlAccessService

type UrlAccessService interface {
	GetTicketUrlByAttach(*Attachment) string
}

type User

type User struct {
	Id                 bson.ObjectId `json:"id" bson:"_id"`                                // 唯一ID
	UserNumId          int64         `json:"userNumId" bson:"userNumId"`                   // 用户注册序号
	Role               int           `json:"role" bson:"role"`                             // 用户类型
	UserName           string        `json:"username" bson:"username"`                     // 用户名唯一
	Intro              string        `json:"intro" bson:"intro"`                           // 个人简介
	BackgroundCoverId  string        `json:"backgroundCoverId" bson:"backgroundCoverId"`   // 个人也背景
	AvatarId           string        `json:"avatarId,omitempty" bson:"avatarId,omitempty"` // 头像ID
	NickName           string        `json:"nickname,omitempty" bson:"nickname,omitempty"` // 昵称
	PasswordHash       string        `json:"passwordHash" bson:"passwordHash"`             // 密码密码
	Mobile             string        `json:"mobile,omitempty" bson:"mobile,omitempty"`     // 手机号
	Email              string        `json:"email,omitempty" bson:"email,omitempty"`       // 邮箱
	ResetPasswordTimes int           `json:"resetPasswordTimes" bson:"resetPasswordTimes"` // 重置密码次数
	RegisterWay        string        `json:"registerWay" bson:"registerWay"`               // 注册方式
	AccessTokens       []string      `json:"accessTokens" bson:"accessTokens"`             // 授权临牌集合
	LastLoginAt        int64         `json:"lastLoginAt" bson:"lastLoginAt"`               // 最近一次登陆时间
	LastLoginLocation  string        `json:"lastLoginLocation" bson:"lastLoginLocation"`   // 最近一次登陆定位
	Status             int           `json:"status" bson:"status"`                         // 用户状态 -1:拉黑,1:正常,2:禁用
	Gender             int           `json:"gender" bson:"gender"`                         // 用户性别 0:保密 1:男 2:女 3:😯
	Birthday           int64         `json:"birthday,omitempty" bson:"birthday,omitempty"` // 用户生日
	Address            string        `json:"address" bson:"address"`                       // 用户地址
	ThumbsUpTotal      int64         `json:"thumbsUpNum" bson:"thumbsUpNum"`               // 点赞总数
	InviteCode         string        `json:"inviteCode" bson:"inviteCode"`                 // 邀请码 6-64
	CreatedAt          time.Time     `json:"createdAt" bson:"createdAt"`                   // 创建时间 注册时间
	UpdatedAt          time.Time     `json:"updatedAt" bson:"updatedAt"`                   // 更新时间
	DeletedAt          int64         `json:"deletedAt" bson:"deletedAt"`                   // 删除时间戳
	// contains filtered or unexported fields
}

func NewUser

func NewUser() *User

func (*User) AddExcludeKeys

func (this *User) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*User) AddFilters

func (this *User) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*User) Defaults

func (this *User) Defaults() *User

func (*User) Excludes

func (this *User) Excludes(key string) bool

Excludes 是否排除键

func (*User) Foreach

func (this *User) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*User) GetAddress

func (this *User) GetAddress(typ ...int) string

func (*User) GetFormatterTime

func (this *User) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*User) GetId

func (this *User) GetId() bson.ObjectId

func (*User) GetInviteCode

func (this *User) GetInviteCode(refresh ...bool) string

func (*User) GetKeysFilter

func (this *User) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*User) GetMobile

func (this *User) GetMobile() string

func (*User) GetNickName

func (this *User) GetNickName() string

func (*User) GetNow

func (this *User) GetNow() time.Time

func (*User) GetPasswordHash

func (this *User) GetPasswordHash() string

func (*User) GetRoleDesc

func (this *User) GetRoleDesc(role int) string

获取角色描述

func (*User) GetTransformFilter

func (this *User) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*User) GetTransformFilterByKey

func (this *User) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*User) GetUserNumId

func (this *User) GetUserNumId() int64

func (*User) InitDefault

func (this *User) InitDefault()

InitDefault 初始化默认值

func (*User) IsBlackList

func (this *User) IsBlackList() bool

func (*User) IsEmpty

func (this *User) IsEmpty(v interface{}) bool

func (*User) IsForbid

func (this *User) IsForbid() bool

func (*User) IsRootRole

func (this *User) IsRootRole() bool

func (*User) Keys

func (this *User) Keys() []string

Keys 数据键集合

func (*User) Load

func (this *User) Load(data map[string]interface{}) *User

func (*User) M

func (this *User) M(filter ...func(m beego.M) beego.M) beego.M

func (*User) Map

func (this *User) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*User) Merger

func (this *User) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*User) RemoveExcludeKeys

func (this *User) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*User) Save

func (this *User) Save() error

func (*User) Set

func (this *User) Set(key string, v interface{}) *User

func (*User) SetAttributes

func (this *User) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*User) SetBool

func (this *User) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*User) SetBsonMapper

func (this *User) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*User) SetMap

func (this *User) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*User) SetMapper

func (this *User) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*User) SetNumInt

func (this *User) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*User) SetNumIntN

func (this *User) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*User) SetObjectId

func (this *User) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*User) SetProvider

func (this *User) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*User) SetSameTypeValue

func (this *User) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*User) SetString

func (this *User) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*User) SetStringArr

func (this *User) SetStringArr(arr *[]string, v interface{}) bool

func (*User) SetTime

func (this *User) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*User) Values

func (this *User) Values() []interface{}

Values 数据值集合

type UserAddress

type UserAddress struct {
	Id         bson.ObjectId `json:"id" bson:"_id"`                                    // id
	UserId     bson.ObjectId `json:"userId" bson:"userId"`                             // 地址所属用户
	Type       int           `json:"type" bson:"type"`                                 // 地址类型 1: 注册地址
	Version    int           `json:"version" json:"version"`                           // 地址更新处理
	Hash       string        `json:"hash" bson:"hash"`                                 // 用户地址唯一值
	Sort       int           `json:"sort" json:"sort"`                                 // 排序
	Text       string        `json:"text,omitempty" json:"text,omitempty"`             // 字符串文本地址
	State      int           `json:"state" bson:"state"`                               // 状态 -1:已过期,0:不可用, 1: 可用|正常
	Country    string        `json:"country,omitempty" bson:"country,omitempty"`       // 国家
	CountryId  int           `json:"countryId" bson:"countryId"`                       // 国家编码
	City       string        `json:"city,omitempty" bson:"city,omitempty"`             // 城市
	CityId     string        `json:"cityId,omitempty" bson:"cityId,omitempty"`         // 城市编码
	Province   string        `json:"province,omitempty" bson:"province,omitempty"`     // 省份
	ProvinceId string        `json:"provinceId,omitempty" bson:"provinceId,omitempty"` // 省份编码
	District   string        `json:"district,omitempty" bson:"district,omitempty"`     // 行政区
	DistrictId string        `json:"districtId,omitempty" json:"districtId,omitempty"` // 行政区编码
	Street     string        `json:"street,omitempty" json:"street,omitempty"`         // 街区
	StreetId   string        `json:"streetId,omitempty" json:"streetId,omitempty"`     // 街区编码
	Floor      string        `json:"floor,omitempty" bson:"floor,omitempty"`           // 楼层  eg : 天辉大厦18楼
	Doorplate  string        `json:"doorplate,omitempty" bson:"doorplate,omitempty"`   // 门牌号
	Longitude  float64       `json:"longitude,omitempty" bson:"longitude,omitempty"`   // 经度 [东-西]
	Latitude   float64       `json:"latitude,omitempty" bson:"latitude,omitempty"`     // 纬度 [南-北]
	CreateTime int64         `json:"createTime" bson:"createTime"`                     // 创建日期
	// contains filtered or unexported fields
}

地址模型

func NewUserAddress

func NewUserAddress() *UserAddress

func (*UserAddress) AddExcludeKeys

func (this *UserAddress) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*UserAddress) AddFilters

func (this *UserAddress) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*UserAddress) Excludes

func (this *UserAddress) Excludes(key string) bool

Excludes 是否排除键

func (*UserAddress) Foreach

func (this *UserAddress) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*UserAddress) GetFormatterTime

func (this *UserAddress) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*UserAddress) GetId

func (this *UserAddress) GetId() bson.ObjectId

func (*UserAddress) GetKeysFilter

func (this *UserAddress) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*UserAddress) GetNow

func (this *UserAddress) GetNow() time.Time

func (*UserAddress) GetTransformFilter

func (this *UserAddress) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*UserAddress) GetTransformFilterByKey

func (this *UserAddress) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*UserAddress) IncrVersion

func (this *UserAddress) IncrVersion() *UserAddress

更新地址版本号

func (*UserAddress) Init

func (this *UserAddress) Init()

func (*UserAddress) InitDefault

func (this *UserAddress) InitDefault()

InitDefault 初始化默认值

func (*UserAddress) IsEmpty

func (this *UserAddress) IsEmpty(v interface{}) bool

func (*UserAddress) Keys

func (this *UserAddress) Keys() []string

Keys 数据键集合

func (*UserAddress) Load

func (this *UserAddress) Load(data map[string]interface{}) *UserAddress

Load 数据加载

func (*UserAddress) Location

func (this *UserAddress) Location() *Location

func (*UserAddress) M

func (this *UserAddress) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*UserAddress) Map

func (this *UserAddress) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*UserAddress) Merger

func (this *UserAddress) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*UserAddress) Parse

func (this *UserAddress) Parse(v interface{}) bool

func (*UserAddress) RemoveExcludeKeys

func (this *UserAddress) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*UserAddress) Save

func (this *UserAddress) Save() error

Save 保存

func (*UserAddress) Set

func (this *UserAddress) Set(key string, v interface{}) *UserAddress

Set 设置器

func (*UserAddress) SetAttributes

func (this *UserAddress) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*UserAddress) SetBool

func (this *UserAddress) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*UserAddress) SetBsonMapper

func (this *UserAddress) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*UserAddress) SetMap

func (this *UserAddress) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*UserAddress) SetMapper

func (this *UserAddress) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*UserAddress) SetNumInt

func (this *UserAddress) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*UserAddress) SetNumIntN

func (this *UserAddress) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*UserAddress) SetObjectId

func (this *UserAddress) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*UserAddress) SetProvider

func (this *UserAddress) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*UserAddress) SetSameTypeValue

func (this *UserAddress) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*UserAddress) SetString

func (this *UserAddress) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*UserAddress) SetStringArr

func (this *UserAddress) SetStringArr(arr *[]string, v interface{}) bool

func (*UserAddress) SetTime

func (this *UserAddress) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*UserAddress) String

func (this *UserAddress) String() string

func (*UserAddress) Update

func (this *UserAddress) Update() error

更新数据数据逻辑

func (*UserAddress) Values

func (this *UserAddress) Values() []interface{}

Values 数据值集合

type UserAddressModel

type UserAddressModel struct {
	BaseModel
}

func UserAddressModelOf

func UserAddressModelOf() *UserAddressModel

func (*UserAddressModel) CreateIndex

func (this *UserAddressModel) CreateIndex(force ...bool)

func (*UserAddressModel) GetAddressByUserId

func (this *UserAddressModel) GetAddressByUserId(userId bson.ObjectId, typ ...int) *UserAddress

func (*UserAddressModel) GetUserAddress

func (this *UserAddressModel) GetUserAddress(userId bson.ObjectId, typ int) string

func (*UserAddressModel) GetUserAddressList

func (this *UserAddressModel) GetUserAddressList(userId bson.ObjectId, typ int) []string

func (*UserAddressModel) TableName

func (this *UserAddressModel) TableName() string

type UserFocusModel

type UserFocusModel struct {
	BaseModel
}

用户关注数据模型

func UserFocusModelOf

func UserFocusModelOf() *UserFocusModel

func (*UserFocusModel) Count

func (this *UserFocusModel) Count(m beego.M) int64

统计数量

func (*UserFocusModel) CreateIndex

func (this *UserFocusModel) CreateIndex(force ...bool)

创建索引

func (*UserFocusModel) GetByUnique

func (this *UserFocusModel) GetByUnique(m beego.M) *UserFollow

func (*UserFocusModel) GetFocusCount

func (this *UserFocusModel) GetFocusCount(userId string) int

获取用户被关注数

func (*UserFocusModel) GetFocusTwo

func (this *UserFocusModel) GetFocusTwo(userId, userId2 string) bool

是否用户互关注

func (*UserFocusModel) GetUserFocusCount

func (this *UserFocusModel) GetUserFocusCount(userId string) int

获取用户关注数

func (*UserFocusModel) GetUserFocusLists

func (this *UserFocusModel) GetUserFocusLists(userId string, params ...ListsParams) ([]*UserFollow, ListsParams)

获取 用户关注列表

func (*UserFocusModel) TableName

func (this *UserFocusModel) TableName() string

type UserFollow

type UserFollow struct {
	Id          bson.ObjectId `json:"id" bson:"_id"`                                // ID
	Status      int           `json:"status" bson:"status"`                         // 状态
	UserId      bson.ObjectId `json:"userId" bson:"userId"`                         // 用户ID
	TargetId    bson.ObjectId `json:"targetId,omitempty" bson:"targetId,omitempty"` // 引发关注的作品ID
	FocusUserId bson.ObjectId `json:"focusUserId" bson:"focusUserId"`               // 被关注的用户ID
	Extras      beego.M       `json:"extras" bson:"extras"`                         // 扩展数据
	CreatedAt   time.Time     `json:"createdAt" bson:"createdAt"`                   // 创建时间
	UpdatedAt   time.Time     `json:"updatedAt" bson:"updatedAt"`                   // 更新时间
	// contains filtered or unexported fields
}

用户关注

func NewUserFocus

func NewUserFocus() *UserFollow

func (*UserFollow) AddExcludeKeys

func (this *UserFollow) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*UserFollow) AddFilters

func (this *UserFollow) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*UserFollow) Excludes

func (this *UserFollow) Excludes(key string) bool

Excludes 是否排除键

func (*UserFollow) Foreach

func (this *UserFollow) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*UserFollow) GetFormatterTime

func (this *UserFollow) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*UserFollow) GetId

func (this *UserFollow) GetId() bson.ObjectId

func (*UserFollow) GetKeysFilter

func (this *UserFollow) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*UserFollow) GetNow

func (this *UserFollow) GetNow() time.Time

func (*UserFollow) GetTransformFilter

func (this *UserFollow) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*UserFollow) GetTransformFilterByKey

func (this *UserFollow) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*UserFollow) Init

func (this *UserFollow) Init()

func (*UserFollow) InitDefault

func (this *UserFollow) InitDefault()

InitDefault 初始化默认值

func (*UserFollow) IsEmpty

func (this *UserFollow) IsEmpty(v interface{}) bool

func (*UserFollow) Keys

func (this *UserFollow) Keys() []string

Keys 数据键集合

func (*UserFollow) M

func (this *UserFollow) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*UserFollow) Map

func (this *UserFollow) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*UserFollow) Merger

func (this *UserFollow) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*UserFollow) RemoveExcludeKeys

func (this *UserFollow) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*UserFollow) Save

func (this *UserFollow) Save() error

Save 保存

func (*UserFollow) Set

func (this *UserFollow) Set(key string, v interface{}) *UserFollow

func (*UserFollow) SetAttributes

func (this *UserFollow) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*UserFollow) SetBool

func (this *UserFollow) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*UserFollow) SetBsonMapper

func (this *UserFollow) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*UserFollow) SetMap

func (this *UserFollow) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*UserFollow) SetMapper

func (this *UserFollow) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*UserFollow) SetNumInt

func (this *UserFollow) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*UserFollow) SetNumIntN

func (this *UserFollow) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*UserFollow) SetObjectId

func (this *UserFollow) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*UserFollow) SetProvider

func (this *UserFollow) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*UserFollow) SetSameTypeValue

func (this *UserFollow) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*UserFollow) SetString

func (this *UserFollow) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*UserFollow) SetStringArr

func (this *UserFollow) SetStringArr(arr *[]string, v interface{}) bool

func (*UserFollow) SetTime

func (this *UserFollow) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*UserFollow) Values

func (this *UserFollow) Values() []interface{}

Values 数据值集合

type UserLoginLog

type UserLoginLog struct {
	Id            bson.ObjectId `json:"id" bson:"_id"`
	Uid           string        `json:"userId" bson:"userId"`
	LoginTime     time.Time     `json:"loginTime" bson:"loginTime"`
	Device        string        `json:"device" bson:"device"`
	Client        string        `json:"client" bson:"client"`
	LoginLocation string        `json:"loginLocation" bson:"loginLocation"`
	CreatedAt     time.Time     `json:"createdAt" bson:"createdAt"`
}

type UserLoginLogModel

type UserLoginLogModel struct {
	BaseModel
}

func UserLoginLogModelOf

func UserLoginLogModelOf() *UserLoginLogModel

func (*UserLoginLogModel) TableName

func (this *UserLoginLogModel) TableName() string

type UserModel

type UserModel struct {
	BaseModel
}

func UserModelOf

func UserModelOf() *UserModel

func (*UserModel) CreateIndex

func (this *UserModel) CreateIndex(force ...bool)

func (*UserModel) TableName

func (this *UserModel) TableName() string

type UserProfile

type UserProfile struct {
	Gender             int          `json:"gender"`             // 性别类型ID
	UserNumber         int64        `json:"userNumId"`          // 用户数字ID
	Intro              string       `json:"intro"`              // 简介
	BackgroundCoverUrl string       `json:"backgroundCoverUrl"` // 背景图片URL
	Avatar             *AvatarInfo  `json:"avatar"`             // 用户头像
	UserId             string       `json:"userId"`             // 用户唯一ID
	Address            *AddressInfo `json:"address"`            // 地址
	NickName           string       `json:"nickname"`           // 用户昵称
	GenderDesc         string       `json:"genderDesc"`         // 性别描述
	PostNumber         int64        `json:"postNum"`            // 用户作品数
	ThumbsUpNum        int64        `json:"thumbsUpNum"`        // 点赞数
	ThumbsUpNumTxt     string       `json:"thumbsUpNumTxt"`     // 点赞数字符串
	CommentNum         int64        `json:"commentNum"`         // 评论数
	CommentNumTxt      string       `json:"commentNumTxt"`      // 评论数字符串
	LikesNum           int64        `json:"likesNum"`           // 用户喜欢作品数量
	FollowNum          int64        `json:"followNum"`          // 用户关注数
	FansNum            int64        `json:"fansNum"`            // 用户粉丝数
}

公共用户相关信息

func NewUserProfile

func NewUserProfile(id string) *UserProfile

用户信息

type UserRelation

type UserRelation struct {
	Id           bson.ObjectId `json:"id" bson:"_id"`                    // ID
	UserId       string        `json:"userId" bson:"userId"`             // 用户ID
	TargetUserId string        `json:"targetUserId" bson:"targetUserId"` // 关系目标用户ID
	TargetType   string        `json:"targetType" bson:"targetType"`     // 关系类型
	Status       int           `json:"status" bson:"status"`             // 状态
	Extras       beego.M       `json:"extras" bson:"extras"`             // 扩展信息
	Tags         []string      `json:"tags" bson:"tags"`                 // 分类tags
	Versions     []string      `json:"versions" bson:"versions"`         // 状态版本变化历史 ["1-2020-08-01","2-2020-10-01"]
	CreatedAt    time.Time     `json:"createdAt" bson:"createdAt"`       // 创建时间
	UpdatedAt    time.Time     `json:"updatedAt" bson:"updatedAt"`       // 更新时间
	DeletedAt    int64         `json:"deletedAt" bson:"deletedAt"`       // 删除时间
	// contains filtered or unexported fields
}

用户关系记录

func NewUserRelation

func NewUserRelation() *UserRelation

func (*UserRelation) AddExcludeKeys

func (this *UserRelation) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*UserRelation) AddFilters

func (this *UserRelation) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*UserRelation) Excludes

func (this *UserRelation) Excludes(key string) bool

Excludes 是否排除键

func (*UserRelation) Foreach

func (this *UserRelation) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*UserRelation) GetFormatterTime

func (this *UserRelation) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*UserRelation) GetId

func (this *UserRelation) GetId() bson.ObjectId

func (*UserRelation) GetKeysFilter

func (this *UserRelation) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*UserRelation) GetNow

func (this *UserRelation) GetNow() time.Time

func (*UserRelation) GetTransformFilter

func (this *UserRelation) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*UserRelation) GetTransformFilterByKey

func (this *UserRelation) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*UserRelation) Init

func (this *UserRelation) Init()

func (*UserRelation) InitDefault

func (this *UserRelation) InitDefault()

InitDefault 初始化默认值

func (*UserRelation) IsEmpty

func (this *UserRelation) IsEmpty(v interface{}) bool

func (*UserRelation) Keys

func (this *UserRelation) Keys() []string

Keys 数据键集合

func (*UserRelation) M

func (this *UserRelation) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*UserRelation) Map

func (this *UserRelation) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*UserRelation) Merger

func (this *UserRelation) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*UserRelation) RemoveExcludeKeys

func (this *UserRelation) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*UserRelation) Save

func (this *UserRelation) Save() error

Save 保存

func (*UserRelation) Set

func (this *UserRelation) Set(key string, v interface{}) *UserRelation

func (*UserRelation) SetAttributes

func (this *UserRelation) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*UserRelation) SetBool

func (this *UserRelation) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*UserRelation) SetBsonMapper

func (this *UserRelation) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*UserRelation) SetMap

func (this *UserRelation) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*UserRelation) SetMapper

func (this *UserRelation) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*UserRelation) SetNumInt

func (this *UserRelation) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*UserRelation) SetNumIntN

func (this *UserRelation) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*UserRelation) SetObjectId

func (this *UserRelation) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*UserRelation) SetProvider

func (this *UserRelation) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*UserRelation) SetSameTypeValue

func (this *UserRelation) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*UserRelation) SetString

func (this *UserRelation) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*UserRelation) SetStringArr

func (this *UserRelation) SetStringArr(arr *[]string, v interface{}) bool

func (*UserRelation) SetTime

func (this *UserRelation) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*UserRelation) Values

func (this *UserRelation) Values() []interface{}

Values 数据值集合

type UserRelationModel

type UserRelationModel struct {
	BaseModel
}

func UserRelationModelOf

func UserRelationModelOf() *UserRelationModel

func (*UserRelationModel) CreateIndex

func (this *UserRelationModel) CreateIndex(force ...bool)

func (*UserRelationModel) GetByUnique

func (this *UserRelationModel) GetByUnique(m beego.M) *UserRelation

唯一

func (*UserRelationModel) SaveInfo

func (this *UserRelationModel) SaveInfo(userId string, targetUserId string, extras ...beego.M) error

保存关系记录

func (*UserRelationModel) TableName

func (this *UserRelationModel) TableName() string

type UserRoleType

type UserRoleType struct {
	Id        bson.ObjectId `json:"id" bson:"_id"`                              // ID
	Name      string        `json:"name" bson:"name"`                           // 身份名
	Role      int           `json:"role" json:"role"`                           // 身份ID
	State     int           `json:"state" json:"state"`                         // 状态
	Level     int           `json:"level" json:"level"`                         // 身份等级 最高 99999,(1~99999)
	Extras    bson.M        `json:"extras,omitempty" json:"extras,omitempty"`   // 扩展信息
	Comment   string        `json:"comment,omitempty" json:"comment,omitempty"` // 备注
	CreatedAt time.Time     `json:"createdAt" bson:"createdAt"`                 // 创建时间
	// contains filtered or unexported fields
}

用户身份类型

func NewUserRole

func NewUserRole() *UserRoleType

func (*UserRoleType) AddExcludeKeys

func (this *UserRoleType) AddExcludeKeys(key ...string)

AddExcludeKeys 添加排除键

func (*UserRoleType) AddFilters

func (this *UserRoleType) AddFilters(filters ...func(m beego.M) beego.M)

AddFilters 添加过滤器

func (*UserRoleType) Excludes

func (this *UserRoleType) Excludes(key string) bool

Excludes 是否排除键

func (*UserRoleType) Foreach

func (this *UserRoleType) Foreach(each func(k string, v interface{}) bool)

Foreach 遍历

func (*UserRoleType) GetFormatterTime

func (this *UserRoleType) GetFormatterTime(key string) func(data beego.M) beego.M

GetFormatterTime 时间戳格式

func (*UserRoleType) GetId

func (this *UserRoleType) GetId() bson.ObjectId

func (*UserRoleType) GetKeysFilter

func (this *UserRoleType) GetKeysFilter(keys []string, excludes ...bool) func(data beego.M) beego.M

GetKeysFilter 字段过滤器

func (*UserRoleType) GetNow

func (this *UserRoleType) GetNow() time.Time

func (*UserRoleType) GetTransformFilter

func (this *UserRoleType) GetTransformFilter(transform func(key string, v interface{}, data *beego.M)) func(data beego.M) beego.M

GetTransformFilter 字段转换器

func (*UserRoleType) GetTransformFilterByKey

func (this *UserRoleType) GetTransformFilterByKey(key string, trans func(v interface{}) interface{}) func(data beego.M) beego.M

GetTransformFilterByKey 字段转换器

func (*UserRoleType) Init

func (this *UserRoleType) Init()

func (*UserRoleType) InitDefault

func (this *UserRoleType) InitDefault()

InitDefault 初始化默认值

func (*UserRoleType) IsEmpty

func (this *UserRoleType) IsEmpty(v interface{}) bool

func (*UserRoleType) Keys

func (this *UserRoleType) Keys() []string

Keys 数据键集合

func (*UserRoleType) M

func (this *UserRoleType) M(filter ...func(m beego.M) beego.M) beego.M

M 过滤输出数据

func (*UserRoleType) Map

func (this *UserRoleType) Map(each func(k string, v interface{}, result interface{}) interface{}, result ...interface{}) interface{}

Map 遍历

func (*UserRoleType) Merger

func (this *UserRoleType) Merger(m beego.M, m2 beego.M) beego.M

Merger 合并

func (*UserRoleType) RemoveExcludeKeys

func (this *UserRoleType) RemoveExcludeKeys(key ...string)

RemoveExcludeKeys 移除排除键

func (*UserRoleType) Save

func (this *UserRoleType) Save() error

Save 保存

func (*UserRoleType) Set

func (this *UserRoleType) Set(key string, v interface{}) *UserRoleType

setter

func (*UserRoleType) SetAttributes

func (this *UserRoleType) SetAttributes(m map[string]interface{}, safe ...bool)

SetAttributes 设置属性值

func (*UserRoleType) SetBool

func (this *UserRoleType) SetBool(value *bool, v interface{}) bool

SetBool 设置数字

func (*UserRoleType) SetBsonMapper

func (this *UserRoleType) SetBsonMapper(tObj *bson.M, v interface{}, force ...bool) bool

SetBsonMapper bson Map 赋值

func (*UserRoleType) SetMap

func (this *UserRoleType) SetMap(tObj *map[string]interface{}, v interface{}, force ...bool) bool

SetMap Map 赋值

func (*UserRoleType) SetMapper

func (this *UserRoleType) SetMapper(tObj *beego.M, v interface{}, force ...bool) bool

SetMapper 设置mapper

func (*UserRoleType) SetNumInt

func (this *UserRoleType) SetNumInt(num *int, v interface{}) bool

SetNumInt 设置数字

func (*UserRoleType) SetNumIntN

func (this *UserRoleType) SetNumIntN(num *int64, v interface{}) bool

SetNumIntN 设置数字

func (*UserRoleType) SetObjectId

func (this *UserRoleType) SetObjectId(objId *bson.ObjectId, v interface{}) bool

SetObjectId 设置objectId

func (*UserRoleType) SetProvider

func (this *UserRoleType) SetProvider(name string, v interface{})

SetProvider 设置服务提供函数

func (*UserRoleType) SetSameTypeValue

func (this *UserRoleType) SetSameTypeValue(obj interface{}, v interface{}) bool

SetSameTypeValue 相同类型赋值

func (*UserRoleType) SetString

func (this *UserRoleType) SetString(str *string, v interface{}) bool

SetString 设置字符串

func (*UserRoleType) SetStringArr

func (this *UserRoleType) SetStringArr(arr *[]string, v interface{}) bool

func (*UserRoleType) SetTime

func (this *UserRoleType) SetTime(tObj *time.Time, v interface{}, force ...bool) bool

SetTime 设置时间

func (*UserRoleType) Values

func (this *UserRoleType) Values() []interface{}

Values 数据值集合

type UserRolesConfigModel

type UserRolesConfigModel struct {
	BaseModel
}

func UserRolesConfigModelOf

func UserRolesConfigModelOf() *UserRolesConfigModel

func (*UserRolesConfigModel) Adds

func (this *UserRolesConfigModel) Adds(items []map[string]interface{}) error

批量导入

func (*UserRolesConfigModel) CreateIndex

func (this *UserRolesConfigModel) CreateIndex(force ...bool)

func (*UserRolesConfigModel) GetByUnique

func (this *UserRolesConfigModel) GetByUnique(data map[string]interface{}) *UserRoleType

func (*UserRolesConfigModel) GetRoleName

func (this *UserRolesConfigModel) GetRoleName(role int) string

func (*UserRolesConfigModel) TableName

func (this *UserRolesConfigModel) TableName() string

type Video

type Video struct {
	MediaId      string        `json:"mediaId" bson:"mediaId"`           // ID
	Url          string        `json:"url" bson:"url"`                   // url
	Size         int           `json:"size" bson:"size"`                 // 大小
	CoverUrl     string        `json:"coverUrl" bson:"coverUrl"`         // 视频封面
	SizeText     string        `json:"sizeText" bson:"sizeText"`         // 大小
	Duration     time.Duration `json:"duration" bson:"duration"`         // 时长
	DurationText string        `json:"durationText" bson:"durationText"` // 时长描述
	CoverId      string        `json:"coverId" bson:"coverId"`           // 封面ID
}

Video 视频

func (*Video) M

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

Jump to

Keyboard shortcuts

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