Skip to content

Commit

Permalink
小程序消息推送 (silenceper#713)
Browse files Browse the repository at this point in the history
* 小程序消息推送

* fix lint errors

* fix lint

* fix lint

* fix lint,

* 简化写法

* fix 简化写法

* fix name in comments

* add events

* change GoodsInfo type

* change statements to 50

* 追加xml支持

* fix cl lint
  • Loading branch information
ccfish86 authored Aug 27, 2023
1 parent e02af1d commit dea33e0
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ issues:
linters-settings:
funlen:
lines: 66
statements: 40
statements: 50

#issues:
# include:
Expand Down
12 changes: 7 additions & 5 deletions miniprogram/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import (

// Config .config for 小程序
type Config struct {
AppID string `json:"app_id"` // appid
AppSecret string `json:"app_secret"` // appSecret
AppKey string `json:"app_key"` // appKey
OfferID string `json:"offer_id"` // offerId
Cache cache.Cache
AppID string `json:"app_id"` // appid
AppSecret string `json:"app_secret"` // appSecret
AppKey string `json:"app_key"` // appKey
OfferID string `json:"offer_id"` // offerId
Token string `json:"token"` // token
EncodingAESKey string `json:"encoding_aes_key"` // EncodingAESKey
Cache cache.Cache
}
6 changes: 6 additions & 0 deletions miniprogram/message/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const (
MsgTypeLink = "link"
// MsgTypeMiniProgramPage 小程序卡片
MsgTypeMiniProgramPage = "miniprogrampage"
// MsgTypeEvent 事件
MsgTypeEvent MsgType = "event"
// DataTypeXML XML格式数据
DataTypeXML = "xml"
// DataTypeJSON JSON格式数据
DataTypeJSON = "json"
)

// CommonToken 消息中通用的结构
Expand Down
Loading

0 comments on commit dea33e0

Please sign in to comment.