mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-10 07:42:26 +08:00
补全 golint (#322)
This commit is contained in:
@@ -51,3 +51,11 @@ linters-settings:
|
|||||||
funlen:
|
funlen:
|
||||||
lines: 66
|
lines: 66
|
||||||
statements: 40
|
statements: 40
|
||||||
|
|
||||||
|
issues:
|
||||||
|
include:
|
||||||
|
- EXC0002 # disable excluding of issues about comments from golint
|
||||||
|
exclude-rules:
|
||||||
|
- linters:
|
||||||
|
- stylecheck
|
||||||
|
text: "ST1000:"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//Package config 小程序config配置
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ type DataItem struct {
|
|||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TemplateItem template item
|
||||||
type TemplateItem struct {
|
type TemplateItem struct {
|
||||||
PriTmplID string `json:"priTmplId"`
|
PriTmplID string `json:"priTmplId"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
@@ -50,6 +51,7 @@ type TemplateItem struct {
|
|||||||
Type int64 `json:"type"`
|
Type int64 `json:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TemplateList template list
|
||||||
type TemplateList struct {
|
type TemplateList struct {
|
||||||
util.CommonError
|
util.CommonError
|
||||||
Data []TemplateItem `json:"data"`
|
Data []TemplateItem `json:"data"`
|
||||||
@@ -70,7 +72,7 @@ func (s *Subscribe) Send(msg *Message) (err error) {
|
|||||||
return util.DecodeWithCommonError(response, "Send")
|
return util.DecodeWithCommonError(response, "Send")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前帐号下的个人模板列表
|
//ListTemplates 获取当前帐号下的个人模板列表
|
||||||
// https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getTemplateList.html
|
// https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getTemplateList.html
|
||||||
func (s *Subscribe) ListTemplates() (*TemplateList, error) {
|
func (s *Subscribe) ListTemplates() (*TemplateList, error) {
|
||||||
accessToken, err := s.GetAccessToken()
|
accessToken, err := s.GetAccessToken()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//Package device 设备相关接口
|
||||||
package device
|
package device
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ func (user *User) GetTag() (tags []*TagInfo, err error) {
|
|||||||
return result.Tags, nil
|
return result.Tags, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//OpenidListByTag 获取标签下粉丝列表
|
//OpenIDListByTag 获取标签下粉丝列表
|
||||||
func (user *User) OpenIDListByTag(tagID int32, nextOpenID ...string) (userList *TagOpenIDList, err error) {
|
func (user *User) OpenIDListByTag(tagID int32, nextOpenID ...string) (userList *TagOpenIDList, err error) {
|
||||||
accessToken, err := user.GetAccessToken()
|
accessToken, err := user.GetAccessToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//Package context 开放平台相关context
|
||||||
package context
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package util
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
//GetCurrTs return current timestamps
|
//GetCurrTS return current timestamps
|
||||||
func GetCurrTS() int64 {
|
func GetCurrTS() int64 {
|
||||||
return time.Now().Unix()
|
return time.Now().Unix()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user