-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from aukgit/feature/static-bidding-poc
# Static bidding POC + Database updates - [x] Static Bid Response Serving Properly (POC) - [x] POC tested in DemandSidePlatformSimulatorServiceApiController for static bidding - [x] Database updated as per impression place holder. - [x] Dimensions (Height/Width) removed from BidRequest to ImpressionPlaceHolder. - [x] Create relationship with impression with impressionPlaceholder(can be banner, video or native) and holds dimensions and request information. - [x] Improved Extension methods [WIP] # TODOs - [ ] Static Bid Requires more improvements TODO - [ ] More improvements in extensions methods - [ ] Testing Bidding Static [WIP]
- Loading branch information
Showing
82 changed files
with
2,016 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package shared.com.ortb.constants | ||
|
||
import shared.com.ortb.model.auctionbid.bidresponses.BidModel | ||
import shared.io.extensions.TypeConvertExtensions._ | ||
|
||
sealed class BiddingConstants { | ||
lazy val aDomains = List( | ||
"Advertiser blocked domains list", | ||
"Sample-Site-blocked.com", | ||
"Sample-Site2-blocked.com", | ||
"Sample-Site3-blocked.com") | ||
|
||
lazy val staticBidModel : BidModel = BidModel( | ||
"static:bidId", | ||
"-1", | ||
0, | ||
"static:Advertise Id".toSome, | ||
None, | ||
"adm win-notice markup, optional and should be ignored.".toSome, | ||
aDomains.toSome, | ||
"iurl : uncached image link".toSome, | ||
"static: CampaignId".toSome, | ||
List("static: categoryId1", "static: categoryId2").toSome, | ||
"static: dealId".toSome, | ||
h = None, | ||
w = None | ||
) | ||
|
||
/** | ||
* HTTP 204 “No Content” from the bidder (most economical in terms of bandwidth). | ||
* An empty JSON object: {} | ||
* A well-formed no bid response: {"id": "1234567890", "seatbid": []} | ||
* A well-formed no bid response with a reason code: {"id": "1234567890", "seatbid": [], "nbr": 2} | ||
*/ | ||
lazy val emptyStaticBidResponse = "{\"id\": \"\", \"seatbid\": []}" | ||
|
||
/** | ||
* HTTP 204 “No Content” from the bidder (most economical in terms of bandwidth). | ||
* An empty JSON object: {} | ||
* A well-formed no bid response: {"id": "1234567890", "seatbid": []} | ||
* A well-formed no bid response with a reason code: {"id": "1234567890", "seatbid": [], "nbr": 2} | ||
*/ | ||
lazy val emptyStaticBidResponseWithNoBidResponseCodeUnknown = "{\"id\": \"\", \"seatbid\": [], \"nbr\": 0}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/shared/com/ortb/controllers/implementations/RestWebApiOkImplementation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package shared.com.ortb.controllers.implementations | ||
|
||
import akka.util.ByteString | ||
import play.api.http.{ HttpEntity, Status } | ||
import play.api.mvc.{ AbstractController, ResponseHeader, Result } | ||
import play.mvc.Http.MimeTypes | ||
import shared.io.extensions.TypeConvertExtensions._ | ||
|
||
class RestWebApiOkImplementation(controller : AbstractController) { | ||
def okJson(jsonString : String) : Result = controller.Ok(jsonString).as(MimeTypes.JSON) | ||
|
||
lazy val noContent : Result = controller.NoContent.as(MimeTypes.JSON) | ||
|
||
def okJsonWithStatus( | ||
jsonString : String, | ||
statusCode : Int = Status.OK, | ||
contentType : String = MimeTypes.JSON | ||
) : Result = okJsonWithHeader( | ||
jsonString, | ||
ResponseHeader(statusCode), | ||
contentType) | ||
|
||
def okTextWithStatus( | ||
jsonString : String, | ||
statusCode : Int = Status.OK, | ||
contentType : String = MimeTypes.TEXT | ||
) : Result = okJsonWithHeader( | ||
jsonString, | ||
ResponseHeader(statusCode), | ||
contentType) | ||
|
||
def okJsonWithHeader( | ||
jsonString : String, | ||
responseHeader : ResponseHeader = ResponseHeader(Status.OK), | ||
contentType : String = MimeTypes.JSON | ||
) : Result = Result( | ||
header = responseHeader, | ||
body = HttpEntity.Strict(ByteString(jsonString), contentType.toSome) | ||
) | ||
|
||
def okHtmlWithStatus( | ||
jsonString : String, | ||
statusCode : Int = Status.OK, | ||
contentType : String = MimeTypes.HTML | ||
) : Result = okJsonWithHeader( | ||
jsonString, | ||
ResponseHeader(statusCode), | ||
contentType) | ||
} |
8 changes: 0 additions & 8 deletions
8
app/shared/com/ortb/controllers/implementations/RestWebApiOkJsonImplementation.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.