modelのregistAnimationをcreateAnimationに変えました.
AnimationJsonをつくりました.
1 parent 9595890 commit 496b8e722f5a964e365c7665ff0ecd04839f0ec8
m-mifune authored on 21 May 2021
Showing 4 changed files
View
32
src/main/java/org/ntlab/acanthus_server/entities/AnimationJson.java 0 → 100644
package org.ntlab.acanthus_server.entities;
 
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"aid",
"animationName"
})
 
//-----------------------------------------------------------------
// 作品一覧取得用のJsonクラス
 
public class AnimationJson {
@JsonProperty("aid")
private Integer aid;
 
@JsonProperty("animationName")
private String animationName;
 
 
public AnimationJson(Animation animation){
this.aid = animation.getAid();
this.animationName = animation.getName();
 
}
 
 
}
View
22
src/main/java/org/ntlab/acanthus_server/models/Gallery.java
private Gallery(){
 
}
 
 
//-----------------------------------------------------------------
// 作品をすべて返す
 
public HashMap<Integer, Animation> getMap(){return animationHashMap;}
 
//-----------------------------------------------------------------
// 1つの作品の全ての情報を返す.
 
public Animation getAnimationInformation( Integer aid){return animationHashMap.get(aid);}
 
public int registAnimation(String name, Account owner){
var newAnimation = new Animation(name, owner);
 
 
//-----------------------------------------------------------------
// 作品を作る
 
public int createAnimation(String animationName, Account owner){
var newAnimation = new Animation(animationName, owner);
var aid = new Random().nextInt();
newAnimation.setAid(aid);
animationHashMap.put(aid,newAnimation);
newAnimation.setName(animationName);
return aid;
}
 
public Animation getAnimationByAid(Integer aid) {
View
src/main/java/org/ntlab/acanthus_server/resources/accounts/WorkRest.java
View
src/main/java/org/ntlab/acanthus_server/resources/gallery/GalleryRest.java