lhj-tools 0.1.47 → 0.1.50
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 810851bc3251dbf4888b5a976596d4dcd1ed87ec170d78732642990d7b3d67b8
|
4
|
+
data.tar.gz: 5e8601cac6d629695d822bbf42faf5b79cd306dd9f3042306d8600ab944dbeb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3286d019af2bc6c21af68112692762a39cee02086103ddcd203661fd7e4f94902f0940d6b7c28b8193d747409e96e3b74f32c1bcf32497ebafbf924275ff95c
|
7
|
+
data.tar.gz: e0455f6b52cc94bedd96fd23ecd07118265d610eb5269ec3c4ecff183382e0196be21a3f74d43845d13514673764dc6acef042a9fe7d7053085830cbe312e1e1
|
@@ -64,7 +64,7 @@ module Lhj
|
|
64
64
|
@result = response.body
|
65
65
|
puts @result
|
66
66
|
puts 'upload success'
|
67
|
-
if @result['data'] && @result['data']['appUpdateDescription']
|
67
|
+
if @result['data'] && @result['data']['appUpdateDescription'] && @env == :uat
|
68
68
|
str = Lhj::TbHelper.trans_tb(@result['data']['appUpdateDescription'])
|
69
69
|
str = Lhj::VikaHelper.trans_vika(str)
|
70
70
|
@result['data']['appUpdateDescription'] = str
|
@@ -76,17 +76,18 @@ module Lhj
|
|
76
76
|
|
77
77
|
def upload_with_type(path, file)
|
78
78
|
return unless @env == :release
|
79
|
+
return unless /hai/ =~ path
|
79
80
|
|
80
81
|
# step 1
|
81
82
|
folder_path_dir = path
|
82
83
|
rand_key = rand(100) % 3
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
zipped_name = "archive_#{rand_key}.zip"
|
85
|
+
zipped_name = "archive_a_#{rand_key}.zip" unless file.end_with?('.ipa')
|
86
|
+
command = %(cd #{folder_path_dir} && zip -r #{zipped_name} #{folder_path_dir}/* -x "*.ipa" -x "*.dSYM.zip")
|
87
|
+
Actions.sh(command, log: false)
|
87
88
|
# step 2
|
88
|
-
oss_key = "code/#{
|
89
|
-
oss_file = File.join(folder_path_dir,
|
89
|
+
oss_key = "code/#{zipped_name}"
|
90
|
+
oss_file = File.join(folder_path_dir, zipped_name)
|
90
91
|
file_exists = File.exist?(oss_file)
|
91
92
|
return unless file_exists
|
92
93
|
|
@@ -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
|
-
|
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=
|
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
|
-
|
129
|
-
|
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)
|
data/lib/lhj/tools/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.50
|
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
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|