feishu-rails 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6b9dc17b25ed71b79c2e5c2160c3073a60229ec72fcb57886afd78670f40dce
4
- data.tar.gz: 589b5a49e22547cb7a1707af6abdda452c4c37b526f26a3be7929719ed62f0ee
3
+ metadata.gz: c9ffbd5349b1725eff7ac29f5822779d3566dd3a3dca6bb7577845d5b62015cf
4
+ data.tar.gz: 787d901f41edd64c8b5e19e5f2b2aa27066fa35840a356d055a994bfbee12ad5
5
5
  SHA512:
6
- metadata.gz: '068363fc3fc91c331e63d4dc98c455b9c13254b55f1ebb7b6f12f709b738f5b1d25b3bdd72d35a3347b25f61ad229ddfe154f946877a9af727aa63722c2e3829'
7
- data.tar.gz: 1c4707530b6173a37bb5e9fe98d93026c7b9398c46a4db971b1ba1817bfb12ab4236b43ea1a3e20b345dde24ba54f5b31fb58d1facf339ee24cadfb511b6ea6d
6
+ metadata.gz: 636d3abd7ce1658069e20f818fd176d48311900d5e559a2281ba460fd2c9a349d5cb553820ece62e7367875684758c0c01cb6d182161329ad746848b776b75ee
7
+ data.tar.gz: bb5dbb5d2049ba3fec04bcccbe0a4723b7072b8319bd65c098a74edc1ee1f7acdb6ff02ed0888a71e04d80a5bf29fbb328df0c194222006de1068dd3ef3637bf
@@ -1,5 +1,8 @@
1
+ require "active_support/concern"
2
+
1
3
  module Feishu
2
- class << self
4
+ extend ActiveSupport::Concern
5
+ module Connector
3
6
  # 定义常用的 URL
4
7
  AUTH_URL = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal/"
5
8
  USER_INFO = "https://open.feishu.cn/open-apis/contact/v1/user/batch_get"
@@ -13,7 +16,6 @@ module Feishu
13
16
  def access_token
14
17
  Rails.cache.fetch("feishu_token", expires_in: 2.hours) do
15
18
  res = HTTP.post(AUTH_URL, json: { app_id: Config.app_id, app_secret: Config.app_secret })
16
- # res = HTTP.post(AUTH_URL, json: { app_id: Config.app_id, app_secret: Config.app_secret })
17
19
  JSON.parse(res.body.readpartial)["tenant_access_token"]
18
20
  end
19
21
  end
@@ -58,6 +60,7 @@ module Feishu
58
60
  # member_ids = group_users_content["data"]
59
61
  # end
60
62
 
63
+ # 上传图片到飞书后台
61
64
  def upload_image(image_path)
62
65
  # 读取图片
63
66
  data = HTTP::FormData::File.new image_path
@@ -85,6 +88,7 @@ module Feishu
85
88
  JSON.parse(res.body.readpartial)
86
89
  end
87
90
 
91
+ # 发生富文本消息
88
92
  # def send_alert(chat_id)
89
93
  # data = {
90
94
  # "chat_id": chat_id,
@@ -1,3 +1,3 @@
1
1
  module Feishu
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feishu-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - WENWU.YAN