| |
---|
| | |
---|
| | @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); |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | |
---|
| | |