OSDN Git Service

Refactoring the packages
authoruyaji <yuichiro.uyama@gmail.com>
Mon, 9 Sep 2013 08:01:49 +0000 (17:01 +0900)
committeruyaji <yuichiro.uyama@gmail.com>
Mon, 9 Sep 2013 08:01:49 +0000 (17:01 +0900)
12 files changed:
PartsList/PartsList/app/controllers/Application.scala
PartsList/PartsList/app/controllers/NotifyController.scala
PartsList/PartsList/app/controllers/PartsListController.scala
PartsList/PartsList/app/controllers/PartsMasterController.scala
PartsList/PartsList/app/controllers/ReplyController.scala
PartsList/PartsList/app/controllers/services/Recursion.scala [moved from PartsList/PartsList/app/utils/Recursion.scala with 97% similarity]
PartsList/PartsList/app/infra/services/SendMail.scala [moved from PartsList/PartsList/app/utils/SendMail.scala with 98% similarity]
PartsList/PartsList/app/models/services/AtachManager.scala [moved from PartsList/PartsList/app/services/AtachManager.scala with 96% similarity]
PartsList/PartsList/app/models/services/PartManager.scala [moved from PartsList/PartsList/app/services/PartManager.scala with 94% similarity]
PartsList/PartsList/app/models/services/ProjectManager.scala [moved from PartsList/PartsList/app/services/ProjectManager.scala with 89% similarity]
PartsList/PartsList/app/views/uploadTestForm.scala.html [deleted file]
PartsList/PartsList/conf/routes

index a930f8b..43bb019 100644 (file)
@@ -13,40 +13,7 @@ import org.squeryl.PrimitiveTypeMode._
 object Application extends Controller {
   
   def index = Action { implicit request =>
-    Ok(views.html.index("Your new application is not ready."))
+    Ok(views.html.index("Your new application is ready."))
   }
-  
-  def picture = Action {
-    Ok(views.html.uploadTestForm())
-  }
-  
-  def upload = Action(parse.multipartFormData) { request =>
-      inTransaction {
-    request.body.file("picture").map { picture =>
-      val filename = picture.filename
-      val contentType = picture.contentType
-      var atach = Messages("atach.folder")
-      if(!atach.endsWith("/")) {atach = atach.concat("/")}
-      val url = atach + filename
-      picture.ref.moveTo(new File(url), true)
-      PartsListDb.atachs.insert(Atach(contentType.get, filename, "AAA", 1))
-      
-      Ok("File upload -- " + filename + " -- "+ contentType.get)
-    }.getOrElse{
-      Redirect(routes.Application.index).flashing(
-          "error" -> "Missing file"
-       )
-    }
-     }
-  }
-  
-  def show = Action {
-    val file = new File("/home/uyaji/git/Relation/PartsList/attach/picture.jpg")
-    val data = new Array[Byte](file.length().asInstanceOf[Int])
-    val io = new FileInputStream(file)
-    io.read(data)
-    io.close()
-    Ok(data).as("image/jpeg")
-  }
-  
-}
+}
\ No newline at end of file
index e3bc6a7..ad0404f 100644 (file)
@@ -8,9 +8,9 @@ import play.api.data.Forms._
 import play.api.data.validation.Constraints._
 import forms._
 import models._
-import utils._
+import models.services._
+import infra.services._
 import beans._
-import services._
 import org.squeryl._
 import org.squeryl.PrimitiveTypeMode._
 import scala.collection.mutable.ArrayBuffer
index 4bb7fde..e2ba03b 100644 (file)
@@ -9,10 +9,11 @@ import org.squeryl._
 import org.squeryl.PrimitiveTypeMode._
 import views._
 import models._
+import models.services._
 import beans._
 import forms._
-import utils._
-import services._
+import controllers.services._
+import models.services._
 import scala.collection.mutable.ArrayBuffer
 
 object PartsListController extends Controller{
index 12b2ed3..078e5ea 100644 (file)
@@ -7,6 +7,7 @@ import play.api.data._
 import play.api.data.Forms._
 import forms._
 import models._
+import models.services._
 import beans._
 import services._
 import org.squeryl._
index ada654e..65d8f6e 100644 (file)
@@ -5,8 +5,8 @@ import play.api.data._
 import play.api.data.Forms._
 import forms._
 import models._
-import utils._
-import services._
+import models.services._
+import infra.services._
 import org.squeryl._
 import org.squeryl.PrimitiveTypeMode._
 import scala.collection.mutable.ArrayBuffer
@@ -1,4 +1,4 @@
-package utils
+package controllers.services
 import models._
 import beans._
 import scala.collection.mutable.ArrayBuffer
@@ -1,4 +1,4 @@
-package utils
+package infra.services
 import play.api.mvc._
 import play.api._
 import play.api.i18n._
@@ -1,4 +1,4 @@
-package services
+package models.services
 import models._
 import play.api.i18n._
 import play.api.mvc.MultipartFormData.FilePart
@@ -1,6 +1,7 @@
-package services
+package models.services
 import models._
 import forms._
+import models.services._
 import org.squeryl._
 import org.squeryl.PrimitiveTypeMode._
 
diff --git a/PartsList/PartsList/app/views/uploadTestForm.scala.html b/PartsList/PartsList/app/views/uploadTestForm.scala.html
deleted file mode 100644 (file)
index b9002ac..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-@import helper._
-@main("Upload Part by Play 2.1") {
-       @form(action = routes.Application.upload, 'enctype -> "multipart/form-data") {
-               <input type="file" name="picture">
-               <p>
-                       <input type="submit">
-               </p>
-               <br />
-       }
-}
\ No newline at end of file
index b741b58..e15446d 100644 (file)
@@ -55,9 +55,6 @@ GET            /partDelete/:id                                 controllers.PartsMasterController.partDelete(id:Long)
 GET             /relationDelete/:parentName/:childName                          controllers.PartsListController.relationDelete(parentName:String, childName:String)
 GET             /showAtach                                      controllers.AtachController.showAtach(id:Long)
 GET             /dropAtach                                      controllers.AtachController.dropAtach(id:Long)
-GET             /picture                                                controllers.Application.picture
-POST    /upload                                                 controllers.Application.upload
-GET             /show                                                   controllers.Application.show
 GET             /projectAutocomple                      controllers.Autocomplete.projectList()
 GET             /partAutocomplete                       controllers.Autocomplete.partList()
 GET             /userAutocomplete                       controllers.Autocomplete.userList()