Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
85a2b359
Commit
85a2b359
authored
Feb 03, 2015
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设置用户备注名API
parent
d3e28ff1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
lib/weixin_authorize/api/user.rb
+18
-0
spec/api/user_spec.rb
+5
-0
No files found.
lib/weixin_authorize/api/user.rb
View file @
85a2b359
...
@@ -18,6 +18,24 @@ module WeixinAuthorize
...
@@ -18,6 +18,24 @@ module WeixinAuthorize
http_get
(
followers_url
,
{
next_openid:
next_openid
})
http_get
(
followers_url
,
{
next_openid:
next_openid
})
end
end
# 设置备注名
# http请求方式: POST(请使用https协议)
# https://api.weixin.qq.com/cgi-bin/user/info/updateremark?access_token=ACCESS_TOKEN
# POST数据格式:JSON
# POST数据例子:
# {
# "openid":"oDF3iY9ffA-hqb2vVvbr7qxf6A0Q",
# "remark":"pangzi"
# }
def
update_remark
(
openid
,
remark
)
update_url
=
"/user/info/updateremark"
payload
=
{
openid:
openid
,
remark:
remark
}
http_post
(
update_url
,
payload
)
end
private
private
def
user_base_url
def
user_base_url
...
...
spec/api/user_spec.rb
View file @
85a2b359
...
@@ -20,4 +20,9 @@ describe WeixinAuthorize::Api::User do
...
@@ -20,4 +20,9 @@ describe WeixinAuthorize::Api::User do
expect
(
followers
.
code
).
to
eq
(
WeixinAuthorize
::
OK_CODE
)
expect
(
followers
.
code
).
to
eq
(
WeixinAuthorize
::
OK_CODE
)
expect
(
followers
.
result
.
keys
).
to
eq
([
"total"
,
"count"
,
"data"
,
"next_openid"
])
expect
(
followers
.
result
.
keys
).
to
eq
([
"total"
,
"count"
,
"data"
,
"next_openid"
])
end
end
it
"can update user remark"
do
user_info
=
$client
.
update_remark
(
ENV
[
"OPENID"
],
"dylan"
)
expect
(
user_info
.
code
).
to
eq
(
WeixinAuthorize
::
OK_CODE
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment