http_store 0.6.3 → 0.6.4

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: 2e8ef0ab88421ea37700843bfe985f77aa9478b9f91cd3110a33c03cf0fd4705
4
- data.tar.gz: bffd57d301c09219ebffb53b4cee61e94510dccf2162940a40e24a9a858507ff
3
+ metadata.gz: c5912e7d57df1c0dbbed3edc404d103137ce8a503b36ed45d46059e1f54ff279
4
+ data.tar.gz: 27ef060e848875d2f0020124efbfbe19365b83015ab5cac188ce5d3cd9bbda68
5
5
  SHA512:
6
- metadata.gz: 402d8614ec1c4d5b801e15b382010cf89e9a793d64be45a383e50178b34c651f3806f4efb9251fcb6d03660b6cd098c102b8d1ee8d1ed58ea277b29b6920b193
7
- data.tar.gz: 4231fcf62e780faf9f098e5f3f7a5e96cd89f8419668cabf517af2d0010b67377d94f9f202c96f5ef0e897cb3630af49ad9c7be09102cee554bba69f0c9205cf
6
+ metadata.gz: '01887ac6363da2fccd78ac8dbfc86360ce85feadb84a911054aea6d40eff0c49864c986600dc4cae5c6a63b74251a2d1735dbb0e43c9ba1629f1ce9101109cee'
7
+ data.tar.gz: b0e1b314ace8561d7e04a88b746e31821504f099541085aa56744eeb18c5f850760013b296ea63838ee47f64f1683286167f5f703b7dc66091b2b66c8f7f4d12
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- http_store (0.6.3)
4
+ http_store (0.6.4)
5
5
  activerecord
6
6
  hashie
7
7
  rails
@@ -124,7 +124,7 @@ GEM
124
124
  mini_mime (1.1.5)
125
125
  minitest (5.20.0)
126
126
  mutex_m (0.2.0)
127
- net-imap (0.4.8)
127
+ net-imap (0.4.9)
128
128
  date
129
129
  net-protocol
130
130
  net-pop (0.1.2)
@@ -19,16 +19,21 @@ class CreateHttpLogs < ActiveRecord::Migration[5.2]
19
19
  t.integer :status_code, comment: 'response http code'
20
20
  t.text :response, comment: 'response body'
21
21
  t.text :response_headers, comment: 'response header'
22
+ t.integer :response_code, comment: 'response code'
22
23
 
23
24
  # response checker
24
25
  t.boolean :response_valid, comment: '请求结果 true/false, 这个要根据业务逻辑来设定. 不能靠 status_code 来确定'
25
26
  t.text :response_data, comment: '格式化后的 response'
26
27
 
27
28
  # relation
28
- t.string :client_type, limit: 80, comment: '请求类型'
29
+ t.string :client_type, index: true, limit: 80, comment: '请求类型'
29
30
  t.string :requestable_id, comment: '外键 ID'
30
31
  t.string :requestable_type, comment: '外键 类型'
31
32
  t.integer :parent_id
33
+ t.boolean :is_system, default: false, comment: '是否系统请求'
34
+
35
+ t.boolean :cache_request, comment: '是否缓存请求'
36
+ t.integer :retry_times, comment: '重试次数'
32
37
 
33
38
  t.index [:created_at, :client_type]
34
39
  t.index [:created_at, :response_valid]
@@ -31,6 +31,7 @@ module HttpStore
31
31
  http_method: request.request_method,
32
32
  data: request.params,
33
33
  client_type: request.params[:client_type],
34
+ is_system: true,
34
35
  headers: request.headers.select { |k, _v| k.start_with? 'HTTP_' }.to_h,
35
36
  query_params: request.query_parameters,
36
37
  force: true,
@@ -1,3 +1,3 @@
1
1
  module HttpStore
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - black
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-21 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -140,9 +140,6 @@ files:
140
140
  - bin/console
141
141
  - bin/setup
142
142
  - db/migrate/1_create_http_logs.rb
143
- - db/migrate/2_add_cache_response_field_to_http_log.rb
144
- - db/migrate/3_add_retry_times_field_to_http_log.rb
145
- - db/migrate/4_add_index_to_http_log.rb
146
143
  - http_store.gemspec
147
144
  - lib/generators/http_store/initializer_generator.rb
148
145
  - lib/http_store.rb
@@ -1,6 +0,0 @@
1
- class AddCacheResponseFieldToHttpLog < ActiveRecord::Migration[5.2]
2
- def change
3
- add_column :http_logs, :cache_response, :boolean
4
- add_column :http_logs, :response_code, :integer
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- class AddRetryTimesFieldToHttpLog < ActiveRecord::Migration[5.2]
2
- def change
3
- add_column :http_logs, :retry_times, :integer
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class AddIndexToHttpLog < ActiveRecord::Migration[5.2]
2
- def change
3
- add_index :http_logs, :client_type
4
- end
5
- end