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:新增JS-SDK使用权限签名 #796

Open
wants to merge 32 commits into
base: v2
Choose a base branch
from
Open

feat:新增JS-SDK使用权限签名 #796

wants to merge 32 commits into from

Conversation

hb1707
Copy link

@hb1707 hb1707 commented Sep 27, 2024

hb and others added 23 commits October 28, 2021 14:21
# Conflicts:
#	work/externalcontact/client.go
#	work/oauth/oauth.go
#	work/work.go
# Conflicts:
#	work/externalcontact/user.go
# Conflicts:
#	work/message/client.go
#	work/message/message.go
#	work/oauth/oauth.go
#	work/work.go
func (js *Js) GetAgentConfig(uri string) (config *Config, err error) {
config = new(Config)
var accessToken string
accessToken, err = js.GetAccessToken()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

73,74合并处理,下面的78,79也是一样,以及83-86 是不是可以合并定义呢?

Copy link
Collaborator

@houseme houseme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢

// GetAgentConfig 获取jssdk需要的配置参数
// uri 为当前网页地址
func (js *Js) GetAgentConfig(uri string) (config *Config, err error) {
config = new(Config)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议 Config 对象在使用时在创建,如在88行之前创建。GetConfig 方法也是同样建议

hb1707 and others added 2 commits November 15, 2024 11:07
feat:新增企业微信消息推送接收和发送
wind added 2 commits November 15, 2024 11:44
# Conflicts:
#	credential/work_js_ticket.go
#	work/js/js.go
#	work/message/reply.go
#	work/server/error.go
#	work/server/server.go
#	work/server/util.go
Copy link
Collaborator

@houseme houseme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix golangci-lint action prompt @hb1707 ,thanks

"github.com/silenceper/wechat/v2/miniprogram/context"
"strings"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里strings应该紧跟在fmt 后面,以及第10行的空格不要删除

@@ -16,3 +17,16 @@ func Signature(params ...string) string {
}
return fmt.Sprintf("%x", h.Sum(nil))
}

func CalSignature(params ...string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

公共方法需要有注释说明

import (
"encoding/json"
"fmt"
"github.com/silenceper/wechat/v2/util"
Copy link
Collaborator

@houseme houseme Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import是按组引入,比如系统包一组,第三方一组,自己的一组,中间用空行分隔

Signature string `json:"signature"`
}

//NewJs init
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释标准是 // 斜杠后面加一个空格之后,再添加方法名称 以及在具体说明

import (
"encoding/json"
"fmt"
"github.com/silenceper/wechat/v2/util"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按组引入

"github.com/silenceper/wechat/v2/work/context"
"github.com/silenceper/wechat/v2/work/message"
log "github.com/sirupsen/logrus"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个15空行建议删除

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants