Update blackbox's API endpoint (#259)
This commit is contained in:
parent
71392e3e60
commit
e3a270d317
3 changed files with 15 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class BlackBox
|
||||
def self.article_hotness_score(article)
|
||||
return (article.featured_number|| 10000)/10000 unless Rails.env.production?
|
||||
FunctionCaller.new("aws-nodejs-ecma-script-dev-articleHotness",
|
||||
FunctionCaller.new("blackbox-production-articleHotness",
|
||||
{article: article, user: article.user}.to_json).call
|
||||
end
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ class BlackBox
|
|||
#accepts comment or article as story
|
||||
return 0 unless Rails.env.production?
|
||||
return 100 unless story.user
|
||||
FunctionCaller.new("aws-nodejs-ecma-script-dev-spamScore",
|
||||
FunctionCaller.new("blackbox-production-spamScore",
|
||||
{story: story, user: story.user}.to_json).call
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class CouponGenerator
|
|||
private
|
||||
|
||||
def lambda_generated_code
|
||||
response = FunctionCaller.new("aws-nodejs-ecma-script-dev-couponCode",
|
||||
response = FunctionCaller.new("blackbox-production-couponCode",
|
||||
{ inputNumber: id, version: version }.to_json).call
|
||||
response.to_s(36)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,23 +2,23 @@
|
|||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/aws-nodejs-ecma-script-dev-couponCode/invocations
|
||||
uri: https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/blackbox-production-couponCode/invocations
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"inputNumber":1,"version":"sticker_pack"}'
|
||||
string: '{"inputNumber":1,"version":"member_discount"}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- ''
|
||||
Accept-Encoding:
|
||||
- ''
|
||||
User-Agent:
|
||||
- aws-sdk-ruby3/3.14.0 ruby/2.5.0 x86_64-darwin17 aws-sdk-lambda/1.4.0
|
||||
- aws-sdk-ruby3/3.16.0 ruby/2.5.0 x86_64-darwin17 aws-sdk-lambda/1.4.0
|
||||
X-Amz-Date:
|
||||
- 20180220T194923Z
|
||||
- 20180430T153708Z
|
||||
X-Amz-Content-Sha256:
|
||||
- e90a3c16abcd660d3078ddaa298ccea331a93956d6a1dfe2005d7ca9476e8eaa
|
||||
- 4e136bea32bf725f5995996014cfe71dcdefcdeefa92a351e0dd876eab352b02
|
||||
Content-Length:
|
||||
- '42'
|
||||
- '45'
|
||||
Accept:
|
||||
- "*/*"
|
||||
response:
|
||||
|
|
@ -27,24 +27,24 @@ http_interactions:
|
|||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Tue, 20 Feb 2018 19:49:23 GMT
|
||||
- Mon, 30 Apr 2018 15:37:09 GMT
|
||||
Content-Type:
|
||||
- application/json
|
||||
Content-Length:
|
||||
- '104'
|
||||
- '107'
|
||||
Connection:
|
||||
- keep-alive
|
||||
X-Amzn-Requestid:
|
||||
- 265c42da-1677-11e8-80ce-0d13b70af207
|
||||
- 57e751b9-4c8c-11e8-acfe-47fdbb39eee9
|
||||
X-Amzn-Remapped-Content-Length:
|
||||
- '0'
|
||||
X-Amz-Executed-Version:
|
||||
- "$LATEST"
|
||||
X-Amzn-Trace-Id:
|
||||
- root=1-5a8c7bc3-6d41ee52ccfb664e43c490ba;sampled=0
|
||||
- root=1-5ae73824-4f68d8388975d2440195c0f8;sampled=0
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"statusCode":200,"body":"{\"message\":818,\"input\":{\"inputNumber\":1,\"version\":\"sticker_pack\"}}"}'
|
||||
string: '{"statusCode":200,"body":"{\"message\":814,\"input\":{\"inputNumber\":1,\"version\":\"member_discount\"}}"}'
|
||||
http_version:
|
||||
recorded_at: Tue, 20 Feb 2018 19:49:23 GMT
|
||||
recorded_at: Mon, 30 Apr 2018 15:37:09 GMT
|
||||
recorded_with: VCR 4.0.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue