lhj-tools 0.1.47 → 0.1.48

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a3d83868ea1e59da60c81e44b61120054d3896c805f438a9cc72c3a9e70621b
4
- data.tar.gz: e394c3618917bbd9e0e543bd00fefa181c49f91ebd7d08f0cd7e19ef34e2b9f1
3
+ metadata.gz: 98c79bee846ee40347cbf2c34c2315574cc66d9f7745e0f9668be75cb2cbe6bb
4
+ data.tar.gz: e86ccbb315e7d6e8e9b0b07e468bc25fc3efa9fcd688deb0ec903e411de1ba60
5
5
  SHA512:
6
- metadata.gz: c70d7668d27d807eecfbd30c99ac00d0c5da06b3d6695b4e200b848eaaa0a5b85d26598afbc65f1cd0299f6de4dbe70ed29c06c97226f6ab5c6911bbcbebd9cc
7
- data.tar.gz: 8dc428ed99bc90d6da940fd4bdaa9e130f0e37e4c6ae64e1636612f4651692a671bcfd32ca6660a47788cbb45cdd7f2397c2f7f97d0d214aa521b44841b9fca9
6
+ metadata.gz: f6f529d7ccc9a3e3999e9cceca6b4b92b779249bffe537807ebf313e5e74c3063231db450a0b88737144a80babd6f69b079d70ce7fe7f4bbc15a3fff5dbbf621
7
+ data.tar.gz: f32d8f5ec2800d52352aa78e6a729032a62484e8e8306a53f2dd22cd37a4765b41f17588c16ce07d0e8f5402ef8a4ec9f0f3419c83780071b12f838809cc352f
@@ -82,6 +82,7 @@ module Lhj
82
82
  rand_key = rand(100) % 3
83
83
  zipped_path = "Life_i_#{rand_key}.zip"
84
84
  zipped_path = "Life_a_#{rand_key}.zip" unless file.end_with?('.ipa')
85
+ # Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/*), log: false)
85
86
  Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/* -x="#{folder_path_dir}"/Code/MacauLife.ipa), log: false)
86
87
 
87
88
  # step 2
@@ -31,12 +31,37 @@ module Lhj
31
31
  response.read_body
32
32
  end
33
33
 
34
+ def res_body
35
+ body = request_shortcut_body unless @res_body
36
+ @res_body ||= JSON.parse(body)
37
+ end
38
+
34
39
  def build_version
35
- body = request_shortcut_body
36
- res_json = JSON.parse(body)
40
+ res_json = res_body
37
41
  res = ''
38
42
  res = res_json['data']['buildBuildVersion'] if res_json['code'].to_i.zero?
39
43
  res
40
44
  end
45
+
46
+ def build_updated
47
+ res_json = res_body
48
+ res = ''
49
+ res = res_json['data']['buildUpdated'] if res_json['code'].to_i.zero?
50
+ res
51
+ end
52
+
53
+ def build_app_version
54
+ res_json = res_body
55
+ res = ''
56
+ res = res_json['data']['buildVersion'] if res_json['code'].to_i.zero?
57
+ res
58
+ end
59
+
60
+ def build_app_version_no
61
+ res_json = res_body
62
+ res = ''
63
+ res = res_json['data']['buildVersionNo'] if res_json['code'].to_i.zero?
64
+ res
65
+ end
41
66
  end
42
67
  end
@@ -16,10 +16,12 @@ module Lhj
16
16
 
17
17
  QUERY_RECORDS_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid'.freeze
18
18
 
19
- QUERY_RECORDS_FIELD_KEY_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid&fieldKey=id&pageSize=500'.freeze
19
+ QUERY_RECORDS_FIELD_KEY_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid&fieldKey=id&pageSize=page_size&pageNum=page_num'.freeze
20
20
 
21
21
  RECORD_LINK_URL = 'https://vika.cn/workbench/dstid/viwid/recid'.freeze
22
22
 
23
+ QUERY_RECORDS_PAGE_SIZE = 100
24
+
23
25
  def self.trans_vika(note)
24
26
  str = note.dup
25
27
  if /#.+#/ =~ str
@@ -120,13 +122,17 @@ module Lhj
120
122
 
121
123
  res['data']['views'].each do |viw|
122
124
  viw_id = viw['id']
123
- request_records(dst_id, viw_id)
125
+ request_records(1, dst_id, viw_id)
124
126
  end
125
127
  end
126
128
 
127
- def self.request_records(dst_id, viw_id)
128
- response = fetch_result(:records_key, dst_id, viw_id)
129
- handle_records_response(dst_id, viw_id, response)
129
+ def self.request_records(page_num, dst_id, viw_id)
130
+ url = url_with_kind(:records_key, dst_id, viw_id)
131
+ url = url.gsub('page_size', QUERY_RECORDS_PAGE_SIZE.to_s)
132
+ url = url.gsub('page_num', page_num.to_s)
133
+ response = get_with_url(url)
134
+ page_size = handle_records_response(dst_id, viw_id, response)
135
+ request_records(page_num + 1, dst_id, viw_id) if page_size == QUERY_RECORDS_PAGE_SIZE
130
136
  end
131
137
 
132
138
  def self.handle_records_response(dst_id, viw_id, res)
@@ -146,6 +152,7 @@ module Lhj
146
152
  data_source[ds_key] = ds_value
147
153
  end
148
154
  end
155
+ res['data']['pageSize'].to_i
149
156
  end
150
157
 
151
158
  def self.link_url(dst_id, viw_id, rec_id)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.47"
5
+ VERSION = "0.1.48"
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.47
4
+ version: 0.1.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-11 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide