Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
knowledge-platform
Commits
a3d3a68e
Commit
a3d3a68e
authored
2 years ago
by
joffinjoy
Browse files
Options
Download
Plain Diff
Merge branch 'knowlg-friday-local-v1' into knowlg-friday
parents
8529fdb3
02fa81a8
knowlg-friday
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
content-api/content-actors/src/main/scala/org/sunbird/movie/actors/MovieActor.scala
+2
-2
.../src/main/scala/org/sunbird/movie/actors/MovieActor.scala
content-api/content-service/app/controllers/v4/MovieController.scala
+2
-2
.../content-service/app/controllers/v4/MovieController.scala
content-api/content-service/app/modules/ContentModule.scala
+2
-0
content-api/content-service/app/modules/ContentModule.scala
content-api/content-service/app/utils/MovieOperations.scala
+1
-1
content-api/content-service/app/utils/MovieOperations.scala
content-api/content-service/conf/application.conf
+6
-0
content-api/content-service/conf/application.conf
content-api/content-service/conf/routes
+1
-4
content-api/content-service/conf/routes
with
14 additions
and
9 deletions
+14
-9
content-api/content-actors/src/main/scala/org/sunbird/movie/actors/MovieActor.scala
+
2
−
2
View file @
a3d3a68e
...
...
@@ -15,7 +15,7 @@ class MovieActor @Inject() (implicit oec: OntologyEngineContext) extends BaseAct
override
def
onReceive
(
request
:
Request
)
:
Future
[
Response
]
=
{
request
.
getOperation
match
{
case
"
add
Movie"
=>
add
(
request
)
case
"
create
Movie"
=>
create
(
request
)
/*
case "updateMovie" => update(request)
case "readMovie" => read(request)
...
...
@@ -26,7 +26,7 @@ class MovieActor @Inject() (implicit oec: OntologyEngineContext) extends BaseAct
}
}
def
add
(
request
:
Request
)
:
Future
[
Response
]={
def
create
(
request
:
Request
)
:
Future
[
Response
]={
RequestUtil
.
restrictProperties
(
request
)
DataNode
.
create
(
request
).
map
(
node
=>{
val
response
=
ResponseHandler
.
OK
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/app/controllers/v4/MovieController.scala
+
2
−
2
View file @
a3d3a68e
...
...
@@ -14,12 +14,12 @@ class MovieController @Inject()(@Named(ActorNames.MOVIE_ACTOR) movieActor: Actor
val
schemaName
:
String
=
"movie"
val
version
=
"1.0"
def
add
()
=
Action
.
async
{
implicit
request
=>
def
create
()
=
Action
.
async
{
implicit
request
=>
val
headers
=
commonHeaders
()
val
body
=
requestBody
()
val
movie
=
body
.
getOrDefault
(
"movie"
,
new
java
.
util
.
HashMap
()).
asInstanceOf
[
java.util.Map
[
String
,
AnyRef
]]
movie
.
putAll
(
headers
)
val
movieRequest
=
getRequest
(
movie
,
headers
,
MovieOperations
.
add
Movie
.
toString
)
val
movieRequest
=
getRequest
(
movie
,
headers
,
MovieOperations
.
create
Movie
.
toString
)
setRequestContext
(
movieRequest
,
version
,
objectType
,
schemaName
)
getResult
(
ApiId
.
ADD_MOVIE
,
movieActor
,
movieRequest
)
}
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/app/modules/ContentModule.scala
+
2
−
0
View file @
a3d3a68e
...
...
@@ -4,6 +4,7 @@ import com.google.inject.AbstractModule
import
org.sunbird.channel.actors.ChannelActor
import
org.sunbird.collectioncsv.actors.CollectionCSVActor
import
org.sunbird.content.actors.
{
AppActor
,
AssetActor
,
CategoryActor
,
CollectionActor
,
ContentActor
,
EventActor
,
EventSetActor
,
HealthActor
,
LicenseActor
,
ObjectActor
}
import
org.sunbird.movie.actors.MovieActor
import
play.libs.akka.AkkaGuiceSupport
import
utils.ActorNames
...
...
@@ -24,6 +25,7 @@ class ContentModule extends AbstractModule with AkkaGuiceSupport {
bindActor
(
classOf
[
AppActor
],
ActorNames
.
APP_ACTOR
)
bindActor
(
classOf
[
ObjectActor
],
ActorNames
.
OBJECT_ACTOR
)
bindActor
(
classOf
[
CollectionCSVActor
],
ActorNames
.
COLLECTION_CSV_ACTOR
)
bindActor
(
classOf
[
MovieActor
],
ActorNames
.
MOVIE_ACTOR
)
println
(
"Initialized application actors..."
)
// $COVERAGE-ON
}
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/app/utils/MovieOperations.scala
+
1
−
1
View file @
a3d3a68e
package
utils
object
MovieOperations
extends
Enumeration
{
val
add
Movie
=
Value
val
create
Movie
=
Value
}
This diff is collapsed.
Click to expand it.
content-api/content-service/conf/application.conf
+
6
−
0
View file @
a3d3a68e
...
...
@@ -107,6 +107,12 @@ akka {
nr
-
of
-
instances
=
10
dispatcher
=
actors
-
dispatcher
}
/
movieActor
{
router
=
smallest
-
mailbox
-
pool
nr
-
of
-
instances
=
10
dispatcher
=
actors
-
dispatcher
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
content-api/content-service/conf/routes
+
1
−
4
View file @
a3d3a68e
...
...
@@ -132,7 +132,4 @@ GET /collection/v4/export/:collectionId controllers.v4.CollectionCon
POST /collection/v4/review/:identifier controllers.v4.CollectionController.review(identifier:String)
# Movie V4 APIs
//add
//Update
//Delete
//Read
\ No newline at end of file
POST /movie/v4/create controllers.v4.MovieController.create
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets