-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from BakuAnimation/develop
Mise en prod 12/05
- Loading branch information
Showing
107 changed files
with
25,323 additions
and
1,845 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
micronautVersion=1.3.1 | ||
micronautVersion=1.3.4 |
11 changes: 11 additions & 0 deletions
11
back/src/main/java/com/bakuanimation/api/HistoryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.bakuanimation.api; | ||
|
||
import com.bakuanimation.model.Movie; | ||
import com.bakuanimation.model.Project; | ||
import io.reactivex.Single; | ||
|
||
public interface HistoryService { | ||
Single<Boolean> addStack(Project project, byte[] stack); | ||
|
||
Single<Movie> interpretHistory(String projectId); | ||
} |
16 changes: 16 additions & 0 deletions
16
back/src/main/java/com/bakuanimation/api/ImageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.bakuanimation.api; | ||
|
||
import com.bakuanimation.model.Movie; | ||
|
||
import javax.annotation.Nullable; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
public interface ImageService { | ||
void writeSmallerImages(String projectId, InputStream inputStream, String filename); | ||
|
||
long estimatedExportSize(Movie movie, @Nullable String shotId); | ||
|
||
void export(Movie movie, OutputStream outputStream, @Nullable String shotId) throws IOException; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.bakuanimation.api; | ||
|
||
import io.reactivex.Single; | ||
|
||
public interface IssueService { | ||
Single<Boolean> submitIssue(String title, String body); | ||
} |
18 changes: 18 additions & 0 deletions
18
back/src/main/java/com/bakuanimation/api/MovieService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.bakuanimation.api; | ||
|
||
import com.bakuanimation.model.MovieStatus; | ||
import com.bakuanimation.model.VideoState; | ||
import io.reactivex.Single; | ||
|
||
import java.nio.file.Path; | ||
|
||
public interface MovieService { | ||
// Check last modified time of movie and stack file | ||
// if not the same -> will generate a movie & lock in memory the generation | ||
// The goal is for this method to be called many time on the same project id, and the movie will only be generated once | ||
Single<VideoState> generateMovie(String projectId); | ||
|
||
Single<Path> generatePlan(String projectId, String shotId); | ||
|
||
Single<MovieStatus> status(String projectId); | ||
} |
17 changes: 17 additions & 0 deletions
17
back/src/main/java/com/bakuanimation/api/PermissionService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.bakuanimation.api; | ||
|
||
import com.bakuanimation.model.BakuEvent; | ||
import com.bakuanimation.model.Movie; | ||
import com.bakuanimation.model.Project; | ||
|
||
public interface PermissionService { | ||
boolean deleteMovie(String projectId); | ||
|
||
String getNewProjectId(); | ||
|
||
Project getProject(String projectId); | ||
|
||
void hasRight(Project project, Movie movie, BakuEvent event); | ||
|
||
String sign(String projectId) throws Exception; | ||
} |
22 changes: 22 additions & 0 deletions
22
back/src/main/java/com/bakuanimation/model/AuthorizationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.bakuanimation.model; | ||
|
||
public final class AuthorizationException extends RuntimeException{ | ||
public AuthorizationException() { | ||
} | ||
|
||
public AuthorizationException(String message) { | ||
super(message); | ||
} | ||
|
||
public AuthorizationException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public AuthorizationException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public AuthorizationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { | ||
super(message, cause, enableSuppression, writableStackTrace); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
back/src/main/java/com/bakuanimation/model/BakuAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.bakuanimation.model; | ||
|
||
public enum BakuAction { | ||
MOVIE_UPDATE_TITLE, | ||
MOVIE_UPDATE_SYNOPSIS, | ||
MOVIE_UPDATE_POSTER, | ||
MOVIE_INSERT_IMAGE, | ||
SHOT_ADD, | ||
CHANGE_FPS, | ||
MOVIE_REMOVE_IMAGE, | ||
SHOT_REMOVE, | ||
MOVIE_LOCK, | ||
SHOT_LOCK, | ||
SHOT_UPDATE_SYNOPSIS, | ||
SHOT_UPDATE_STORYBOARD, | ||
MOVIE_REVERSE_IMAGES; | ||
|
||
public static BakuAction action(int value) { | ||
switch (value) { | ||
case 0: | ||
return MOVIE_UPDATE_TITLE; | ||
case 1: | ||
return MOVIE_UPDATE_SYNOPSIS; | ||
case 2: | ||
return MOVIE_UPDATE_POSTER; | ||
case 3: | ||
return MOVIE_INSERT_IMAGE; | ||
case 4: | ||
return SHOT_ADD; | ||
case 5: | ||
return CHANGE_FPS; | ||
case 6: | ||
return MOVIE_REMOVE_IMAGE; | ||
case 7: | ||
return SHOT_REMOVE; | ||
case 8: | ||
return MOVIE_LOCK; | ||
case 9: | ||
return SHOT_LOCK; | ||
case 10: | ||
return SHOT_UPDATE_SYNOPSIS; | ||
case 11: | ||
return SHOT_UPDATE_STORYBOARD; | ||
case 12: | ||
return MOVIE_REVERSE_IMAGES; | ||
default: | ||
throw new IllegalArgumentException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.bakuanimation.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
import java.util.Objects; | ||
|
||
public final class BakuEvent { | ||
private final int action; | ||
private final JsonNode value; | ||
private final String user; | ||
private final String timestamp; | ||
|
||
@JsonCreator | ||
public BakuEvent(@JsonProperty("action") int action, | ||
@JsonProperty("value") JsonNode value, | ||
@JsonProperty("user") String user, | ||
@JsonProperty("timestamp") String timestamp) { | ||
this.action = action; | ||
this.value = value; | ||
this.user = user; | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public int getAction() { | ||
return action; | ||
} | ||
|
||
public JsonNode getValue() { | ||
return value; | ||
} | ||
|
||
public String getUser() { | ||
return user; | ||
} | ||
|
||
public String getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "BakuEvent{" + | ||
"action=" + action + | ||
", value=" + value + | ||
", user='" + user + '\'' + | ||
", timestamp='" + timestamp + '\'' + | ||
'}'; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
BakuEvent bakuEvent = (BakuEvent) o; | ||
return action == bakuEvent.action && | ||
Objects.equals(value, bakuEvent.value) && | ||
Objects.equals(user, bakuEvent.user) && | ||
Objects.equals(timestamp, bakuEvent.timestamp); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(action, value, user, timestamp); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
back/src/main/java/com/bakuanimation/model/ForbiddenOperationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.bakuanimation.model; | ||
|
||
public final class ForbiddenOperationException extends RuntimeException { | ||
public ForbiddenOperationException() { | ||
} | ||
|
||
public ForbiddenOperationException(String message) { | ||
super(message); | ||
} | ||
|
||
public ForbiddenOperationException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public ForbiddenOperationException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public ForbiddenOperationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { | ||
super(message, cause, enableSuppression, writableStackTrace); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
back/src/main/java/com/bakuanimation/model/GithubIssue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.bakuanimation.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public final class GithubIssue { | ||
private final String title; | ||
private final String body; | ||
|
||
@JsonCreator | ||
public GithubIssue(@JsonProperty("title") String title, | ||
@JsonProperty("body") String body) { | ||
this.title = title; | ||
this.body = body; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public String getBody() { | ||
return body; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.