Documentation ¶
Index ¶
- Constants
- Variables
- func Close(closer io.Closer)
- func PathsServiceOf() *pathsService
- func PopularizationServiceOf() *popularizationServiceImpl
- func RegisterUrlService()
- type AppService
- type ApplyHistory
- type ApplyService
- type AttachmentService
- type AttachmentServiceImpl
- func (this *AttachmentServiceImpl) AutoCoverForVideo(attachment *models.Attachment, posts ...*models.TravelNotes) string
- func (this *AttachmentServiceImpl) Create(attach *models.Attachment) bool
- func (this *AttachmentServiceImpl) Get(mediaId string) *models.Attachment
- func (this *AttachmentServiceImpl) GetAccessUrl(mediaId string) string
- func (this *AttachmentServiceImpl) GetByHash(hash string) *models.Attachment
- func (this *AttachmentServiceImpl) GetById(id string) *models.Attachment
- func (this *AttachmentServiceImpl) GetUrl(mediaId string) string
- func (this *AttachmentServiceImpl) Init()
- func (this *AttachmentServiceImpl) Lists(page, count int) ([]*models.Attachment, *models.Meta)
- func (this *AttachmentServiceImpl) Remove(query beego.M) bool
- func (this *AttachmentServiceImpl) Save(reader io.ReadCloser, extras ...beego.M) *models.Attachment
- func (this *AttachmentServiceImpl) SaveToOssById(id string) error
- func (this *AttachmentServiceImpl) SyncOssTask() int
- func (this *AttachmentServiceImpl) UpdateById(id string, update beego.M) error
- func (this *AttachmentServiceImpl) Uploader(reader io.ReadCloser, extras beego.M) *models.Attachment
- type AuditLogService
- type AuthService
- type AuthServiceImpl
- func (this *AuthServiceImpl) GetByAccessToken(token string) (*models.User, common.Errors)
- func (this *AuthServiceImpl) GetCache() cache.Cache
- func (this *AuthServiceImpl) Init()
- func (this *AuthServiceImpl) Keep(token string, duration ...time.Duration)
- func (this *AuthServiceImpl) LoginByUserPassword(typ string, value string, password string, args ...interface{}) (*models.User, string, common.Errors)
- func (this *AuthServiceImpl) Logout(userId, token string) error
- func (this *AuthServiceImpl) Release(token string) error
- func (this *AuthServiceImpl) ReleaseByUserId(ids ...string) bool
- func (this *AuthServiceImpl) Token(user *models.User, args ...interface{}) string
- type AvatarInfo
- type AvatarService
- type BaseService
- func (this *BaseService) Class() string
- func (this *BaseService) GetAttribute(key string, defaults ...interface{}) interface{}
- func (this *BaseService) GetInstance(args ...interface{}) interface{}
- func (this *BaseService) Hash() string
- func (this *BaseService) Invoker() func(args ...interface{}) interface{}
- func (this *BaseService) Service() Service
- func (this *BaseService) SetAttribute(key string, value interface{}) Service
- type CacheConfig
- type CacheService
- type CommentService
- type ConfigService
- type ConfigServiceImpl
- type EmailRequest
- type EmailRequestImpl
- func (this *EmailRequestImpl) AddFile(fs string) *EmailRequestImpl
- func (this *EmailRequestImpl) Content() string
- func (this *EmailRequestImpl) Extras() map[string]interface{}
- func (this *EmailRequestImpl) From() string
- func (this *EmailRequestImpl) Set(key string, v string) *EmailRequestImpl
- func (this *EmailRequestImpl) To() []string
- type EmailService
- type EmailServiceImpl
- func (this *EmailServiceImpl) Init()
- func (this *EmailServiceImpl) IsTsl() bool
- func (this *EmailServiceImpl) Send(emailTo string, emailFrom string, content string) interface{}
- func (this *EmailServiceImpl) SendHtml(emailTo string, emailFrom string, content string) interface{}
- func (this *EmailServiceImpl) SendWithCallback(target EmailRequest, callback func(target EmailRequest, result interface{}))
- func (this *EmailServiceImpl) Sends(target EmailRequest) error
- type FileSchemaWrapper
- type FileService
- type FileSystem
- type FsConfig
- type InitDataService
- type InitLoaderService
- type LoaderDataService
- type PopularizationService
- type PostService
- type QrcodeParams
- func (this *QrcodeParams) GetParam(key string, defaults ...string) string
- func (this *QrcodeParams) Init()
- func (this *QrcodeParams) ParseContent(content string) beego.M
- func (this *QrcodeParams) Pop(key string, defaults ...string) string
- func (this *QrcodeParams) Set(key string, v string) *QrcodeParams
- func (this *QrcodeParams) Verify(sign string) bool
- type QrcodeService
- type ReturnAudio
- type ReturnBody
- type ReturnFormat
- type ReturnTags
- type ReturnVideo
- type Service
- type SimpleUrlAttach
- type SmsCodeService
- type SmsCodeServiceAliCloudImpl
- func (this *SmsCodeServiceAliCloudImpl) CreateClient() *dysmsapi.Client
- func (this *SmsCodeServiceAliCloudImpl) CreateSmsRequest(mobile string, extras map[string]string) *dysmsapi.SendSmsRequest
- func (this *SmsCodeServiceAliCloudImpl) Debug() bool
- func (this *SmsCodeServiceAliCloudImpl) Get(mobile string, ty string) string
- func (this *SmsCodeServiceAliCloudImpl) GetCache() cache.Cache
- func (this *SmsCodeServiceAliCloudImpl) Init()
- func (this *SmsCodeServiceAliCloudImpl) Key(mobile string, ty string) string
- func (this *SmsCodeServiceAliCloudImpl) Send(mobile string, content string, extras map[string]string) error
- func (this *SmsCodeServiceAliCloudImpl) SendCode(mobile string, typ string, extras map[string]string) (string, error)
- func (this *SmsCodeServiceAliCloudImpl) Storage(mobile string, data string, typ string, timeout time.Duration)
- func (this *SmsCodeServiceAliCloudImpl) Verify(mobile string, code string, typ string) bool
- type TagsService
- type TemplateService
- type TemplateServiceImpl
- func (this *TemplateServiceImpl) Add(temp *models.MessageTemplate) error
- func (this *TemplateServiceImpl) GetByNameType(name string, typ string) *models.MessageTemplate
- func (this *TemplateServiceImpl) Init()
- func (this *TemplateServiceImpl) Lists(query interface{}, limit models.ListsParams, selects ...interface{}) ([]*TemplateServiceImpl, int, bool)
- func (this *TemplateServiceImpl) UpdateByNameType(name string, typ string, data map[string]interface{}) bool
- type ThumbsUpService
- type TicketService
- type TravelPostServiceImpl
- func (this *TravelPostServiceImpl) AddAuditLog(userId, typ, comment string, ids []string) bool
- func (this *TravelPostServiceImpl) AfterIncr(userId string, incr int)
- func (this *TravelPostServiceImpl) All(query beego.M, limit models.ListsParams, sorts ...string) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) Audit(typ string, ids ...string) bool
- func (this *TravelPostServiceImpl) AutoVideoCoverImageTask(ids []string) int
- func (this *TravelPostServiceImpl) Create(notes *models.TravelNotes) error
- func (this *TravelPostServiceImpl) Exists(query bson.M) bool
- func (this *TravelPostServiceImpl) GetById(id string) *models.TravelNotes
- func (this *TravelPostServiceImpl) GetRankingLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) GetRecommendLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) IncrComment(id string) error
- func (this *TravelPostServiceImpl) IncrThumbsUp(id string, incr int) error
- func (this *TravelPostServiceImpl) Init()
- func (this *TravelPostServiceImpl) IsThumbsUp(postId string, userId string) bool
- func (this *TravelPostServiceImpl) ListByAddress(address string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) ListByTags(tags []string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) Lists(userId string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) ListsQuery(query bson.M, limit models.ListsParams, sort ...string) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) Search(search beego.M, page models.ListsParams) ([]*models.TravelNotes, *models.Meta)
- func (this *TravelPostServiceImpl) UpdateById(id string, data beego.M) error
- type UrlTicketService
- type UserBehaviorService
- type UserCollectionService
- type UserRoleService
- type UserService
- type UserServiceImpl
- func (this *UserServiceImpl) Add(user map[string]interface{}) common.Errors
- func (this *UserServiceImpl) Create(user *models.User) common.Errors
- func (this *UserServiceImpl) Exists(m beego.M) bool
- func (this *UserServiceImpl) GetByEmail(email string) *models.User
- func (this *UserServiceImpl) GetById(id string) *models.User
- func (this *UserServiceImpl) GetByMobile(mobile string) *models.User
- func (this *UserServiceImpl) GetByUserName(name string) *models.User
- func (this *UserServiceImpl) GetUserFansCount(id string) int64
- func (this *UserServiceImpl) GetUserFollowCount(id string) int64
- func (this *UserServiceImpl) GetUserProfile(userId string) (*models.UserProfile, error)
- func (this *UserServiceImpl) GetUserThumbsUpCount(id string) int64
- func (this *UserServiceImpl) IncrBy(query bson.M, key string, incr int) error
- func (this *UserServiceImpl) Init()
- func (this *UserServiceImpl) Inserts(users []map[string]interface{}, txn ...func([]map[string]interface{}) bool) int
- func (this *UserServiceImpl) Lists(page int, size int, query ...interface{}) (items []*models.User, total int, more bool)
- func (this *UserServiceImpl) RemoveByUid(uid string) bool
- func (this *UserServiceImpl) SearchUserByNickName(nickname string, limit models.ListsParams) ([]*models.User, *models.Meta)
- func (this *UserServiceImpl) UpdateByUid(uid string, data map[string]interface{}) error
- func (this *UserServiceImpl) UpdateUserAddressById(id string, addr *models.UserAddress) error
Constants ¶
View Source
const ( AppCache = "app" AppCodeKey = "appCode" ConfigAppScope = "app" AppHelpUrlKey = "appHelpUrl" AppAboutUsKey = "appAboutUs" AppUserAgreementKey = "appUserAgreement" AppPrivacyKey = "appPrivacy" AppCustomersKey = "appCustomers" AppBuiltKey = "appBuilt" AppAllegeEmail = "allegeEmail" AppConfigsKey = "configs" )
View Source
const ( AttachTypeDoc = models.AttachTypeDoc AttachTypeText = models.AttachTypeText AttachTypeVideo = models.AttachTypeVideo AttachTypeImage = models.AttachTypeImage AttachTypeImageAvatar = models.AttachTypeImageAvatar MaxSize = 220000000 )
View Source
const ( IdKey = "id" CacheAtKey = "cached_at" ExpiredAtKey = "expired_at" AuthCacheDriverDefault = "redis" AuthAliveTime = 7 * 24 * time.Hour AuthCacheDriverKey = "auth_cache_driver" AuthCacheConfigKey = "auth_cache_config" DispatchAccessToken = "access_tokens" DispatchTokenKeep = "keep" AuthCacheConfigDefault = `{"key":"access_token","conn":":6039","dbNum":"2","password":""}` )
View Source
const ( GroupDot = "," AutoLoadCacheInsKey = "cache_groups" CacheDriverTpl = "%s_cache_driver" CacheConfigTpl = "%s_cache_config" CacheDefaultDriver = "redis" )
View Source
const ( EmailSmtpHost = "smtp_host" DefaultHost = "smtp.126.com" DefaultUserName = "test" DefaultPassword = "" DefaultSmtpPort = "25" EmailSmtpUserName = "smtp_username" EmailSmtpPassword = "smtp_password" EmailSmtpPort = "smtp_port" EmailSmtpFromEmail = "smtp_from" EmailIsHtml = "isHtml" EmailAttachments = "attachments" EmailFiles = "files" EmailSubject = "subject" EmailHeaders = "headers" EmailContent = "content" EmailTo = "to" EmailFrom = "from" EmailSender = "sender" )
View Source
const ( FileSystemGroupDiv = "," FileSystemRootTpl = "filesystem.%s.root" FileSystemJsonTpl = "filesystem.%s.conf" AutoLoadFileSystemDiskGroupKey = "filesystem_groups" )
View Source
const ( PostTypeImage = 1 PostTypeVideo = 2 )
View Source
const ( QrcodeParamSign = "c=Q" QrcodeServiceClass = "QrcodeService" )
View Source
const ( DySmsApiRegionId = "dysms_api_region_id" DySmsAccessKeyId = "dysms_access_key_id" DySmsAccessKeySecret = "dysms_access_key_secret" DefaultDySmsApiRegionId = "cn-hangzhou" SmsCacheDriverKey = "sms_cache_driver" SmsCacheDriverDefault = "redis" SmsCacheConfigKey = "sms_cache_config" SmsCacheConfigDefault = `{"key":"sms","conn":"127.0.0.1:6379","dbNum":"1","password":""}` )
View Source
const ( ThumbsUpActUp = 1 ThumbsUpActDown = 0 )
View Source
const (
PopularizationServiceClass = "PopularizationService"
)
View Source
const (
PostTagGroup = "post"
)
View Source
const (
UrlTicketServerClass = "UrlAccessService"
)
Variables ¶
View Source
var (
DefaultTslSmtpPorts = []string{"465", "587"}
)
Functions ¶
func PathsServiceOf ¶
func PathsServiceOf() *pathsService
func PopularizationServiceOf ¶
func PopularizationServiceOf() *popularizationServiceImpl
Types ¶
type AppService ¶
type AppService interface { GetAppVersion(string) string GetAboutUs(...string) string GetPrivacy() string GetUserAgreement() string GetAppCustomers() []string GetAppInfos(...string) map[string]interface{} }
func AppServiceOf ¶
func AppServiceOf() AppService
type ApplyHistory ¶
type ApplyService ¶
func ApplyServiceOf ¶
func ApplyServiceOf() ApplyService
type AttachmentService ¶
type AttachmentService interface { SyncOssTask() int Remove(query beego.M) bool Get(mediaId string) *models.Attachment UpdateById(string, beego.M) error GetUrl(string) string GetById(id string) *models.Attachment GetAccessUrl(string) string Lists(page, count int) ([]*models.Attachment, *models.Meta) AutoCoverForVideo(attachment *models.Attachment, posts ...*models.TravelNotes) string Save(reader io.ReadCloser, extras ...beego.M) *models.Attachment }
func AttachmentServiceOf ¶
func AttachmentServiceOf() AttachmentService
type AttachmentServiceImpl ¶
type AttachmentServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*AttachmentServiceImpl) AutoCoverForVideo ¶
func (this *AttachmentServiceImpl) AutoCoverForVideo(attachment *models.Attachment, posts ...*models.TravelNotes) string
func (*AttachmentServiceImpl) Create ¶
func (this *AttachmentServiceImpl) Create(attach *models.Attachment) bool
func (*AttachmentServiceImpl) Get ¶
func (this *AttachmentServiceImpl) Get(mediaId string) *models.Attachment
func (*AttachmentServiceImpl) GetAccessUrl ¶
func (this *AttachmentServiceImpl) GetAccessUrl(mediaId string) string
func (*AttachmentServiceImpl) GetByHash ¶
func (this *AttachmentServiceImpl) GetByHash(hash string) *models.Attachment
func (*AttachmentServiceImpl) GetById ¶
func (this *AttachmentServiceImpl) GetById(id string) *models.Attachment
func (*AttachmentServiceImpl) GetUrl ¶
func (this *AttachmentServiceImpl) GetUrl(mediaId string) string
func (*AttachmentServiceImpl) Init ¶
func (this *AttachmentServiceImpl) Init()
func (*AttachmentServiceImpl) Lists ¶
func (this *AttachmentServiceImpl) Lists(page, count int) ([]*models.Attachment, *models.Meta)
func (*AttachmentServiceImpl) Remove ¶
func (this *AttachmentServiceImpl) Remove(query beego.M) bool
func (*AttachmentServiceImpl) Save ¶
func (this *AttachmentServiceImpl) Save(reader io.ReadCloser, extras ...beego.M) *models.Attachment
func (*AttachmentServiceImpl) SaveToOssById ¶
func (this *AttachmentServiceImpl) SaveToOssById(id string) error
func (*AttachmentServiceImpl) SyncOssTask ¶
func (this *AttachmentServiceImpl) SyncOssTask() int
func (*AttachmentServiceImpl) UpdateById ¶
func (this *AttachmentServiceImpl) UpdateById(id string, update beego.M) error
func (*AttachmentServiceImpl) Uploader ¶
func (this *AttachmentServiceImpl) Uploader(reader io.ReadCloser, extras beego.M) *models.Attachment
Uploader oss 上传器
type AuditLogService ¶
func AuditLogServiceOf ¶
func AuditLogServiceOf() AuditLogService
type AuthService ¶
type AuthService interface { LoginByUserPassword(typ string, value string, password string, args ...interface{}) (*models.User, string, common.Errors) GetByAccessToken(string) (*models.User, common.Errors) Keep(token string, duration ...time.Duration) Token(user *models.User, args ...interface{}) string Release(token string) error ReleaseByUserId(...string) bool Logout(userId, token string) error }
func AuthServiceOf ¶
func AuthServiceOf() AuthService
type AuthServiceImpl ¶
type AuthServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*AuthServiceImpl) GetByAccessToken ¶
GetByAccessToken 获取用户数据 通过 token
func (*AuthServiceImpl) GetCache ¶
func (this *AuthServiceImpl) GetCache() cache.Cache
GetCache 获取缓存
func (*AuthServiceImpl) Init ¶
func (this *AuthServiceImpl) Init()
func (*AuthServiceImpl) Keep ¶
func (this *AuthServiceImpl) Keep(token string, duration ...time.Duration)
Keep 保持登录token
func (*AuthServiceImpl) LoginByUserPassword ¶
func (*AuthServiceImpl) Logout ¶
func (this *AuthServiceImpl) Logout(userId, token string) error
Logout 通过 userId, token
func (*AuthServiceImpl) Release ¶
func (this *AuthServiceImpl) Release(token string) error
Release 通过 token 释放
func (*AuthServiceImpl) ReleaseByUserId ¶
func (this *AuthServiceImpl) ReleaseByUserId(ids ...string) bool
type AvatarInfo ¶
type AvatarService ¶
type AvatarService interface { GetDefaultAvatar(...int) *models.Attachment GetAvatarUrlById(string) string GetAvatarUrlDefault(...int) string GetAvatarById(string, ...int) *AvatarInfo }
func AvatarServerOf ¶
func AvatarServerOf() AvatarService
type BaseService ¶
type BaseService struct { ClassName string Lock sync.Mutex Attributes map[string]interface{} Constructor func(args ...interface{}) interface{} // contains filtered or unexported fields }
func ServiceOf ¶
func ServiceOf() *BaseService
func (*BaseService) Class ¶
func (this *BaseService) Class() string
func (*BaseService) GetAttribute ¶
func (this *BaseService) GetAttribute(key string, defaults ...interface{}) interface{}
func (*BaseService) GetInstance ¶
func (this *BaseService) GetInstance(args ...interface{}) interface{}
func (*BaseService) Hash ¶
func (this *BaseService) Hash() string
func (*BaseService) Invoker ¶
func (this *BaseService) Invoker() func(args ...interface{}) interface{}
func (*BaseService) Service ¶
func (this *BaseService) Service() Service
func (*BaseService) SetAttribute ¶
func (this *BaseService) SetAttribute(key string, value interface{}) Service
type CacheConfig ¶
CacheConfig 配置
type CacheService ¶
type CacheService interface { Get(string) cache.Cache Add(string, *CacheConfig) CacheService }
type CommentService ¶
type CommentService interface { GetById(string) *models.Comment Commit(data *models.Comment) error IncrThumbsUp(id string, incr int) error GetReviews(string) ([]*models.Comment, int) Lists(typ, id string, page models.ListsParams, extras ...beego.M) ([]*models.Comment, *models.Meta) }
func CommentServiceOf ¶
func CommentServiceOf() CommentService
type ConfigService ¶
type ConfigService interface { Adds(items []map[string]interface{}) error Update(data map[string]string) error }
func ConfigServiceOf ¶
func ConfigServiceOf() ConfigService
type ConfigServiceImpl ¶
type ConfigServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*ConfigServiceImpl) Adds ¶
func (this *ConfigServiceImpl) Adds(items []map[string]interface{}) error
func (*ConfigServiceImpl) Init ¶
func (this *ConfigServiceImpl) Init()
type EmailRequest ¶
type EmailRequestImpl ¶
type EmailRequestImpl struct {
// contains filtered or unexported fields
}
func NewEmailRequest ¶
func NewEmailRequest() *EmailRequestImpl
func (*EmailRequestImpl) AddFile ¶
func (this *EmailRequestImpl) AddFile(fs string) *EmailRequestImpl
func (*EmailRequestImpl) Content ¶
func (this *EmailRequestImpl) Content() string
func (*EmailRequestImpl) Extras ¶
func (this *EmailRequestImpl) Extras() map[string]interface{}
func (*EmailRequestImpl) From ¶
func (this *EmailRequestImpl) From() string
func (*EmailRequestImpl) Set ¶
func (this *EmailRequestImpl) Set(key string, v string) *EmailRequestImpl
func (*EmailRequestImpl) To ¶
func (this *EmailRequestImpl) To() []string
type EmailService ¶
type EmailService interface { Sends(target EmailRequest) error Send(emailTo string, emailFrom string, content string) interface{} SendHtml(emailTo string, emailFrom string, content string) interface{} SendWithCallback(target EmailRequest, callback func(target EmailRequest, result interface{})) }
func EmailServiceOf ¶
func EmailServiceOf() EmailService
type EmailServiceImpl ¶
type EmailServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*EmailServiceImpl) Init ¶
func (this *EmailServiceImpl) Init()
func (*EmailServiceImpl) IsTsl ¶
func (this *EmailServiceImpl) IsTsl() bool
func (*EmailServiceImpl) Send ¶
func (this *EmailServiceImpl) Send(emailTo string, emailFrom string, content string) interface{}
func (*EmailServiceImpl) SendHtml ¶
func (this *EmailServiceImpl) SendHtml(emailTo string, emailFrom string, content string) interface{}
func (*EmailServiceImpl) SendWithCallback ¶
func (this *EmailServiceImpl) SendWithCallback(target EmailRequest, callback func(target EmailRequest, result interface{}))
func (*EmailServiceImpl) Sends ¶
func (this *EmailServiceImpl) Sends(target EmailRequest) error
type FileSchemaWrapper ¶
type FileSchemaWrapper interface {
Register(name string, handler FileService)
}
type FileService ¶
type FileService interface { Get(file string, disk ...string) *os.File Exits(file string, disk ...string) bool Content(file string, disk ...string) []byte Save(file string, data []byte, disk ...string) (string, interface{}) GetReader(file string, disk ...string) (io.Reader, error) GetWriter(file string, disk ...string) (io.Writer, error) SaveByReader(reader io.ReadCloser, extras beego.M) (beego.M, bool) }
type FileSystem ¶
type FileSystem interface { FileService FileSchemaWrapper Config() map[string]*FsConfig AddDisk(name string, root string, fn ...func(string) string) FileSystem }
func GetFileSystem ¶
func GetFileSystem() FileSystem
type InitDataService ¶
type InitLoaderService ¶
type InitLoaderService interface { InitDataService LoaderDataService }
func GetInitDataServiceInstance ¶
func GetInitDataServiceInstance() InitLoaderService
type LoaderDataService ¶
type LoaderDataService interface { SetInit(path ...string) LoaderDataService Init() }
type PopularizationService ¶
type PopularizationService interface { GetChannelQrcode(ch string) string GetChannelInfo(ch string) *models.PopularizationChannels }
type PostService ¶
type PostService interface { Audit(string, ...string) bool IncrComment(id string) error Exists(query bson.M) bool Create(notes *models.TravelNotes) error GetById(id string) *models.TravelNotes IncrThumbsUp(id string, incr int) error IsThumbsUp(postId string, userId string) bool UpdateById(id string, data beego.M) error AutoVideoCoverImageTask(ids []string) int AddAuditLog(userId, typ, comment string, ids []string) bool All(query beego.M, limit models.ListsParams, sorts ...string) ([]*models.TravelNotes, *models.Meta) ListsQuery(query bson.M, limit models.ListsParams, sort ...string) ([]*models.TravelNotes, *models.Meta) GetRankingLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta) GetRecommendLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta) Lists(userId string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta) ListByTags(tags []string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta) ListByAddress(address string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta) Search(search beego.M, page models.ListsParams) ([]*models.TravelNotes, *models.Meta) }
func PostServiceOf ¶
func PostServiceOf() PostService
type QrcodeParams ¶
type QrcodeParams struct { Content string `json:"content"` Level qrcode.RecoveryLevel `json:"level"` Options plugins.Options `json:"options"` Params beego.M `json:"params"` UserId string `json:"userId"` }
func NewQrcodeParams ¶
func NewQrcodeParams() *QrcodeParams
func (*QrcodeParams) GetParam ¶
func (this *QrcodeParams) GetParam(key string, defaults ...string) string
func (*QrcodeParams) Init ¶
func (this *QrcodeParams) Init()
func (*QrcodeParams) ParseContent ¶
func (this *QrcodeParams) ParseContent(content string) beego.M
func (*QrcodeParams) Set ¶
func (this *QrcodeParams) Set(key string, v string) *QrcodeParams
func (*QrcodeParams) Verify ¶
func (this *QrcodeParams) Verify(sign string) bool
type QrcodeService ¶
type QrcodeService interface {
CreateQrcode(data *QrcodeParams) (string, error)
}
func QrcodeServiceOf ¶
func QrcodeServiceOf() QrcodeService
type ReturnAudio ¶
type ReturnAudio struct { BitRate int64 `json:"bit_rate"` Channels string `json:"channels"` CodeName string `json:"code_name"` CodecType string `json:"codec_type"` Duration string `json:"duration"` Height string `json:"height"` Width string `json:"width"` Index string `json:"index"` NbFrames string `json:"nb_frames"` SampleFmt string `json:"sample_fmt"` RFrameRate string `json:"r_frame_rate"` SampleRate string `json:"sample_rate"` StartTime string `json:"start_time"` Tags *ReturnTags `json:"tags"` }
ReturnAudio 声频 audio
type ReturnBody ¶
type ReturnBody struct { Hash string `json:"hash"` Size string `json:"size"` Ty string `json:"x:type"` FileType string `json:"type"` Timestamp string `json:"x:timestamp"` App string `json:"x:app"` Name string `json:"name"` Id string `json:"x:uuid"` Path string `json:"key"` Color string `json:"color,omitempty"` FileName string `json:"x:filename,omitempty"` Width string `json:"w,omitempty"` Height string `json:"h,omitempty"` Duration string `json:"duration,omitempty"` }
ReturnBody 返回数据
type ReturnFormat ¶
type ReturnFormat struct { BitRate int64 `json:"bit_rate"` Duration float64 `json:"duration"` FormatLongName string `json:"format_long_name"` FormatName string `json:"format_name"` NbFrames int `json:"nb_frames"` Size int64 `json:"size"` StartTime string `json:"start_time"` Tags *ReturnTags `json:"tags"` }
ReturnFormat 格式
type ReturnTags ¶
type ReturnTags struct {
CreationTime string `json:"creation_time"`
}
ReturnTags tags
type ReturnVideo ¶
type ReturnVideo struct { BitRate int64 `json:"bit_rate"` CodeName string `json:"code_name"` CodecType string `json:"codec_type"` DisplayAspectRatio string `json:"display_aspect_ratio"` Duration string `json:"duration"` Height string `json:"height"` Width string `json:"width"` Index string `json:"index"` NbFrames string `json:"nb_frames"` PixFmt string `json:"pix_fmt"` RFrameRate string `json:"r_frame_rate"` SampleAspectRatio string `json:"sample_aspect_ratio"` StartTime string `json:"start_time"` Tags *ReturnTags `json:"tags"` }
ReturnVideo 视频 video
type SimpleUrlAttach ¶
type SimpleUrlAttach struct { Url string `json:"url"` MediaId string `json:"mediaId"` Path string `json:"path"` }
func NewSimpleUrlAttach ¶
func NewSimpleUrlAttach(data ...map[string]interface{}) *SimpleUrlAttach
func (*SimpleUrlAttach) Load ¶
func (this *SimpleUrlAttach) Load(data map[string]interface{}) *SimpleUrlAttach
func (*SimpleUrlAttach) Set ¶
func (this *SimpleUrlAttach) Set(key string, v interface{}) *SimpleUrlAttach
type SmsCodeService ¶
type SmsCodeService interface { Send(mobile string, content string, extras map[string]string) error SendCode(mobile string, typ string, extras map[string]string) (string, error) Verify(mobile string, code string, typ string) bool Storage(mobile string, data string, typ string, timeout time.Duration) }
func SmsCodeServiceOf ¶
func SmsCodeServiceOf() SmsCodeService
type SmsCodeServiceAliCloudImpl ¶
type SmsCodeServiceAliCloudImpl struct { BaseService // contains filtered or unexported fields }
func (*SmsCodeServiceAliCloudImpl) CreateClient ¶
func (this *SmsCodeServiceAliCloudImpl) CreateClient() *dysmsapi.Client
func (*SmsCodeServiceAliCloudImpl) CreateSmsRequest ¶
func (this *SmsCodeServiceAliCloudImpl) CreateSmsRequest(mobile string, extras map[string]string) *dysmsapi.SendSmsRequest
CreateSmsRequest 创建请求体
func (*SmsCodeServiceAliCloudImpl) Debug ¶
func (this *SmsCodeServiceAliCloudImpl) Debug() bool
func (*SmsCodeServiceAliCloudImpl) Get ¶
func (this *SmsCodeServiceAliCloudImpl) Get(mobile string, ty string) string
func (*SmsCodeServiceAliCloudImpl) GetCache ¶
func (this *SmsCodeServiceAliCloudImpl) GetCache() cache.Cache
func (*SmsCodeServiceAliCloudImpl) Init ¶
func (this *SmsCodeServiceAliCloudImpl) Init()
func (*SmsCodeServiceAliCloudImpl) Key ¶
func (this *SmsCodeServiceAliCloudImpl) Key(mobile string, ty string) string
func (*SmsCodeServiceAliCloudImpl) Send ¶
func (this *SmsCodeServiceAliCloudImpl) Send(mobile string, content string, extras map[string]string) error
Send 发送短信
type TagsService ¶
func TagsServiceOf ¶
func TagsServiceOf() TagsService
type TemplateService ¶
type TemplateService interface { Add(template *models.MessageTemplate) error GetByNameType(name string, typ string) *models.MessageTemplate UpdateByNameType(name string, typ string, data map[string]interface{}) bool Lists(query interface{}, limit models.ListsParams, selects ...interface{}) ([]*TemplateServiceImpl, int, bool) }
func TemplateServiceOf ¶
func TemplateServiceOf() TemplateService
type TemplateServiceImpl ¶
type TemplateServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*TemplateServiceImpl) Add ¶
func (this *TemplateServiceImpl) Add(temp *models.MessageTemplate) error
Add 添加
func (*TemplateServiceImpl) GetByNameType ¶
func (this *TemplateServiceImpl) GetByNameType(name string, typ string) *models.MessageTemplate
GetByNameType 获取名
func (*TemplateServiceImpl) Init ¶
func (this *TemplateServiceImpl) Init()
func (*TemplateServiceImpl) Lists ¶
func (this *TemplateServiceImpl) Lists(query interface{}, limit models.ListsParams, selects ...interface{}) ([]*TemplateServiceImpl, int, bool)
列表
func (*TemplateServiceImpl) UpdateByNameType ¶
func (this *TemplateServiceImpl) UpdateByNameType(name string, typ string, data map[string]interface{}) bool
UpdateByNameType 更新
type ThumbsUpService ¶
type ThumbsUpService interface { Exists(query bson.M) bool Count(string, string, ...string) int Up(typ string, typeId string, userId string) int Down(typ string, typeId string, userId string) int GetUserLikeLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta) }
func ThumbsUpServiceOf ¶
func ThumbsUpServiceOf() ThumbsUpService
type TicketService ¶
type TicketService interface { Remove(string) bool Expired(string) bool GetStorageProvider() cache.Cache CreateTicket(data map[string]interface{}) string GetTicketInfo(string) (map[string]interface{}, error) }
func TicketServiceOf ¶
func TicketServiceOf(storage ...CacheService) TicketService
type TravelPostServiceImpl ¶
type TravelPostServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*TravelPostServiceImpl) AddAuditLog ¶
func (this *TravelPostServiceImpl) AddAuditLog(userId, typ, comment string, ids []string) bool
func (*TravelPostServiceImpl) AfterIncr ¶
func (this *TravelPostServiceImpl) AfterIncr(userId string, incr int)
func (*TravelPostServiceImpl) All ¶
func (this *TravelPostServiceImpl) All(query beego.M, limit models.ListsParams, sorts ...string) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) Audit ¶
func (this *TravelPostServiceImpl) Audit(typ string, ids ...string) bool
func (*TravelPostServiceImpl) AutoVideoCoverImageTask ¶
func (this *TravelPostServiceImpl) AutoVideoCoverImageTask(ids []string) int
func (*TravelPostServiceImpl) Create ¶
func (this *TravelPostServiceImpl) Create(notes *models.TravelNotes) error
func (*TravelPostServiceImpl) GetById ¶
func (this *TravelPostServiceImpl) GetById(id string) *models.TravelNotes
func (*TravelPostServiceImpl) GetRankingLists ¶
func (this *TravelPostServiceImpl) GetRankingLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) GetRecommendLists ¶
func (this *TravelPostServiceImpl) GetRecommendLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta)
GetRecommendLists 获取推荐
func (*TravelPostServiceImpl) IncrComment ¶
func (this *TravelPostServiceImpl) IncrComment(id string) error
func (*TravelPostServiceImpl) IncrThumbsUp ¶
func (this *TravelPostServiceImpl) IncrThumbsUp(id string, incr int) error
func (*TravelPostServiceImpl) Init ¶
func (this *TravelPostServiceImpl) Init()
func (*TravelPostServiceImpl) IsThumbsUp ¶
func (this *TravelPostServiceImpl) IsThumbsUp(postId string, userId string) bool
func (*TravelPostServiceImpl) ListByAddress ¶
func (this *TravelPostServiceImpl) ListByAddress(address string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) ListByTags ¶
func (this *TravelPostServiceImpl) ListByTags(tags []string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) Lists ¶
func (this *TravelPostServiceImpl) Lists(userId string, page models.ListsParams, extras ...beego.M) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) ListsQuery ¶
func (this *TravelPostServiceImpl) ListsQuery(query bson.M, limit models.ListsParams, sort ...string) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) Search ¶
func (this *TravelPostServiceImpl) Search(search beego.M, page models.ListsParams) ([]*models.TravelNotes, *models.Meta)
func (*TravelPostServiceImpl) UpdateById ¶
func (this *TravelPostServiceImpl) UpdateById(id string, data beego.M) error
type UrlTicketService ¶
type UrlTicketService interface { TicketService GetUrl(string) string Incr(string) int GetAccessUrl(string) string GetTicketUrlByAttach(*models.Attachment) string GetTicketInfoToSimple(ticket string) *SimpleUrlAttach }
func UrlTicketServiceOf ¶
func UrlTicketServiceOf() UrlTicketService
type UserBehaviorService ¶
type UserBehaviorService interface { GetUserFansNumber(userId string) int64 IsFriend(userId, follower string) bool GetUserFollowNumber(userId string) int64 IsFollowed(userId, follower string) bool UnFollow(userId string, targetUserId string, extras ...beego.M) error Follow(userId string, targetUserId string, extras ...beego.M) error GetFans(userId string, limit models.ListsParams) ([]bson.ObjectId, *models.Meta) GetFollows(userId string, limit models.ListsParams) ([]bson.ObjectId, *models.Meta) GetFollowPostsLists(query bson.M, limit models.ListsParams) ([]*models.TravelNotes, *models.Meta) ListsByUserId(userId string, limit models.ListsParams, extras ...beego.M) ([]*models.UserFollow, *models.Meta) }
func UserBehaviorServiceOf ¶
func UserBehaviorServiceOf() UserBehaviorService
type UserCollectionService ¶
type UserCollectionService interface { Add(id, userId string, typeCode ...string) error Remove(id, userId string, typeCode ...string) error Lists(userId string, limit models.ListsParams) ([]*models.TravelNotes, models.ListsParams) }
func UserCollectionServiceOf ¶
func UserCollectionServiceOf() UserCollectionService
type UserRoleService ¶
type UserRoleService interface { GetRoleById(string) *models.UserRoleType GetRoleDesc(int) string }
func UserRoleServiceOf ¶
func UserRoleServiceOf() UserRoleService
type UserService ¶
type UserService interface { RemoveByUid(uid string) bool Exists(m beego.M) bool Create(model *models.User) common.Errors Add(user map[string]interface{}) common.Errors Inserts(users []map[string]interface{}, txn ...func([]map[string]interface{}) bool) int UpdateByUid(uid string, data map[string]interface{}) error Lists(page int, size int, args ...interface{}) (items []*models.User, total int, more bool) SearchUserByNickName(nickname string, limit models.ListsParams) ([]*models.User, *models.Meta) GetByMobile(mobile string) *models.User GetByEmail(email string) *models.User GetById(id string) *models.User GetByUserName(name string) *models.User GetUserFollowCount(id string) int64 GetUserFansCount(id string) int64 GetUserThumbsUpCount(id string) int64 IncrBy(query bson.M, key string, incr int) error GetUserProfile(string) (*models.UserProfile, error) }
func UserServiceOf ¶
func UserServiceOf() UserService
type UserServiceImpl ¶
type UserServiceImpl struct { BaseService // contains filtered or unexported fields }
func (*UserServiceImpl) Add ¶
func (this *UserServiceImpl) Add(user map[string]interface{}) common.Errors
func (*UserServiceImpl) Create ¶
func (this *UserServiceImpl) Create(user *models.User) common.Errors
func (*UserServiceImpl) GetByEmail ¶
func (this *UserServiceImpl) GetByEmail(email string) *models.User
func (*UserServiceImpl) GetByMobile ¶
func (this *UserServiceImpl) GetByMobile(mobile string) *models.User
func (*UserServiceImpl) GetByUserName ¶
func (this *UserServiceImpl) GetByUserName(name string) *models.User
func (*UserServiceImpl) GetUserFansCount ¶
func (this *UserServiceImpl) GetUserFansCount(id string) int64
func (*UserServiceImpl) GetUserFollowCount ¶
func (this *UserServiceImpl) GetUserFollowCount(id string) int64
func (*UserServiceImpl) GetUserProfile ¶
func (this *UserServiceImpl) GetUserProfile(userId string) (*models.UserProfile, error)
func (*UserServiceImpl) GetUserThumbsUpCount ¶
func (this *UserServiceImpl) GetUserThumbsUpCount(id string) int64
func (*UserServiceImpl) Init ¶
func (this *UserServiceImpl) Init()
func (*UserServiceImpl) Inserts ¶
func (this *UserServiceImpl) Inserts(users []map[string]interface{}, txn ...func([]map[string]interface{}) bool) int
func (*UserServiceImpl) RemoveByUid ¶
func (this *UserServiceImpl) RemoveByUid(uid string) bool
func (*UserServiceImpl) SearchUserByNickName ¶
func (this *UserServiceImpl) SearchUserByNickName(nickname string, limit models.ListsParams) ([]*models.User, *models.Meta)
func (*UserServiceImpl) UpdateByUid ¶
func (this *UserServiceImpl) UpdateByUid(uid string, data map[string]interface{}) error
func (*UserServiceImpl) UpdateUserAddressById ¶
func (this *UserServiceImpl) UpdateUserAddressById(id string, addr *models.UserAddress) error
Source Files ¶
- app_service.go
- apply_service.go
- attachment_service.go
- audit_log_service.go
- auth_service.go
- avatar_service.go
- base_service.go
- cache_service.go
- captcha_service.go
- comment_service.go
- config_service.go
- discover_service.go
- email_service.go
- file_service.go
- init_data_service.go
- message_template_service.go
- paths_service.go
- popularization_service.go
- posts_service.go
- qrcode_service.go
- recommend_service.go
- sms_code_service.go
- tags_service.go
- thumbs_up_service.go
- ticket_service.go
- url_ticket_service.go
- user_behavior_service.go
- user_collection_service.go
- user_role_service.go
- user_service.go
Click to show internal directories.
Click to hide internal directories.