Commit a601218c authored by Tom Käsler's avatar Tom Käsler

merge to commands into one

parent 9f192dab
Pipeline #11799 passed with stage
in 21 seconds
......@@ -47,19 +47,13 @@ trait ContentApi extends BaseApi {
}
} ~
get {
parameters("group") { group =>
parameters("group".?) { group =>
complete {
(roomRegion ? GetContentListByRoomIdAndGroup(roomId, group))
(roomRegion ? GetContentListByRoomId(roomId, group))
.mapTo[Seq[Content]].map(_.toJson)
}
}
} ~
get {
complete {
(roomRegion ? GetContentListByRoomId(roomId))
.mapTo[Seq[Content]].map(_.toJson)
}
} ~
post {
headerValueByName("X-Session-Token") { token =>
entity(as[Content]) { content =>
......
......@@ -153,11 +153,8 @@ class RoomActor(authRouter: ActorRef) extends PersistentActor {
}
}) (sender)
case GetContentListByRoomIdAndGroup(roomId, group) => ((ret: ActorRef) => {
contentGroupActor ! SendContent(ret, Some(group))
}) (sender)
case GetContentListByRoomId(roomId) => ((ret: ActorRef) => {
contentGroupActor ! SendContent(ret, None)
case GetContentListByRoomId(roomId, group) => ((ret: ActorRef) => {
contentGroupActor ! SendContent(ret, group)
}) (sender)
case sep: RoomEventPackage => handleEvents(sep)
}
......
......@@ -30,9 +30,7 @@ object RoomCommands {
case class DeleteRoom(id: UUID, userId: UUID) extends RoomCommand
case class GetContentListByRoomId(id: UUID) extends RoomCommand
case class GetContentListByRoomIdAndGroup(id: UUID, group: String) extends RoomCommand
case class GetContentListByRoomId(id: UUID, group: Option[String]) extends RoomCommand
case class AutoSortContentGroup(id: UUID, group: String) extends RoomCommand
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment