Merge pull request #106 from nitta-lab-2021/matsu
OK!
commit 4a45dd542bb6928db21fbe9ea0abc841307f8ee5
2 parents e82cf14 + 3cb06c9
赤木元基 authored on 25 May 2021
Showing 2 changed files
View
13
src/main/java/org/ntlab/acanthus_server/resources/gallery/LayersRest.java
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
 
@Component
@Path("/gallery")
public class LayersRest {
 
/*
* 指定したレイヤー情報(順番、枚数)を獲得
* @PathParam Integer aid 作品ID
*/
@Path("/{aid}/pageMap/0/layers/0")
@GET
@Produces(MediaType.APPLICATION_JSON)
public ArrayList<Float> getLayersRest(@PathParam("aid") Integer aid) {
return null;
}
 
}
View
20
src/main/java/org/ntlab/acanthus_server/resources/gallery/StrokesRest.java
 
@Component
@Path("/gallery")
public class StrokesRest {
Position Position = new Position();
 
private Position Position = new Position();
private Stroke Test = new Stroke();
 
/*
* 1ページの1レイヤーに置ける筆跡情報を全て取得します。
* 成功時のレスポンス:strokeNo{pen, color, thickness, potions{x, y}}
@Path("/{aid}/pageMap/0/layers/0/strokes")
@GET
@Produces(MediaType.APPLICATION_JSON)
public ArrayList<HashMap<String, Integer>> getStrokeRest(@PathParam("aid") Integer aid) {
Stroke Test = new Stroke();
Test.putStroke("strokeNo", 2);
Test.putStroke("pen", 3);
Test.putStroke("color", 5);
Test.putStroke("thickness", 1);
return Test.getStrokeRest();
this.Test.putStroke("strokeNo", 2);
this.Test.putStroke("pen", 3);
this.Test.putStroke("color", 5);
this.Test.putStroke("thickness", 1);
return this.Test.getStrokeRest();
}
 
/*
* 何かを書き始めた時strokeNoを取得しペン情報、色情報、太さ情報、座標情報を追加する
@Path("/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/position")
@GET
@Produces(MediaType.APPLICATION_JSON)
public ArrayList<HashMap<String, Integer>> getPositions(@PathParam("aid") Integer aid, @PathParam("strokeNo") Integer strokeNo) {
return Position.getPosition();
return this.Position.getPosition();
}
 
/*
* 座標情報の追加
@Path("/{aid}/pageMap/0/layers/0/strokes/{strokeNo}/position")
@POST
@Produces(MediaType.APPLICATION_JSON)
public void addPositions(@PathParam("aid") Integer aid, @FormParam("x") Integer x, @FormParam("y") Integer y) {
Position.putPosition(x, y);
this.Position.putPosition(x, y);
}
}