Browse files

Old upload API

  • Loading branch information...
1 parent 3c1ce15 commit 7aa9d674ec8d7a004068bc693e201ae1d5abfec6 @theatrus committed Jan 15, 2012
View
3 core/src/main/scala/com/evecentral/Boot.scala
@@ -26,7 +26,8 @@ object Boot extends App {
SupervisorConfig(OneForOneStrategy(List(classOf[Exception]), 3, 100),
List(
Supervise(quicklookActor, Permanent),
- Supervise(marketstatActor, Permanent)
+ Supervise(marketstatActor, Permanent),
+ Supervise(olduploadActor, Permanent)
)
))
}
View
51 core/src/main/scala/com/evecentral/api/APIv2Service.scala
@@ -239,17 +239,30 @@ class MarketStatActor extends ECActorPool with BaseOrderQuery {
}
}
+///////////////////////////////////////////////////////////////////////////////////
+case class OldUploadPayload(ctx: RequestContext, typename: Option[String], userid: Option[String], data: String, typeid: Option[String], region: Option[String])
+class OldUploadServiceActor extends ECActorPool {
+
+ def instance = actorOf(new Actor with DefaultMarshallers with Directives {
+ def receive = {
+ case OldUploadPayload(ctx, typename, userid, data, typeid, region) => {
+ ctx.complete("Done")
+ }
+ }
+ })
+}
+//////////////////////////////////////////////////////////////////////////////////////////////
trait APIv2Service extends Directives {
val quicklookActor = actorOf(new QuickLookQuery())
-
val marketstatActor = actorOf(new MarketStatActor())
+ val olduploadActor = actorOf(new OldUploadServiceActor())
val v2Service = {
path("api/quicklook") {
(get | post) {
- ctx =>
+ ctx =>
(quicklookActor ! ctx)
}
@@ -262,20 +275,28 @@ trait APIv2Service extends Directives {
(get | post) {
ctx =>
(marketstatActor ! EvemonQuery(ctx))
+ }
+ } ~ path("datainput.py/inputdata") {
+ post {
+ formFields("typename"?, "userid"?, "data", "typeid"?, "region"?) {
+ (typename, userid, data, typeid, region) =>
+ olduploadActor ! OldUploadPayload(_, typename, userid, data, typeid, region)
+ }
+
+ }
} ~ path("api/goofy") {
- get {
- respondWithContentType(`text/html`) {
- completeWith {
- <html>
- <body>
- <form method="POST" action="/api/quicklook">
- <input type="text" name="typeid" value="2003"/>
- <input type="text" name="regionlimit" value="10000049"/>
- <input type="submit" value="Go"/>
- </form>
- </body>
- </html>
- }
+ get {
+ respondWithContentType(`text/html`) {
+ completeWith {
+ <html>
+ <body>
+ <form method="POST" action="/api/quicklook">
+ <input type="text" name="typeid" value="2003"/>
+ <input type="text" name="regionlimit" value="10000049"/>
+ <input type="submit" value="Go"/>
+ </form>
+ </body>
+ </html>
}
}
}

0 comments on commit 7aa9d67

Please sign in to comment.