Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optimized-error-handling&remove unused constant #772

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: optimized-error-handling
  • Loading branch information
markwang1992 committed Mar 15, 2024
commit ea684369a9f0005d27bbcaba120115bdead8802c
2 changes: 2 additions & 0 deletions miniprogram/privacy/privacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const (

// PrivacyV1 用户隐私保护指引的版本,1表示现网版本。
PrivacyV1 = 1
// PrivacyV2 2表示开发版。默认是2开发版。
PrivacyV2 = 2
)

// GetPrivacySettingResponse 获取权限配置的响应结果
Expand Down
20 changes: 20 additions & 0 deletions miniprogram/security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,29 @@ func (security *Security) ImageCheckV1(filename string) (err error) {
// CheckSuggest 检查建议
type CheckSuggest string

const (
// CheckSuggestRisky 违规风险建议
CheckSuggestRisky CheckSuggest = "risky"
// CheckSuggestPass 安全
CheckSuggestPass CheckSuggest = "pass"
// CheckSuggestReview 需要审查
CheckSuggestReview CheckSuggest = "review"
)

// MsgScene 文本场景
type MsgScene uint8

const (
// MsgSceneMaterial 资料文件检查场景
MsgSceneMaterial MsgScene = iota + 1
// MsgSceneComment 评论
MsgSceneComment
// MsgSceneForum 论坛
MsgSceneForum
// MsgSceneSocialLog 社交日志
MsgSceneSocialLog
)

// CheckLabel 检查命中标签
type CheckLabel int

Expand Down
8 changes: 8 additions & 0 deletions miniprogram/urllink/urllink.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ const generateURL = "https://api.weixin.qq.com/wxa/generate_urllink"
// TExpireType 失效类型 (指定时间戳/指定间隔)
type TExpireType int

const (
// ExpireTypeTime 指定时间戳后失效
ExpireTypeTime TExpireType = 0

// ExpireTypeInterval 间隔指定天数后失效
ExpireTypeInterval TExpireType = 1
)

// ULParams 请求参数
// https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html#请求参数
type ULParams struct {
Expand Down
14 changes: 14 additions & 0 deletions miniprogram/urlscheme/urlscheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ type TExpireType int
// EnvVersion 要打开的小程序版本
type EnvVersion string

const (
// ExpireTypeTime 指定时间戳后失效
ExpireTypeTime TExpireType = 0
// ExpireTypeInterval 间隔指定天数后失效
ExpireTypeInterval TExpireType = 1

// EnvVersionRelease 正式版为"release"
EnvVersionRelease EnvVersion = "release"
// EnvVersionTrial 体验版为"trial"
EnvVersionTrial EnvVersion = "trial"
// EnvVersionDevelop 开发版为"develop"
EnvVersionDevelop EnvVersion = "develop"
)

// JumpWxa 跳转到的目标小程序信息
type JumpWxa struct {
Path string `json:"path"`
Expand Down
7 changes: 7 additions & 0 deletions officialaccount/customerservice/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ const (
customerServiceTypingURL = "https://api.weixin.qq.com/cgi-bin/message/custom/typing"
)

const (
// Typing 表示正在输入状态
Typing TypingStatus = "Typing"
// CancelTyping 表示取消正在输入状态
CancelTyping TypingStatus = "CancelTyping"
)

// Manager 客服管理者,可以管理客服
type Manager struct {
*context.Context
Expand Down
25 changes: 25 additions & 0 deletions officialaccount/datacube/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@ import (
// AdSlot 广告位类型
type AdSlot string

const (
// SlotIDBizBottom 公众号底部广告
SlotIDBizBottom AdSlot = "SLOT_ID_BIZ_BOTTOM"
// SlotIDBizMidContext 公众号文中广告
SlotIDBizMidContext AdSlot = "SLOT_ID_BIZ_MID_CONTEXT"
// SlotIDBizVideoEnd 公众号视频后贴
SlotIDBizVideoEnd AdSlot = "SLOT_ID_BIZ_VIDEO_END"
// SlotIDBizSponsor 公众号互选广告
SlotIDBizSponsor AdSlot = "SLOT_ID_BIZ_SPONSOR"
// SlotIDBizCps 公众号返佣商品
SlotIDBizCps AdSlot = "SLOT_ID_BIZ_CPS"
// SlotIDWeappBanner 小程序banner
SlotIDWeappBanner AdSlot = "SLOT_ID_WEAPP_BANNER"
// SlotIDWeappRewardVideo 小程序激励视频
SlotIDWeappRewardVideo AdSlot = "SLOT_ID_WEAPP_REWARD_VIDEO"
// SlotIDWeappInterstitial 小程序插屏广告
SlotIDWeappInterstitial AdSlot = "SLOT_ID_WEAPP_INTERSTITIAL"
// SlotIDWeappVideoFeeds 小程序视频广告
SlotIDWeappVideoFeeds AdSlot = "SLOT_ID_WEAPP_VIDEO_FEEDS"
// SlotIDWeappVideoBegin 小程序视频前贴
SlotIDWeappVideoBegin AdSlot = "SLOT_ID_WEAPP_VIDEO_BEGIN"
// SlotIDWeappBox 小程序格子广告
SlotIDWeappBox AdSlot = "SLOT_ID_WEAPP_BOX"
)

const (
publisherURL = "https://api.weixin.qq.com/publisher/stat"
)
Expand Down
17 changes: 17 additions & 0 deletions officialaccount/freepublish/freepublish.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ const (
// PublishStatus 发布状态
type PublishStatus uint

const (
// PublishStatusSuccess 0:成功
PublishStatusSuccess PublishStatus = iota
// PublishStatusPublishing 1:发布中
PublishStatusPublishing
// PublishStatusOriginalFail 2:原创失败
PublishStatusOriginalFail
// PublishStatusFail 3:常规失败
PublishStatusFail
// PublishStatusAuditRefused 4:平台审核不通过
PublishStatusAuditRefused
// PublishStatusUserDeleted 5:成功后用户删除所有文章
PublishStatusUserDeleted
// PublishStatusSystemBanned 6:成功后系统封禁所有文章
PublishStatusSystemBanned
)

// FreePublish 发布能力
type FreePublish struct {
*context.Context
Expand Down
Loading