openplatform

package
v0.0.0-...-15a7b9f Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppID          string `json:"app_id"`           //app_id
	AppSecret      string `json:"app_secret"`       //app_secret
	Token          string `json:"token"`            //token
	EncodingAESKey string `json:"encoding_aes_key"` //encoding aes key
	Cache          *gcache.Cache
	Logger         *log.Logger
}

type Credentials

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

func (*Credentials) Get

func (c *Credentials) Get() map[string]string

type MiniProgram

type MiniProgram struct {
	*miniprogram.MiniProgram
	RefreshToken string // 刷新token
	Component    *OpenPlatform
}

MiniProgram

func (*MiniProgram) BindTester

func (mp *MiniProgram) BindTester(wechatId string) *http.ResponseData

绑定微信用户为体验者

func (*MiniProgram) ChangeSearchStatus

func (mp *MiniProgram) ChangeSearchStatus(status int) *http.ResponseData

修改隐私设置 通过本接口修改小程序隐私设置,即修改是否可被搜索 @param status int 1 表示不可搜索,0 表示可搜索

func (*MiniProgram) ChangeVisitStatus

func (mp *MiniProgram) ChangeVisitStatus(action string) *http.ResponseData

修改小程序服务状态 action: 'open'/'close';

func (*MiniProgram) GetAuditStatus

func (mp *MiniProgram) GetAuditStatus(auditId string) *http.ResponseData

查询指定发布审核单的审核状态

func (*MiniProgram) GetBasicInfo

func (mp *MiniProgram) GetBasicInfo() *http.ResponseData

获取基本信息

func (*MiniProgram) GetGrayRelease

func (mp *MiniProgram) GetGrayRelease() *http.ResponseData

查询当前分阶段发布详情

func (*MiniProgram) GetLatestAuditStatus

func (mp *MiniProgram) GetLatestAuditStatus() *http.ResponseData

查询最新一次提交的审核状态

func (*MiniProgram) GetPage

func (mp *MiniProgram) GetPage() *http.ResponseData

获取已上传的代码的页面列表 @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/get_page.html

func (*MiniProgram) GetRevertReleaseHistory

func (mp *MiniProgram) GetRevertReleaseHistory() *http.ResponseData

获取可回退的小程序版本

func (*MiniProgram) GetSearchStatus

func (mp *MiniProgram) GetSearchStatus() *http.ResponseData

查询隐私设置 通过本接口可以查询小程序当前的隐私设置,即是否可被搜索。

func (*MiniProgram) GetSupportVersion

func (mp *MiniProgram) GetSupportVersion() *http.ResponseData

查询当前设置的最低基础库版本及各版本用户占比

func (*MiniProgram) GetTesters

func (mp *MiniProgram) GetTesters() *http.ResponseData

获取体验者列表 通过本接口可以获取小程序所有已绑定的体验者列表

func (*MiniProgram) GrayRelease

func (mp *MiniProgram) GrayRelease(grayPercentage int) *http.ResponseData

分阶段发布

func (*MiniProgram) QueryNickName

func (mp *MiniProgram) QueryNickName(audit string) *http.ResponseData

查询改名审核状态

func (*MiniProgram) QueryQuota

func (mp *MiniProgram) QueryQuota() *http.ResponseData

查询服务商的当月提审限额(quota)和加急次数

func (*MiniProgram) Release

func (mp *MiniProgram) Release() *http.ResponseData

发布已通过审核的小程序 @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/release.html 注:post的data为空,不等于不需要传data,否则会报错【errcode: 44002 "errmsg": "empty post data"】

func (*MiniProgram) RevertGrayRelease

func (mp *MiniProgram) RevertGrayRelease() *http.ResponseData

取消分阶段发布

func (*MiniProgram) Session

func (mp *MiniProgram) Session(code string) *http.ResponseData

小程序登录

func (*MiniProgram) SetNickName

func (mp *MiniProgram) SetNickName(nickname string, config ...g.Map) *http.ResponseData

设置名称 注意事项 @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/setnickname.html

func (*MiniProgram) SetSignature

func (mp *MiniProgram) SetSignature(signature string) *http.ResponseData

修改简介

func (*MiniProgram) SetSupoortVersion

func (mp *MiniProgram) SetSupoortVersion(version string) *http.ResponseData

设置最低基础库版本

func (*MiniProgram) SetWebviewDomain

func (mp *MiniProgram) SetWebviewDomain(action string, domain ...g.Slice) *http.ResponseData

设置业务域名

func (*MiniProgram) SpeedupAudit

func (mp *MiniProgram) SpeedupAudit(auditId int) *http.ResponseData

加急审核

func (*MiniProgram) SubmitAudit

func (mp *MiniProgram) SubmitAudit(config ...g.Map) *http.ResponseData

提交审核 config 参数具体查看 @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/code/submit_audit.html

func (*MiniProgram) UnbindTester

func (mp *MiniProgram) UnbindTester(tester g.Map) *http.ResponseData

解除绑定体验者 userstr 和 wechatid 填写其中一个即可: g.Map{"userstr":"xxxx"} 或 g.Map{"wechatid":"xxxx"}

func (*MiniProgram) UndoCodeAudit

func (mp *MiniProgram) UndoCodeAudit() *http.ResponseData

func (*MiniProgram) UpdateAvatar

func (mp *MiniProgram) UpdateAvatar(config g.Map) *http.ResponseData

修改头像 @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/modifyheadimage.html 注意事项,及config需要配置参数查看官方说明文档

func (*MiniProgram) VerifyNickname

func (mp *MiniProgram) VerifyNickname(nickname string) *http.ResponseData

微信认证名称检测 @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/wxverify_checknickname.html 注:该接口只允许通过api创建的小程序使用。

type MiniProgramCredentials

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

func (*MiniProgramCredentials) Get

func (c *MiniProgramCredentials) Get() map[string]string

type OpenPlatform

type OpenPlatform struct {
	Logger *log.Logger
	Cache  *gcache.Cache
	// contains filtered or unexported fields
}

OpenPlatform

func New

func New(config Config) *OpenPlatform

New new OpenPlatform @see glog https://goframe.org/os/glog/index

func (*OpenPlatform) ConfigLoggerWithMap

func (op *OpenPlatform) ConfigLoggerWithMap(m map[string]interface{})

logger -------------

func (*OpenPlatform) FastRegisterBetaWeapp

func (op *OpenPlatform) FastRegisterBetaWeapp(config map[string]interface{}) *http.ResponseData

体验小程序创建

func (*OpenPlatform) FastRegisterWeapp

func (op *OpenPlatform) FastRegisterWeapp(config map[string]interface{}) *http.ResponseData

通过法人微信快速创建小程序 config参数查看官方文档

func (*OpenPlatform) GetAccessToken

func (op *OpenPlatform) GetAccessToken() string

GetAccessToken

func (*OpenPlatform) GetAuthorizer

func (op *OpenPlatform) GetAuthorizer(appid string) *http.ResponseData

GetAuthorizer get authorizer info type as gjson.Json

func (*OpenPlatform) GetAuthorizerOption

func (op *OpenPlatform) GetAuthorizerOption(appid string, name string) *http.ResponseData

GetAuthorizerOption get authorizer option info

func (*OpenPlatform) GetAuthorizers

func (op *OpenPlatform) GetAuthorizers(offset int, count int) *http.ResponseData

GetAuthorizers get authorizer list

func (*OpenPlatform) GetLogPath

func (op *OpenPlatform) GetLogPath() string

GetLogPath returns the log path.

func (*OpenPlatform) GetMobilePreAuthorizationUrl

func (op *OpenPlatform) GetMobilePreAuthorizationUrl(callback string, optional ...map[string]interface{}) (string, error)

GetMobilePreAuthorizationUrl

func (*OpenPlatform) GetPreAuthCode

func (op *OpenPlatform) GetPreAuthCode() (string, error)

func (*OpenPlatform) GetPreAuthorizationUrl

func (op *OpenPlatform) GetPreAuthorizationUrl(callback string, optional ...map[string]interface{}) (string, error)

GetPreAuthorizationUrl 获取授权页网址

func (*OpenPlatform) GetVerifyTicket

func (op *OpenPlatform) GetVerifyTicket() string

GetVerifyTicket

func (*OpenPlatform) HandleAuthorize

func (op *OpenPlatform) HandleAuthorize(code string) *http.ResponseData

HandleAuthorize

func (*OpenPlatform) IsAccessLogEnabled

func (op *OpenPlatform) IsAccessLogEnabled() bool

IsAccessLogEnabled checks whether the access log enabled.

func (*OpenPlatform) IsErrorLogEnabled

func (op *OpenPlatform) IsErrorLogEnabled() bool

IsErrorLogEnabled checks whether the error log enabled.

func (*OpenPlatform) MiniProgram

func (op *OpenPlatform) MiniProgram(appid string, refreshToken string) *MiniProgram

MiniProgram

func (*OpenPlatform) Server

func (op *OpenPlatform) Server(request *http.Request, writer http.ResponseWriter) *server.Server

Server

func (*OpenPlatform) SetAccessLogEnabled

func (op *OpenPlatform) SetAccessLogEnabled(enabled bool)

SetAccessLogEnabled enables/disables the access log.

func (*OpenPlatform) SetAccessToken

func (op *OpenPlatform) SetAccessToken(token baseauth.AccessToken)

SetAccessToken 设置的需要满足接口

func (*OpenPlatform) SetAuthorizerOption

func (op *OpenPlatform) SetAuthorizerOption(appid string, name string, value string) *http.ResponseData

SetAuthorizerOption set authorizer option

func (*OpenPlatform) SetCache

func (op *OpenPlatform) SetCache(c *gcache.Cache)

SetCache

func (*OpenPlatform) SetErrorLogEnabled

func (op *OpenPlatform) SetErrorLogEnabled(enabled bool)

SetErrorLogEnabled enables/disables the error log.

func (*OpenPlatform) SetErrorStack

func (op *OpenPlatform) SetErrorStack(enabled bool)

SetErrorStack enables/disables the error stack feature.

func (*OpenPlatform) SetLogStdout

func (op *OpenPlatform) SetLogStdout(enabled bool)

SetLogStdout sets whether output the logging content to stdout.

func (*OpenPlatform) SetVerifyTicket

func (op *OpenPlatform) SetVerifyTicket(ticket auth.VerifyTicket)

SetVrifyTicket 需要自定义解决ticket的存储及获取问题时需要设置满足相关接口的对象

func (*OpenPlatform) StartPushTicket

func (op *OpenPlatform) StartPushTicket() *http.ResponseData

StartPushTicket 启动ticket推送服务

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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