Commit 052bf90f by Francis Zhou

根据 yard 修改注释中的链接

parent 457a1329
......@@ -43,7 +43,7 @@ module Dingtalk
class << self
# 个人免登录场景的签名计算
# @url https://ding-doc.dingtalk.com/doc#/faquestions/hxs5v9
# {https://ding-doc.dingtalk.com/doc#/faquestions/hxs5v9}
# timestamp 用于计算的时间戳 如果不提供,表示当前时间
# url_encode 是否对最终结果进行 rfc2396 转义
def login_free_signature(app_secret, options = {})
......
......@@ -6,7 +6,7 @@ module Dingtalk
extend Dingtalk::Core
# 获取 access_token
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/eev437
# {https://ding-doc.dingtalk.com/doc#/serverapi2/eev437}
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
......
......@@ -7,14 +7,14 @@ module Dingtalk
extend Dingtalk::Core
# 企业内部应用免登录 用户ID获取
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/clotub
# {https://ding-doc.dingtalk.com/doc#/serverapi2/clotub}
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
end
# 生成扫码登录跳转地址
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/kymkv6
# {https://ding-doc.dingtalk.com/doc#/serverapi2/kymkv6}
def get_qr_connect_uri(redirect_uri, state = "")
qs = {}.tap do |h|
h[:appid] = @app_key
......@@ -28,7 +28,7 @@ module Dingtalk
end
# 钉钉内免登录第三方网站 个人信息获取
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/etaarr
# {https://ding-doc.dingtalk.com/doc#/serverapi2/etaarr}
add_request :get_3rd_login_free_user_profile, :post, Dingtalk::RequestUrl::GET_USER_INFO_SNS do |request|
request.format = :json
......
......@@ -6,7 +6,7 @@ module Dingtalk
extend Dingtalk::Core
# 发送工作通知消息
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy}
add_request :send_corp_conversation, :post, SEND_CORP_CONVERSATION do |request|
request.add_arg :agent_id, in: :body, required: true
request.add_arg :userid_list, in: :body
......@@ -18,7 +18,7 @@ module Dingtalk
end
# 查询工作通知消息的发送进度
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/e2262dad
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/e2262dad}
add_request :get_corp_conversation_progress, :post, CORP_CONVERSATION_SEND_PROGRESS do |request|
request.add_arg :agent_id, in: :body, required: true
request.add_arg :task_id, in: :body, required: true
......@@ -27,7 +27,7 @@ module Dingtalk
end
# 查询工作通知消息的发送结果
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/a5920210
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/a5920210}
add_request :get_corp_conversation_result, :post, CORP_CONVERSATION_SEND_RESULT do |request|
request.add_arg :agent_id, in: :body, required: true
request.add_arg :task_id, in: :body, required: true
......@@ -36,7 +36,7 @@ module Dingtalk
end
# 工作通知消息撤回
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/hYyV8
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/hYyV8}
add_request :recall_corp_conversation, :post, RECALL_CORP_CONVERSATION do |request|
request.add_arg :agent_id, in: :body, required: true
request.add_arg :msg_task_id, in: :body, required: true
......
......@@ -6,7 +6,7 @@ module Dingtalk
extend Dingtalk::Core
# 获取部门列表
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/e6e1604e
# {https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/e6e1604e}
add_request :get_department_list, :get, RequestUrl::GET_DEPARTMENT_LIST do |request|
request.add_arg :id, in: :query # 父部门id(如果不传,默认部门为根部门,根部门ID为1)
request.add_arg :fetch_child, in: :query # 是否递归部门的全部子部门
......@@ -14,7 +14,7 @@ module Dingtalk
end
# 获取部门详情
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/5bf960de
# {https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/5bf960de}
add_request :get_department_profile, :get, RequestUrl::GET_DEPARTMENT_PROFILE do |request|
request.add_arg :id, in: :query, required: true
request.add_arg :access_token, in: :query, required: true
......
......@@ -6,55 +6,55 @@ module Dingtalk
ACCESS_TOKEN = "https://oapi.dingtalk.com/gettoken"
# 扫码登录第三方网站 OAuth 跳转地址
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/kymkv6
# {https://ding-doc.dingtalk.com/doc#/serverapi2/kymkv6}
CONNECT_QR_REDIRECT = "https://oapi.dingtalk.com/connect/qrconnect"
# 企业内应用免登录获取用户ID
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/clotub
# {https://ding-doc.dingtalk.com/doc#/serverapi2/clotub}
INT_LOGIN_FREE_GET_USER_INFO = "https://oapi.dingtalk.com/user/getuserinfo"
# 服务端通过临时授权码获取授权用户的个人信息
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/etaarr
# {https://ding-doc.dingtalk.com/doc#/serverapi2/etaarr}
GET_USER_INFO_SNS = "https://oapi.dingtalk.com/sns/getuserinfo_bycode"
# 获取用户详情
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/AaRQe
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/AaRQe}
GET_USER_PROFILE = "https://oapi.dingtalk.com/user/get"
# 通过 unionId 获取 userId
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/602f4b15
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/602f4b15}
GET_USERID_FROM_UNIONID = "https://oapi.dingtalk.com/user/getUseridByUnionid"
# 根据手机号获取 userId
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/soV11
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/soV11}
GET_USERID_FROM_MOBILE = "https://oapi.dingtalk.com/user/get_by_mobile"
# 获取部门列表
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/e6e1604e
# {https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/e6e1604e}
GET_DEPARTMENT_LIST = "https://oapi.dingtalk.com/department/list"
# 获取部门详情
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/5bf960de
# {https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq/5bf960de}
GET_DEPARTMENT_PROFILE = "https://oapi.dingtalk.com/department/get"
# 发送工作通知消息
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy}
SEND_CORP_CONVERSATION = "https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2"
# 查询工作通知消息的发送进度
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/e2262dad
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/e2262dad}
CORP_CONVERSATION_SEND_PROGRESS = "https://oapi.dingtalk.com/topapi/message/corpconversation/getsendprogress"
# 查询工作通知消息的发送结果
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/a5920210
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/a5920210}
CORP_CONVERSATION_SEND_RESULT = "https://oapi.dingtalk.com/topapi/message/corpconversation/getsendresult"
# 工作通知消息撤回
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/hYyV8
# {https://ding-doc.dingtalk.com/doc#/serverapi2/pgoxpy/hYyV8}
RECALL_CORP_CONVERSATION = "https://oapi.dingtalk.com/topapi/message/corpconversation/recall"
# 上传媒体文件
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/bcmg0i/08d5a73b
# {https://ding-doc.dingtalk.com/doc#/serverapi2/bcmg0i/08d5a73b}
UPLOAD_MEDIA_FILE = "https://oapi.dingtalk.com/media/upload"
end
end
\ No newline at end of file
......@@ -6,7 +6,7 @@ module Dingtalk
extend Dingtalk::Core
# 上传媒体文件
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/bcmg0i/08d5a73b
# {https://ding-doc.dingtalk.com/doc#/serverapi2/bcmg0i/08d5a73b}
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
......
......@@ -6,21 +6,21 @@ module Dingtalk
extend Dingtalk::Core
# 获取用户详情
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/AaRQe
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/AaRQe}
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
end
# 根据 unionId 获取 userId
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/602f4b15
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/602f4b15}
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
end
# 根据手机号获取 userId
# @url https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/soV11
# {https://ding-doc.dingtalk.com/doc#/serverapi2/ege851/soV11}
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