http_store 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e8ef0ab88421ea37700843bfe985f77aa9478b9f91cd3110a33c03cf0fd4705
4
- data.tar.gz: bffd57d301c09219ebffb53b4cee61e94510dccf2162940a40e24a9a858507ff
3
+ metadata.gz: f2e4186bd3b3e01595c14925d778912591b3c99a5642f3a6ad6e964767dfd3cd
4
+ data.tar.gz: bc501f774c428c046799401c7e599ae7a174491787e668e83682eee88c483e78
5
5
  SHA512:
6
- metadata.gz: 402d8614ec1c4d5b801e15b382010cf89e9a793d64be45a383e50178b34c651f3806f4efb9251fcb6d03660b6cd098c102b8d1ee8d1ed58ea277b29b6920b193
7
- data.tar.gz: 4231fcf62e780faf9f098e5f3f7a5e96cd89f8419668cabf517af2d0010b67377d94f9f202c96f5ef0e897cb3630af49ad9c7be09102cee554bba69f0c9205cf
6
+ metadata.gz: 141855265f8240eddd298a057efc71d0ae144959d24fdc21384fa12ab98d1cfb05682ed789d777d11767b4ececb9c4a0343af5c97e9b7a1a6f6a3d72e3e9a14a
7
+ data.tar.gz: f611ca17409ba059e6fa1aef48ad787f8a0cfe07e3163eb3ed00b28cbafd78fa36142ec7d4fcb0c96cdcbd00c063c45df332c5d718d5013e2c1a1e1d0c5a2f05
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.5)
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,20 @@ 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 :cache_response, comment: '是否缓存请求'
23
+ t.integer :response_code, comment: 'response code'
24
+ t.integer :retry_times, comment: '重试次数'
22
25
 
23
26
  # response checker
24
27
  t.boolean :response_valid, comment: '请求结果 true/false, 这个要根据业务逻辑来设定. 不能靠 status_code 来确定'
25
28
  t.text :response_data, comment: '格式化后的 response'
26
29
 
27
30
  # relation
28
- t.string :client_type, limit: 80, comment: '请求类型'
31
+ t.string :client_type, index: true, limit: 80, comment: '请求类型'
29
32
  t.string :requestable_id, comment: '外键 ID'
30
33
  t.string :requestable_type, comment: '外键 类型'
31
34
  t.integer :parent_id
35
+ t.boolean :is_system, default: false, comment: '是否系统请求'
32
36
 
33
37
  t.index [:created_at, :client_type]
34
38
  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.5"
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.5
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