controllers

package
v0.0.0-...-cc72008 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsController

type AnalyticsController struct {
	ClassesController
}

AnalyticsController ...

func (*AnalyticsController) AppOpened

func (a *AnalyticsController) AppOpened()

AppOpened ... @router /AppOpened [post]

func (*AnalyticsController) Delete

func (a *AnalyticsController) Delete()

Delete ... @router / [delete]

func (*AnalyticsController) Get

func (a *AnalyticsController) Get()

Get ... @router / [get]

func (*AnalyticsController) HandleEvent

func (a *AnalyticsController) HandleEvent()

HandleEvent ... @router /:eventName [post]

func (*AnalyticsController) Post

func (a *AnalyticsController) Post()

Post ... @router / [post]

func (*AnalyticsController) Put

func (a *AnalyticsController) Put()

Put ... @router / [put]

type BaseController

type BaseController struct {
	beego.Controller
	Info     *RequestInfo
	Auth     *rest.Auth
	Query    map[string]string
	JSONBody types.M
	RawBody  []byte
}

BaseController ... Info 当前请求的权限信息 Auth 当前请求的用户权限 JSONBody 由 JSON 格式转换来的请求数据 RawBody 原始请求数据

func (*BaseController) EnforceMasterKeyAccess

func (b *BaseController) EnforceMasterKeyAccess() bool

EnforceMasterKeyAccess 接口需要 Master 权限 返回 true 表示当前请求是 Master 权限

func (*BaseController) HandleError

func (b *BaseController) HandleError(err error, status int)

HandleError 返回错误信息,不指定 status 参数时,默认为 0

func (*BaseController) InvalidRequest

func (b *BaseController) InvalidRequest()

InvalidRequest 无效请求

func (*BaseController) Prepare

func (b *BaseController) Prepare()

Prepare 对请求权限进行处理 1. 从请求头中获取各种 key 2. 尝试按 json 格式转换 body 3. 尝试从 body 中获取各种 key 4. 校验请求权限 5. 生成用户信息

type BatchController

type BatchController struct {
	ClassesController
}

BatchController ...

func (*BatchController) Delete

func (b *BatchController) Delete()

Delete ... @router / [delete]

func (*BatchController) Get

func (b *BatchController) Get()

Get ... @router / [get]

func (*BatchController) HandleBatch

func (b *BatchController) HandleBatch()

HandleBatch ... @router / [post]

func (*BatchController) HandleRequest

func (b *BatchController) HandleRequest(requests types.S, headers map[string]string, scheme string)

HandleRequest ...

func (*BatchController) Put

func (b *BatchController) Put()

Put ... @router / [put]

type ClassesController

type ClassesController struct {
	BaseController
	ClassName string
	ObjectID  string
}

ClassesController 对象操作 API 的基础结构 处理 /classes 接口的所有请求,处理内部类的部分请求 ClassName 要操作的类名 ObjectID 要操作的对象 id

func (*ClassesController) Delete

func (c *ClassesController) Delete()

Delete ... @router / [delete]

func (*ClassesController) Get

func (c *ClassesController) Get()

Get ... @router / [get]

func (*ClassesController) HandleCreate

func (c *ClassesController) HandleCreate()

HandleCreate 处理对象创建请求,返回对象 id 与对象位置 @router /:className [post]

func (*ClassesController) HandleDelete

func (c *ClassesController) HandleDelete()

HandleDelete 处理删除指定对象请求 @router /:className/:objectId [delete]

func (*ClassesController) HandleFind

func (c *ClassesController) HandleFind()

HandleFind 处理查找对象请求 @router /:className [get]

func (*ClassesController) HandleGet

func (c *ClassesController) HandleGet()

HandleGet 处理查询指定对象请求,返回查询到的对象 @router /:className/:objectId [get]

func (*ClassesController) HandleUpdate

func (c *ClassesController) HandleUpdate()

HandleUpdate 处理更新指定对象请求 @router /:className/:objectId [put]

func (*ClassesController) Post

func (c *ClassesController) Post()

Post ... @router / [post]

func (*ClassesController) Put

func (c *ClassesController) Put()

Put ... @router / [put]

type CloudCodeController

type CloudCodeController struct {
	ClassesController
}

CloudCodeController ...

func (*CloudCodeController) Delete

func (c *CloudCodeController) Delete()

Delete ... @router / [delete]

func (*CloudCodeController) Get

func (c *CloudCodeController) Get()

Get ... @router / [get]

func (*CloudCodeController) HandleGet

func (c *CloudCodeController) HandleGet()

HandleGet ... @router /jobs [get]

func (*CloudCodeController) Post

func (c *CloudCodeController) Post()

Post ... @router / [post]

func (*CloudCodeController) Put

func (c *CloudCodeController) Put()

Put ... @router / [put]

type ErrorController

type ErrorController struct {
	beego.Controller
}

ErrorController ...

func (*ErrorController) Error404

func (e *ErrorController) Error404()

Error404 ...

func (*ErrorController) Error405

func (e *ErrorController) Error405()

Error405 ...

func (*ErrorController) Error501

func (e *ErrorController) Error501()

Error501 ...

type FeaturesController

type FeaturesController struct {
	ClassesController
}

FeaturesController ...

func (*FeaturesController) Delete

func (f *FeaturesController) Delete()

Delete ... @router / [delete]

func (*FeaturesController) HandleGet

func (f *FeaturesController) HandleGet()

HandleGet ... @router / [get]

func (*FeaturesController) Post

func (f *FeaturesController) Post()

Post ... @router / [post]

func (*FeaturesController) Put

func (f *FeaturesController) Put()

Put ... @router / [put]

type FilesController

type FilesController struct {
	ClassesController
}

FilesController 处理 /files 接口的请求

func (*FilesController) Delete

func (f *FilesController) Delete()

Delete ... @router / [delete]

func (*FilesController) Get

func (f *FilesController) Get()

Get ... @router / [get]

func (*FilesController) HandleCreate

func (f *FilesController) HandleCreate()

HandleCreate 处理上传文件请求 @router /:filename [post]

func (*FilesController) HandleDelete

func (f *FilesController) HandleDelete()

HandleDelete 处理删除文件请求 @router /:filename [delete]

func (*FilesController) HandleGet

func (f *FilesController) HandleGet()

HandleGet 处理下载文件请求 @router /:appId/:filename [get]

func (*FilesController) Post

func (f *FilesController) Post()

Post ... @router / [post]

func (*FilesController) Prepare

func (f *FilesController) Prepare()

Prepare ...

func (*FilesController) Put

func (f *FilesController) Put()

Put ... @router / [put]

type FunctionsController

type FunctionsController struct {
	ClassesController
}

FunctionsController 处理 /functions 接口的请求

func (*FunctionsController) Delete

func (f *FunctionsController) Delete()

Delete ... @router / [delete]

func (*FunctionsController) Get

func (f *FunctionsController) Get()

Get ... @router / [get]

func (*FunctionsController) HandleCloudFunction

func (f *FunctionsController) HandleCloudFunction()

HandleCloudFunction 执行指定的云函数 返回数据格式如下:

{
	"result":"func res"
}

@router /:functionName [post]

func (*FunctionsController) Post

func (f *FunctionsController) Post()

Post ... @router / [post]

func (*FunctionsController) Put

func (f *FunctionsController) Put()

Put ... @router / [put]

type GlobalConfigController

type GlobalConfigController struct {
	ClassesController
}

GlobalConfigController 处理 /config 接口的请求

func (*GlobalConfigController) Delete

func (g *GlobalConfigController) Delete()

Delete ... @router / [delete]

func (*GlobalConfigController) HandleGet

func (g *GlobalConfigController) HandleGet()

HandleGet 获取配置信息 @router / [get]

func (*GlobalConfigController) HandlePut

func (g *GlobalConfigController) HandlePut()

HandlePut 修改配置信息 @router / [put]

func (*GlobalConfigController) Post

func (g *GlobalConfigController) Post()

Post ... @router / [post]

func (*GlobalConfigController) Prepare

func (g *GlobalConfigController) Prepare()

Prepare ...

type HealthController

type HealthController struct {
	beego.Controller
}

HealthController 检测服务器健康状态

func (*HealthController) Get

func (h *HealthController) Get()

Get 直接返回状态 200 @router / [get]

type HooksController

type HooksController struct {
	ClassesController
}

HooksController ...

func (*HooksController) Delete

func (h *HooksController) Delete()

Delete ... @router / [delete]

func (*HooksController) Get

func (h *HooksController) Get()

Get ... @router / [get]

func (*HooksController) HandleCreateFunction

func (h *HooksController) HandleCreateFunction()

HandleCreateFunction ... @router /functions [post]

func (*HooksController) HandleCreateTrigger

func (h *HooksController) HandleCreateTrigger()

HandleCreateTrigger ... @router /triggers [post]

func (*HooksController) HandleGetAllFunctions

func (h *HooksController) HandleGetAllFunctions()

HandleGetAllFunctions ... @router /functions [get]

func (*HooksController) HandleGetAllTriggers

func (h *HooksController) HandleGetAllTriggers()

HandleGetAllTriggers ... @router /triggers [get]

func (*HooksController) HandleGetFunction

func (h *HooksController) HandleGetFunction()

HandleGetFunction ... @router /functions/:functionName [get]

func (*HooksController) HandleGetTrigger

func (h *HooksController) HandleGetTrigger()

HandleGetTrigger ... @router /triggers/:className/:triggerName [get]

func (*HooksController) HandleUpdateFunction

func (h *HooksController) HandleUpdateFunction()

HandleUpdateFunction ... @router /functions/:functionName [put]

func (*HooksController) HandleUpdateTrigger

func (h *HooksController) HandleUpdateTrigger()

HandleUpdateTrigger ... @router /triggers/:className/:triggerName [put]

func (*HooksController) Post

func (h *HooksController) Post()

Post ... @router / [post]

func (*HooksController) Prepare

func (h *HooksController) Prepare()

Prepare ...

func (*HooksController) Put

func (h *HooksController) Put()

Put ... @router / [put]

type IAPValidationController

type IAPValidationController struct {
	ClassesController
}

IAPValidationController ...

func (*IAPValidationController) Delete

func (i *IAPValidationController) Delete()

Delete ... @router / [delete]

func (*IAPValidationController) Get

func (i *IAPValidationController) Get()

Get ... @router / [get]

func (*IAPValidationController) HandlePost

func (i *IAPValidationController) HandlePost()

HandlePost ... @router / [post]

func (*IAPValidationController) Put

func (i *IAPValidationController) Put()

Put ... @router / [put]

type InstallationsController

type InstallationsController struct {
	ClassesController
}

InstallationsController 处理 /installations 接口的请求

func (*InstallationsController) Delete

func (i *InstallationsController) Delete()

Delete ... @router / [delete]

func (*InstallationsController) HandleCreate

func (i *InstallationsController) HandleCreate()

HandleCreate 处理添加设备请求 @router / [post]

func (*InstallationsController) HandleDelete

func (i *InstallationsController) HandleDelete()

HandleDelete 处理删除指定设备请求 @router /:objectId [delete]

func (*InstallationsController) HandleFind

func (i *InstallationsController) HandleFind()

HandleFind 处理查找已安装设备请求 @router / [get]

func (*InstallationsController) HandleGet

func (i *InstallationsController) HandleGet()

HandleGet 处理获取指定设备信息请求 @router /:objectId [get]

func (*InstallationsController) HandleUpdate

func (i *InstallationsController) HandleUpdate()

HandleUpdate 处理更新设备信息请求 @router /:objectId [put]

func (*InstallationsController) Put

func (i *InstallationsController) Put()

Put ... @router / [put]

type JobsController

type JobsController struct {
	ClassesController
}

JobsController 处理 /jobs 接口的请求

func (*JobsController) Delete

func (j *JobsController) Delete()

Delete ... @router / [delete]

func (*JobsController) Get

func (j *JobsController) Get()

Get ... @router / [get]

func (*JobsController) HandleCloudJob

func (j *JobsController) HandleCloudJob()

HandleCloudJob 执行后台任务 @router /:jobName [post]

func (*JobsController) HandlePost

func (j *JobsController) HandlePost()

HandlePost ... @router / [post]

func (*JobsController) Put

func (j *JobsController) Put()

Put ... @router / [put]

type LoginController

type LoginController struct {
	ClassesController
}

LoginController 处理 /login 接口的请求

func (*LoginController) Delete

func (l *LoginController) Delete()

Delete ... @router / [delete]

func (*LoginController) HandleLogIn

func (l *LoginController) HandleLogIn()

HandleLogIn 处理登录请求 @router / [get]

func (*LoginController) Post

func (l *LoginController) Post()

Post ... @router / [post]

func (*LoginController) Put

func (l *LoginController) Put()

Put ... @router / [put]

type LogoutController

type LogoutController struct {
	ClassesController
}

LogoutController 处理 /logout 接口的请求

func (*LogoutController) Delete

func (l *LogoutController) Delete()

Delete ... @router / [delete]

func (*LogoutController) Get

func (l *LogoutController) Get()

Get ... @router / [get]

func (*LogoutController) HandleLogOut

func (l *LogoutController) HandleLogOut()

HandleLogOut 处理用户退出请求 @router / [post]

func (*LogoutController) Put

func (l *LogoutController) Put()

Put ... @router / [put]

type LogsController

type LogsController struct {
	ClassesController
}

LogsController ...

func (*LogsController) Delete

func (l *LogsController) Delete()

Delete ... @router / [delete]

func (*LogsController) HandleGet

func (l *LogsController) HandleGet()

HandleGet ... @router / [get]

func (*LogsController) Post

func (l *LogsController) Post()

Post ... @router / [post]

func (*LogsController) Put

func (l *LogsController) Put()

Put ... @router / [put]

type PublicController

type PublicController struct {
	beego.Controller
}

PublicController 处理密码修改与邮箱验证请求

func (*PublicController) ChangePassword

func (p *PublicController) ChangePassword()

ChangePassword 修改密码页面 @router /choose_password [get]

func (p *PublicController) InvalidLink()

InvalidLink 无效链接页面 @router /invalid_link [get]

func (p *PublicController) InvalidVerificationLink()

InvalidVerificationLink 无效验证链接页面 @router /invalid_verification_link [get]

func (*PublicController) LinkSendFail

func (p *PublicController) LinkSendFail()

LinkSendFail 发送失败页面 @router /link_send_fail [get]

func (*PublicController) LinkSendSuccess

func (p *PublicController) LinkSendSuccess()

LinkSendSuccess 发送成功页面 @router /link_send_success [get]

func (*PublicController) PasswordResetSuccess

func (p *PublicController) PasswordResetSuccess()

PasswordResetSuccess 密码重置成功页面 @router /password_reset_success [get]

func (*PublicController) RequestResetPassword

func (p *PublicController) RequestResetPassword()

RequestResetPassword 处理重置密码请求 该接口从重置密码邮件内部发起请求,见 rest.SendPasswordResetEmail() @router /request_password_reset [get]

func (*PublicController) ResendVerificationEmail

func (p *PublicController) ResendVerificationEmail()

ResendVerificationEmail 处理重新发送验证邮件请求 @router /resend_verification_email [post]

func (*PublicController) ResetPassword

func (p *PublicController) ResetPassword()

ResetPassword 处理实际的重置密码请求 @router /request_password_reset [post]

func (*PublicController) VerifyEmail

func (p *PublicController) VerifyEmail()

VerifyEmail 处理验证邮箱请求 该接口从验证邮件内部发起请求,见 rest.SendVerificationEmail() @router /verify_email [get]

func (*PublicController) VerifyEmailSuccess

func (p *PublicController) VerifyEmailSuccess()

VerifyEmailSuccess 验证邮箱成功页面 @router /verify_email_success [get]

type PurgeController

type PurgeController struct {
	ClassesController
}

PurgeController 处理 /purge 接口的请求

func (*PurgeController) Get

func (p *PurgeController) Get()

Get ... @router / [get]

func (*PurgeController) HandleDelete

func (p *PurgeController) HandleDelete()

HandleDelete 处理删除指定类数据请求 @router /:className [delete]

func (*PurgeController) Post

func (p *PurgeController) Post()

Post ... @router / [post]

func (*PurgeController) Put

func (p *PurgeController) Put()

Put ... @router / [put]

type PushController

type PushController struct {
	ClassesController
}

PushController 处理 /push 接口的请求

func (*PushController) Delete

func (p *PushController) Delete()

Delete ... @router / [delete]

func (*PushController) Get

func (p *PushController) Get()

Get ... @router / [get]

func (*PushController) HandlePost

func (p *PushController) HandlePost()

HandlePost 处理发送推送消息请求 @router / [post]

func (*PushController) Put

func (p *PushController) Put()

Put ... @router / [put]

type RequestInfo

type RequestInfo struct {
	AppID          string
	MasterKey      string
	ClientKey      string
	JavaScriptKey  string
	DotNetKey      string
	RestAPIKey     string
	SessionToken   string
	InstallationID string
	ClientVersion  string
	ClientSDK      map[string]string
}

RequestInfo http 请求的权限信息

type ResetController

type ResetController struct {
	ClassesController
}

ResetController 处理 /requestPasswordReset 接口的请求

func (*ResetController) Delete

func (r *ResetController) Delete()

Delete ... @router / [delete]

func (*ResetController) Get

func (r *ResetController) Get()

Get ... @router / [get]

func (*ResetController) HandleResetRequest

func (r *ResetController) HandleResetRequest()

HandleResetRequest 处理通过 email 重置密码的请求 @router / [post]

func (*ResetController) Put

func (r *ResetController) Put()

Put ... @router / [put]

type RolesController

type RolesController struct {
	ClassesController
}

RolesController 处理 /roles 接口的请求

func (*RolesController) Delete

func (r *RolesController) Delete()

Delete ... @router / [delete]

func (*RolesController) HandleCreate

func (r *RolesController) HandleCreate()

HandleCreate 处理创建 role 请求 @router / [post]

func (*RolesController) HandleDelete

func (r *RolesController) HandleDelete()

HandleDelete 处理删除指定 role 请求 @router /:objectId [delete]

func (*RolesController) HandleFind

func (r *RolesController) HandleFind()

HandleFind 处理查找 role 请求 @router / [get]

func (*RolesController) HandleGet

func (r *RolesController) HandleGet()

HandleGet 处理获取指定 role 请求 @router /:objectId [get]

func (*RolesController) HandleUpdate

func (r *RolesController) HandleUpdate()

HandleUpdate 处理更新指定 role 请求 @router /:objectId [put]

func (*RolesController) Put

func (r *RolesController) Put()

Put ... @router / [put]

type SchemasController

type SchemasController struct {
	ClassesController
}

SchemasController 处理 /schemas 接口的请求

func (*SchemasController) Delete

func (s *SchemasController) Delete()

Delete ... @router / [delete]

func (*SchemasController) HandleCreate

func (s *SchemasController) HandleCreate()

HandleCreate 处理创建类请求,同时可匹配 / 的 POST 请求 @router /:className [post]

func (*SchemasController) HandleDelete

func (s *SchemasController) HandleDelete()

HandleDelete 处理删除指定类请求 @router /:className [delete]

func (*SchemasController) HandleFind

func (s *SchemasController) HandleFind()

HandleFind 处理 schema 查找请求 @router / [get]

func (*SchemasController) HandleGet

func (s *SchemasController) HandleGet()

HandleGet 处理查找指定的类请求 @router /:className [get]

func (*SchemasController) HandleUpdate

func (s *SchemasController) HandleUpdate()

HandleUpdate 处理更新类请求 @router /:className [put]

func (*SchemasController) Prepare

func (s *SchemasController) Prepare()

Prepare 访问 /schemas 接口需要 master key

func (*SchemasController) Put

func (s *SchemasController) Put()

Put ... @router / [put]

type SessionsController

type SessionsController struct {
	ClassesController
}

SessionsController 处理 /sessions 接口的请求

func (*SessionsController) Delete

func (s *SessionsController) Delete()

Delete ... @router / [delete]

func (*SessionsController) HandleCreate

func (s *SessionsController) HandleCreate()

HandleCreate 处理 session 创建请求 @router / [post]

func (*SessionsController) HandleDelete

func (s *SessionsController) HandleDelete()

HandleDelete 处理删除指定 session 请求 @router /:objectId [delete]

func (*SessionsController) HandleFind

func (s *SessionsController) HandleFind()

HandleFind 处理查找 session 请求 @router / [get]

func (*SessionsController) HandleGet

func (s *SessionsController) HandleGet()

HandleGet 处理获取指定 session 请求 @router /:objectId [get]

func (*SessionsController) HandleGetMe

func (s *SessionsController) HandleGetMe()

HandleGetMe 处理当前请求 session @router /me [get]

func (*SessionsController) HandleUpdate

func (s *SessionsController) HandleUpdate()

HandleUpdate 处理更新指定 session 请求 @router /:objectId [put]

func (*SessionsController) HandleUpdateMe

func (s *SessionsController) HandleUpdateMe()

HandleUpdateMe 仅用于更新 installationId @router /me [put]

func (*SessionsController) Put

func (s *SessionsController) Put()

Put ... @router / [put]

type UpgradeSessionController

type UpgradeSessionController struct {
	ClassesController
}

UpgradeSessionController 处理 /upgradeToRevocableSession 接口的请求

func (*UpgradeSessionController) Delete

func (u *UpgradeSessionController) Delete()

Delete ... @router / [delete]

func (*UpgradeSessionController) Get

func (u *UpgradeSessionController) Get()

Get ... @router / [get]

func (*UpgradeSessionController) HandleUpdateToRevocableSession

func (u *UpgradeSessionController) HandleUpdateToRevocableSession()

HandleUpdateToRevocableSession ... @router / [post]

func (*UpgradeSessionController) Put

func (u *UpgradeSessionController) Put()

Put ... @router / [put]

type UsersController

type UsersController struct {
	ClassesController
}

UsersController 处理 /users 接口的请求

func (*UsersController) Delete

func (u *UsersController) Delete()

Delete ... @router / [delete]

func (*UsersController) HandleCreate

func (u *UsersController) HandleCreate()

HandleCreate 处理创建用户请求 @router / [post]

func (*UsersController) HandleDelete

func (u *UsersController) HandleDelete()

HandleDelete 处理删除用户请求 过滤对 /me 接口的 delete 请求 @router /:objectId [delete]

func (*UsersController) HandleFind

func (u *UsersController) HandleFind()

HandleFind 处理查找用户请求 @router / [get]

func (*UsersController) HandleGet

func (u *UsersController) HandleGet()

HandleGet 处理查找指定用户请求 @router /:objectId [get]

func (*UsersController) HandleMe

func (u *UsersController) HandleMe()

HandleMe 处理获取当前用户信息的请求 @router /me [get]

func (*UsersController) HandleUpdate

func (u *UsersController) HandleUpdate()

HandleUpdate 处理更新用户信息请求 过滤对 /me 接口的 put 请求 @router /:objectId [put]

func (*UsersController) Put

func (u *UsersController) Put()

Put ... @router / [put]

type VerificationController

type VerificationController struct {
	ClassesController
}

VerificationController 处理 /verificationEmailRequest 接口的请求

func (*VerificationController) Delete

func (r *VerificationController) Delete()

Delete ... @router / [delete]

func (*VerificationController) Get

func (r *VerificationController) Get()

Get ... @router / [get]

func (*VerificationController) HandleVerificationEmailRequest

func (r *VerificationController) HandleVerificationEmailRequest()

HandleVerificationEmailRequest 处理 email 验证的请求 @router / [post]

func (*VerificationController) Put

func (r *VerificationController) Put()

Put ... @router / [put]

Jump to

Keyboard shortcuts

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