Skip to content

Commit 92ead0f

Browse files
committed
updated to play 2.3
1 parent 1a81d3c commit 92ead0f

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

samples/scala-play2/app/controllers/BaseApiController.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BaseApiController extends Controller with RestResourceUtil {
1414
// APIs
1515
protected def JsonResponse(data: Object) = {
1616
val jsonValue: String = toJsonString(data)
17-
new SimpleResult(header = ResponseHeader(200), body = play.api.libs.iteratee.Enumerator(jsonValue.getBytes())).as("application/json")
17+
new Result(header = ResponseHeader(200), body = play.api.libs.iteratee.Enumerator(jsonValue.getBytes())).as("application/json")
1818
.withHeaders(
1919
("Access-Control-Allow-Origin", "*"),
2020
("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"),
@@ -23,7 +23,7 @@ class BaseApiController extends Controller with RestResourceUtil {
2323

2424
protected def JsonResponse(data: Object, code: Int) = {
2525
val jsonValue: String = toJsonString(data)
26-
new SimpleResult(header = ResponseHeader(code), body = play.api.libs.iteratee.Enumerator(jsonValue.getBytes())).as("application/json")
26+
new Result(header = ResponseHeader(code), body = play.api.libs.iteratee.Enumerator(jsonValue.getBytes())).as("application/json")
2727
.withHeaders(
2828
("Access-Control-Allow-Origin", "*"),
2929
("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"),

samples/scala-play2/project/Build.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import sbt._
22
import Keys._
3-
import play.Project._
3+
import play.Play.autoImport._
4+
import play.PlayScala
5+
import PlayKeys._
46

57
object ApplicationBuild extends Build {
68
val appName = "petstore"
@@ -11,7 +13,9 @@ object ApplicationBuild extends Build {
1113
"com.wordnik" %% "swagger-play2-utils" % "1.3.8-SNAPSHOT"
1214
)
1315

14-
val main = play.Project(appName, appVersion, appDependencies).settings(
16+
val main = Project(appName, file(".")).enablePlugins(play.PlayScala).settings(
17+
version := appVersion,
18+
libraryDependencies ++= appDependencies,
1519
resolvers := Seq(
1620
"Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository",
1721
Resolver.url("Local Ivy Repository", url("file://"+Path.userHome.absolutePath+"/.ivy2/local"))(Resolver.ivyStylePatterns),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.0
1+
sbt.version=0.13.5

0 commit comments

Comments
 (0)