lhj-tools 0.1.95 → 0.1.96

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: 55b9242149da893982e764986c573ac7fb0d44b22500e36e980e9b83fa195054
4
- data.tar.gz: b8345388b62ab38bd0f689269233703bce75eaec0e57b7683f5c1cb776c33e1d
3
+ metadata.gz: aa4d693bb22ce7c5059df391d0596da915785429d480109afc53674710885976
4
+ data.tar.gz: b431fe5461e189eccc44bae77472c1cbad6bd0f4576675389b8ffba699612782
5
5
  SHA512:
6
- metadata.gz: 9b8fa34d2a6941d63ceea2ef5449b98ce483ab6aa114d7f4fd63ae2ccbba54d32a19055fe0b5f461ad2ed821a2501329893b339519d6b00a3cba2d933255604b
7
- data.tar.gz: e69802cb604ec9cfed945bd02fc8a88c640441d9fbcf71a13ab667085828fe561f5733c3a44e08178f8109f0826c973d6dfad85dd4da5db76d681f7e15a27b26
6
+ metadata.gz: 1118b0ca825f9d8c6dd47a09f26bfab28a2b486e4ecf30893d685de5e21470e00bae8523dfe6c7b8aa8b8ede3a3b8c98fedd028ed4c7e2d60dbdda9f2f090a3b
7
+ data.tar.gz: 05471f260b844ae9851ebae6dc7763972182000065be1ac0a1c0b65637b1df6c1b8a27f7e425292bbf3b3a07d663128d63f673397671ea39e265d9eea5c5159b
@@ -18,6 +18,12 @@ module Lhj
18
18
  http_post(robot_url, http_body)
19
19
  end
20
20
 
21
+ def self.post_single_card_message(title, message, single_title, single_url)
22
+ robot_url = Lhj::DingTalkConfig.dingtalk_robot
23
+ http_body = single_action_card_body_message(title, message, single_title, single_url)
24
+ http_post(robot_url, http_body)
25
+ end
26
+
21
27
  def self.post_branch_message(http_body)
22
28
  branch_name = fetch_branch
23
29
  branch_map = Lhj::DingTalkConfig.git_branch
@@ -63,6 +69,25 @@ module Lhj
63
69
  }.to_json
64
70
  end
65
71
 
72
+ def self.single_action_card_body_message(title, message, single_title, single_url)
73
+ {
74
+ 'msgtype' => 'actionCard',
75
+ 'actionCard' => { 'title' => title,
76
+ 'text' => message,
77
+ 'btnOrientation' => '0',
78
+ 'singleTitle' => single_title,
79
+ 'singleURL' => single_url }
80
+ }.to_json
81
+ end
82
+
83
+ # links: [{'title'=>'this is ...', 'messageURL'=>'https://www.dingtalk.com', 'picURL'=>'https://xx.png'}]
84
+ def self.feed_card_body_message(links)
85
+ {
86
+ 'msgtype' => 'feedCard',
87
+ 'feedCard' => links
88
+ }.to_json
89
+ end
90
+
66
91
  def self.fetch_branch
67
92
  name = Lhj::Actions.git_branch || ''
68
93
  name.split('/').last
@@ -110,7 +110,7 @@ module Lhj
110
110
  end
111
111
 
112
112
  def app_download_url
113
- "https://www.pgyer.com/#{@result['data']['appShortcutUrl']}"
113
+ "https://www.pgyer.com/#{@result['data']['appKey']}"
114
114
  end
115
115
  end
116
116
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.95"
5
+ VERSION = "0.1.96"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhj-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.95
4
+ version: 0.1.96
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-13 00:00:00.000000000 Z
11
+ date: 2023-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj