| | package com.ntlab.irisserver.resources; |
---|
| | |
---|
| | import com.ntlab.irisserver.entities.Game; |
---|
| | import com.ntlab.irisserver.entities.Member; |
---|
| | import com.ntlab.irisserver.entities.Room; |
---|
| | import com.ntlab.irisserver.models.KeywordManager; |
---|
| | import com.ntlab.irisserver.models.RoomManager; |
---|
| | import org.springframework.beans.BeansException; |
---|
| | import org.springframework.context.ApplicationContextAware; |
---|
| | import org.springframework.stereotype.Component; |
---|
| | |
---|
| | import javax.ws.rs.PUT; |
---|
| | import javax.ws.rs.Path; |
---|
| | import java.io.IOException; |
---|
| | import java.util.Collections; |
---|
| | import java.util.List; |
---|
| | import java.util.Random; |
---|
| | |
---|
| | @Component |
---|
| | @Path("/rooms") |
---|
| | |
---|
| | public class TestRest { |
---|
| | public class TestRest implements ApplicationContextAware { |
---|
| | |
---|
| | private org.springframework.context.ApplicationContext applicationContext; |
---|
| | |
---|
| | public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws BeansException { |
---|
| | this.applicationContext = applicationContext; |
---|
| | } |
---|
| | |
---|
| | @PUT |
---|
| | @Path("/test") |
---|
| | public void putTestRoom(){ |
---|
| |
---|
| | infog.setBelongs("b"); |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | //drawtestの設定 |
---|
| | //両部屋:gameインスタンス作成,stateの初期化 |
---|
| | String path = null; |
---|
| | dr.setState(2); |
---|
| | dr.setState(3); |
---|
| | try { |
---|
| | path = applicationContext.getResource("file:").getFile().getAbsolutePath()+"/apache-tomcat-9.0.10/webapps/irisdata/keywords.txt"; |
---|
| | } catch (IOException e) { |
---|
| | e.printStackTrace(); |
---|
| | } |
---|
| | String[] keywords = km.getKeywords(path); |
---|
| | Game dgame = new Game(dr, keywords); |
---|
| | Game game = new Game(gr, keywords); |
---|
| | |
---|
| | //gametest部屋:絵の格納 |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |
---|
| | } |
---|
| | |