cocoapods-aomi-bin 0.1.20 → 0.1.21

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: b0ab50139a50285ba68913f933fc41b22f44d14a6121ca60262a0ff927b92d95
4
- data.tar.gz: 45db5d44f8db5ced6c5fd7b3233f3b6c9fb63c7e10dffc58cec720b66ea8e98c
3
+ metadata.gz: cea7471eae842634649c220a62e11f4589f20634d5b9c0808f4408316b49d3de
4
+ data.tar.gz: 643fc2465fc83994e6438ccb12f9f93c8aa0b94762bf98c1e1fbb63c08567fc7
5
5
  SHA512:
6
- metadata.gz: aeca9253e58a3e53e3678fa9b40d8a57a5090c4d3f9a226d51c7676d352a94a9de0dff05370f4733eacbb36bd87ba124b1db29d49efefa9294e482f7c6959b58
7
- data.tar.gz: 2001007fa825622887c068d97b901a29d094523442a743471a939b7c807042400fb8361d77be41725559aee1261844ecb910408f4a92632c536763b20e7156d6
6
+ metadata.gz: 71c5d7acda6dc021b007cb27b81bc7ddc37b8d24f6a143236650d8054b07231fd1d98fe25df236b901530c2990f53716df4473ebd33b55f62e1d3dde62896d8d
7
+ data.tar.gz: 2256e7b73731522f3e649141332db91f3328b2c0d83cfd0c84feb4ab4e4d57de8b021ee624cf5e29efd3f26dc6813f2e326f69ac6cdebc27fede34a5a2d6936d
@@ -25,8 +25,6 @@ module Pod
25
25
  def run
26
26
  load_config
27
27
  fetch_model
28
- print_models
29
- print_models_implementation
30
28
  print_methods
31
29
  end
32
30
 
@@ -68,6 +66,25 @@ module Pod
68
66
 
69
67
  def fetch_model
70
68
  res_json = req_model
69
+ begin
70
+ puts "\n<===============打印返回数据模型-Begin=====================>\n"
71
+ fetch_res_boy(res_json)
72
+ print_models
73
+ print_models_implementation
74
+ puts "\n<===============打印返回数据模型-End=====================>\n"
75
+ end
76
+ begin
77
+ puts "\n<===============打印请求模型-Begin=====================>\n"
78
+ @models = []
79
+ @model_names = []
80
+ fetch_req_body(res_json)
81
+ print_models
82
+ print_models_implementation
83
+ puts "\n<===============打印请求模型-End=====================>\n"
84
+ end
85
+ end
86
+
87
+ def fetch_res_boy(res_json)
71
88
  if res_json && res_json['data']
72
89
  @data_json = res_json['data']
73
90
  if @data_json['res_body']
@@ -83,6 +100,21 @@ module Pod
83
100
  end
84
101
  end
85
102
 
103
+ def fetch_req_body(res_json)
104
+ if res_json && res_json['data']
105
+ @data_json = res_json['data']
106
+ if @data_json['req_body_other']
107
+ begin
108
+ res_body = JSON.parse(@data_json['req_body_other'])
109
+ res_body['name'] = gen_model_name('')
110
+ handle_model(res_body)
111
+ rescue => ex
112
+ puts ex
113
+ end
114
+ end
115
+ end
116
+ end
117
+
86
118
  def gen_model_name(name)
87
119
  n = name.gsub(/vo|model|list/i, '').gsub(/(.*)s$/, '\1').gsub(/^\w/) { $&.upcase }
88
120
  if n.length <= 0
@@ -126,7 +158,6 @@ module Pod
126
158
  end
127
159
 
128
160
  def print_models
129
- puts "\n<===============打印模型=====================>\n"
130
161
  @models.each do |model|
131
162
  model_name = model[:name] || ''
132
163
  model_properties = model[:properties]
@@ -1,5 +1,5 @@
1
1
  module CBin
2
- VERSION = '0.1.20'
2
+ VERSION = '0.1.21'
3
3
  end
4
4
 
5
5
  module Pod
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-aomi-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-23 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods