Commit 9bdc80db by Francis Zhou

update yard method annoations

parent bb3cf887
# Dingtalk
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dingtalk`. To experiment with that code, run `bin/console` for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
# Dingtalk-SDK
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'dingtalk'
gem 'dingtalk-sdk'
```
And then execute:
......
......@@ -7,6 +7,8 @@ module Dingtalk
# 获取 access_token
# {https://ding-doc.dingtalk.com/doc#/serverapi2/eev437}
# @!method get_access_token(appkey:, appsecret:)
# @return [Hash]
add_request :get_access_token, :get, Dingtalk::RequestUrl::ACCESS_TOKEN do |request|
request.add_const :appkey, ->(r) { r.app_key }, in: :query
request.add_const :appsecret, ->(r) { r.app_secret }, in: :query
......
......@@ -8,6 +8,8 @@ module Dingtalk
# 企业内部应用免登录 用户ID获取
# {https://ding-doc.dingtalk.com/doc#/serverapi2/clotub}
# @!method get_int_login_free_user_id(:code, :access_token)
# @return [Hash]
add_request :get_int_login_free_user_id, :get, Dingtalk::RequestUrl::INT_LOGIN_FREE_GET_USER_INFO do |request|
request.add_arg :code, required: true, in: :query
request.add_arg :access_token, required: true, in: :query
......@@ -29,6 +31,8 @@ module Dingtalk
# 钉钉内免登录第三方网站 个人信息获取
# {https://ding-doc.dingtalk.com/doc#/serverapi2/etaarr}
# @!method get_3rd_login_free_user_profile(accessKey:, timestamp:, signature:, tmp_auth_code:)
# @return [Hash]
add_request :get_3rd_login_free_user_profile, :post, Dingtalk::RequestUrl::GET_USER_INFO_SNS do |request|
request.format = :json
......
......@@ -7,6 +7,8 @@ module Dingtalk
# 发送工作通知消息
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy}
# @!method send_corp_conversation(userid_list:, dept_id_list:, to_all_user:, msg:, access_token:)
# @return [Hash]
add_request :send_corp_conversation, :post, Dingtalk::RequestUrl::SEND_CORP_CONVERSATION do |request|
request.add_arg :userid_list, in: :body
request.add_arg :dept_id_list, in: :body
......@@ -20,6 +22,8 @@ module Dingtalk
# 查询工作通知消息的发送进度
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/e2262dad}
# @!method get_corp_conversation_progress(task_id:, access_token:)
# @return [Hash]
add_request :get_corp_conversation_progress, :post, Dingtalk::RequestUrl::CORP_CONVERSATION_SEND_PROGRESS do |request|
request.add_arg :task_id, in: :body, required: true
......@@ -30,6 +34,8 @@ module Dingtalk
# 查询工作通知消息的发送结果
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/a5920210}
# @!method get_corp_conversation_result(task_id:, access_token:)
# @return [Hash]
add_request :get_corp_conversation_result, :post, Dingtalk::RequestUrl::CORP_CONVERSATION_SEND_RESULT do |request|
request.add_arg :task_id, in: :body, required: true
......@@ -40,6 +46,8 @@ module Dingtalk
# 工作通知消息撤回
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/hYyV8}
# @!method recall_corp_conversation(msg_task_id:, access_token:)
# @return [Hash]
add_request :recall_corp_conversation, :post, Dingtalk::RequestUrl::RECALL_CORP_CONVERSATION do |request|
request.add_arg :msg_task_id, in: :body, required: true
......
......@@ -7,6 +7,8 @@ module Dingtalk
# 获取部门列表
# {https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/e6e1604e}
# @!method get_department_list(id:, fetch_child:, access_token:)
# @return [Hash]
add_request :get_department_list, :get, Dingtalk::RequestUrl::GET_DEPARTMENT_LIST do |request|
request.add_arg :id, in: :query # 父部门id(如果不传,默认部门为根部门,根部门ID为1)
request.add_arg :fetch_child, in: :query # 是否递归部门的全部子部门
......@@ -15,6 +17,8 @@ module Dingtalk
# 获取部门详情
# {https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/5bf960de}
# @!method get_department_profile(id:, access_token:)
# @return [Hash]
add_request :get_department_profile, :get, Dingtalk::RequestUrl::GET_DEPARTMENT_PROFILE do |request|
request.add_arg :id, in: :query, required: true
request.add_arg :access_token, in: :query, required: true
......
......@@ -7,6 +7,8 @@ module Dingtalk
# 上传媒体文件
# {https://ding-doc.dingtalk.com/doc#/serverapi2/bcmg0i/08d5a73b}
# @!method upload_media(type:, access_token:, media:)
# @return [Hash]
add_request :upload_media, :post, Dingtalk::RequestUrl::UPLOAD_MEDIA_FILE do |request|
request.add_arg :type, in: query, required: true
request.add_arg :access_token, in: :query, required: true
......
......@@ -7,6 +7,8 @@ module Dingtalk
# 获取用户详情
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/AaRQe}
# @!method get_user_profile(userid:, access_token:)
# @return [Hash]
add_request :get_user_profile, :get, Dingtalk::RequestUrl::GET_USER_PROFILE do |request|
request.add_arg :userid, required: true, in: :query
request.add_arg :access_token, required: true, in: :query
......@@ -14,6 +16,8 @@ module Dingtalk
# 根据 unionId 获取 userId
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/602f4b15}
# @!method get_userid_by_unionid(unionid:, access_token:)
# @return [Hash]
add_request :get_userid_by_unionid, :get, Dingtalk::RequestUrl::GET_USERID_FROM_UNIONID do |request|
request.add_arg :unionid, required: true, in: :query
request.add_arg :access_token, required: true, in: :query
......@@ -21,6 +25,8 @@ module Dingtalk
# 根据手机号获取 userId
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/soV11}
# @!method get_userid_by_mobile(mobile:, access_token:)
# @return [Hash]
add_request :get_userid_by_mobile, :get, Dingtalk::RequestUrl::GET_USERID_FROM_MOBILE do |request|
request.add_arg :mobile, required: true, in: :query
request.add_arg :access_token, required: true, in: :query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment