gfresh_point 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/generators/gfresh_point/install/templates/create_gfresh_point_rule.rb +1 -0
- data/lib/gfresh_point/domain/rule.rb +3 -3
- data/lib/gfresh_point/repository/active_record_repo.rb +2 -2
- data/lib/gfresh_point/request_objects/update_rule_point_request.rb +3 -2
- data/lib/gfresh_point/usecase/update_rule_point_usecase.rb +1 -1
- data/lib/gfresh_point/version.rb +1 -1
- data/lib/gfresh_point.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e9ae01ee7ae836a03b5969021c96d56d9e0c19c5e83bf641ee7d0b672da2bab
|
4
|
+
data.tar.gz: '093239eb7dba0740af51a358317660cbc3361577bdd5f7fc70491ee6f07c5fe8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17333422d8c98de6dd258a95af67c0fb8b1cd20c17717c51fee754cda6ee72078e6ffcd39bfed7a889d6e03ff44d81c248e00aa707a2f85ed5e9187d888ea5b7
|
7
|
+
data.tar.gz: 25d67d98a0a5c17412fbc5e28a2c210e4eacf4cb53b6da4bcc16b2fa08d120d6cd3b96757eea9e2ca0fd6958a9da69d59d9f95ab01d270c8364f35d1d4a2c907
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module GfreshPoint
|
2
2
|
module Domain
|
3
3
|
class Rule
|
4
|
+
attr_accessor :app_id, :event_name, :point, :name
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
def initialize(app_id:, event_name:, point:)
|
6
|
+
def initialize(app_id:, event_name:, point:, name: nil)
|
8
7
|
@app_id = app_id
|
8
|
+
@name = name
|
9
9
|
@event_name = event_name
|
10
10
|
@point = point
|
11
11
|
end
|
@@ -8,8 +8,8 @@ module GfreshPoint
|
|
8
8
|
Rule.where(app_id: app_id)
|
9
9
|
end
|
10
10
|
|
11
|
-
def update_rule_point(app_id, rule_id, point)
|
12
|
-
Rule.find(rule_id).update!(point: point)
|
11
|
+
def update_rule_point(app_id, rule_id, point, name)
|
12
|
+
Rule.find(rule_id).update!(point: point, name: name)
|
13
13
|
end
|
14
14
|
|
15
15
|
def get_user_last_balance(app_id, user_id)
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module GfreshPoint
|
2
2
|
module RequestObjects
|
3
3
|
class UpdateRulePointRequest < RequestObject
|
4
|
-
attr_accessor :app_id, :rule_id, :point
|
4
|
+
attr_accessor :app_id, :rule_id, :point, :name
|
5
5
|
|
6
|
-
def initialize(app_id, rule_id, point)
|
6
|
+
def initialize(app_id, rule_id, point, name)
|
7
7
|
@app_id = app_id
|
8
8
|
@rule_id = rule_id
|
9
|
+
@name = name
|
9
10
|
@point = point
|
10
11
|
|
11
12
|
if app_id.blank?
|
@@ -2,7 +2,7 @@ module GfreshPoint
|
|
2
2
|
module Usecase
|
3
3
|
class UpdateRulePointUsecase < BaseUsecase
|
4
4
|
def execute(request)
|
5
|
-
rules = repo.update_rule_point(request.app_id, request.rule_id, request.point)
|
5
|
+
rules = repo.update_rule_point(request.app_id, request.rule_id, request.point, request.name)
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
data/lib/gfresh_point/version.rb
CHANGED
data/lib/gfresh_point.rb
CHANGED
@@ -40,8 +40,8 @@ module GfreshPoint
|
|
40
40
|
response
|
41
41
|
end
|
42
42
|
|
43
|
-
def update_rule_point(rule_id, point)
|
44
|
-
request = GfreshPoint::RequestObjects::UpdateRulePointRequest.new(app_id, rule_id, point)
|
43
|
+
def update_rule_point(rule_id, point, name = nil)
|
44
|
+
request = GfreshPoint::RequestObjects::UpdateRulePointRequest.new(app_id, rule_id, point, name)
|
45
45
|
use_case = GfreshPoint::Usecase::UpdateRulePointUsecase.new(repo)
|
46
46
|
response = use_case.call(request)
|
47
47
|
response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gfresh_point
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- teddy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|