lhj-tools 0.1.33 → 0.1.36

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: 69f8719443c03c2695585c0c0ac7fcec2c4807e443c4214e18d420dcd216d9ce
4
- data.tar.gz: 0d6184a8e16b4bfef213eb4a088bb04424807975ab80d912683c0e2d2d79aae1
3
+ metadata.gz: 224052a6a416f97ba5b9827cd4fdcb49d345d2ff30721062d3f7fbe6e3a7693a
4
+ data.tar.gz: f605d6eff40aa500c863e4dddf8dc532584e1ee4abf7505112679aa629888dab
5
5
  SHA512:
6
- metadata.gz: b361c672336aafad4356216f62c5289c4698826e8eca5f6d71d5dce839eb101859518b4089d85d61ee8226fd4fa6436b66f9f821efab1c9a76029b87969baa83
7
- data.tar.gz: f474869dba2e34cf8b96e294b33f56198716d7a2facd1fa839ca91c5f92bb9cb9cf6cb8def1b90db1616b64a06dc49e2db6a660e68544001e1504b9162b069e6
6
+ metadata.gz: d6388d57ad1fee26262cbca46c2cf472059c27557b6c7ff5512299a89f75ee97093bf29792756ed5bb8072c0b86dceae68589408ab3cfd1fb3db5dcfa25a2e05
7
+ data.tar.gz: f8d1d882382c5853eb495a7a3cb9d75953c27c9bfe1af7a2a1f1d1ee6e3cb012648f22fb859554fd2bc0c845642d55bc56c9b26b913cc4a00766f052a24dee3a
@@ -0,0 +1,34 @@
1
+ module Lhj
2
+ class Command
3
+ class CodeTemplate < Command
4
+ self.summary = '生成源码模板'
5
+ self.description = '生成的代码模板'
6
+
7
+ CODE_TEMPLATE_INDEX = [{ name: 'dispatch Source 模板', template: 'dispatch_source.erb' },
8
+ { name: '另一个 模板', template: 'fffaaa' },
9
+ { name: '代码模板', template: 'fffbbb' }].freeze
10
+
11
+ def initialize(argv)
12
+ @cli = HighLine.new
13
+ super
14
+ end
15
+
16
+ def handle
17
+ CODE_TEMPLATE_INDEX.each_index do |i|
18
+ puts "#{i}.#{CODE_TEMPLATE_INDEX[i][:name]}".yellow
19
+ end
20
+ idx = @cli.ask('请选择查看代码模板: '.green).strip.to_i
21
+ item = CODE_TEMPLATE_INDEX[idx]
22
+ template_name = item[:template]
23
+ template_str = render_template(template_name)
24
+ puts template_str
25
+ end
26
+
27
+ def render_template(template_name)
28
+ temp_str = File.read(File.join(File.dirname(__FILE__), 'template', template_name))
29
+ Lhj::ErbFormatter::Service.new(self).render_template(temp_str)
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+ @implementation ODOrderTimerManager
2
+
3
+ + (instancetype)sharedInstance {
4
+ static dispatch_once_t onceToken;
5
+ static ODOrderTimerManager *instance = nil;
6
+ dispatch_once(&onceToken,^{
7
+ instance = [[ODOrderTimerManager alloc] init];
8
+ });
9
+ return instance;
10
+ }
11
+
12
+ - (void)calcOrderPay:(NSString *)orderId timeout:(NSInteger)timeout
13
+ {
14
+ self.leftTime = timeout;
15
+ self.orderId = orderId;
16
+ if(self.timer){
17
+ dispatch_source_cancel(self.timer);
18
+ }
19
+ if(timeout > 0){
20
+ self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0));
21
+ dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC, 0);
22
+ __weak __typeof(self)weakSelf = self;
23
+ dispatch_source_set_event_handler(self.timer, ^{
24
+ if(weakSelf.leftTime <= 0){ //倒計時結束,關閉
25
+ [[NSNotificationCenter defaultCenter] postNotificationName:kOrderTimerFinishedNotification object:nil];
26
+ dispatch_source_cancel(weakSelf.timer);
27
+ }else{
28
+ [[NSNotificationCenter defaultCenter] postNotificationName:kOrderTimerProcessingNotification object:@(self.leftTime)];
29
+ weakSelf.leftTime--;
30
+ }
31
+ });
32
+ dispatch_resume(self.timer);
33
+ }
34
+ }
35
+
36
+ @end
File without changes
data/lib/lhj/command.rb CHANGED
@@ -17,7 +17,8 @@ module Lhj
17
17
  require 'lhj/command/oss/del'
18
18
  require 'lhj/command/oss/upload'
19
19
  require 'lhj/command/oss/list'
20
- require 'lhj/command/view'
20
+ require 'lhj/command/code/view'
21
+ require 'lhj/command/code/code_template'
21
22
  require 'lhj/command/rename_image'
22
23
  require 'lhj/command/trans'
23
24
  require 'lhj/command/yapi'
@@ -14,6 +14,9 @@ module Lhj
14
14
  str = note
15
15
  if /#.+#/ =~ note
16
16
  note.scan(/#[^#]+#/) do |m|
17
+ rec_reg = m.match(/rec\w+/)
18
+ next if rec_reg
19
+
17
20
  ma = m.match(/\d+/)
18
21
  next if !ma || !ma[0] || ma[0].length <= 0
19
22
 
@@ -16,7 +16,7 @@ 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'.freeze
19
+ QUERY_RECORDS_FIELD_KEY_API_URL = 'https://api.vika.cn/fusion/v1/datasheets/dstid/records?viewId=viwid&fieldKey=id&pageSize=500'.freeze
20
20
 
21
21
  RECORD_LINK_URL = 'https://vika.cn/workbench/dstid/viwid/recid'.freeze
22
22
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.33"
5
+ VERSION = "0.1.36"
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.33
4
+ version: 0.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-25 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -294,6 +294,9 @@ files:
294
294
  - bin/lhj
295
295
  - lib/lhj/action/sh_helper.rb
296
296
  - lib/lhj/command.rb
297
+ - lib/lhj/command/code/code_template.rb
298
+ - lib/lhj/command/code/template/dispatch_source.erb
299
+ - lib/lhj/command/code/view.rb
297
300
  - lib/lhj/command/config.rb
298
301
  - lib/lhj/command/config/info.rb
299
302
  - lib/lhj/command/duplicate_imageset.rb
@@ -318,7 +321,6 @@ files:
318
321
  - lib/lhj/command/sync_pod_version.rb
319
322
  - lib/lhj/command/template.rb
320
323
  - lib/lhj/command/trans.rb
321
- - lib/lhj/command/view.rb
322
324
  - lib/lhj/command/yapi.rb
323
325
  - lib/lhj/command/yapi/formatters/base.rb
324
326
  - lib/lhj/command/yapi/formatters/command_context.rb