diff --git a/sample-bootstrap/README.md b/sample-bootstrap/README.md index 265ef876b402ea80855fcf682cf8708a4d54b776..f94da0ea7cec6f7ebd2b98d192adc4b894511ef4 100644 --- a/sample-bootstrap/README.md +++ b/sample-bootstrap/README.md @@ -8,6 +8,5 @@ - load data from default dataSource - `sureness.yml` - use default sureness config - use default `jwt auth, basic auth, digest auth` to authenticate and authorize -- contain `restful api,websocket` - project's protected entrance is `SurenessFilterExample` - suggest use postman to test, test case is in `sample-bootstrap-postman.json`, user can load it in postman diff --git a/sample-bootstrap/README_CN.md b/sample-bootstrap/README_CN.md index adb86334984ae9eda6310322c1e5870018a0a4fe..64c4a2c9d3f70a37e949e01ffd66ddc2b35c7dec 100644 --- a/sample-bootstrap/README_CN.md +++ b/sample-bootstrap/README_CN.md @@ -8,6 +8,5 @@ sureness 10分钟例子项目 - 从默认的配置文件`sureness.yml`加载账户信息,资源角色,过滤资源等信息 - 使用默认的`sureness-config` - 使用默认的`jwt auth,basic auth,digest auth`方式认证鉴权 -- 例子中包含`restful api,websocket` - 保护入口: `SurenessFilterExample` - 推荐使用`postman`测试,测试样例为`sample-bootstrap-postman.json`,导入`postman`即可 diff --git a/sample-bootstrap/pom.xml b/sample-bootstrap/pom.xml index 6510b063bb758d928c5b3b2079e852701119afbc..12d285d1a336f17551e93cd9f1d3feea0008e1da 100644 --- a/sample-bootstrap/pom.xml +++ b/sample-bootstrap/pom.xml @@ -23,36 +23,16 @@ org.springframework.boot spring-boot-starter-web - - org.springframework.boot - spring-boot-starter-websocket - org.springframework.boot spring-boot-configuration-processor true - com.usthe.sureness sureness-core - - - org.projectlombok - lombok - 1.18.6 - provided - - - - - javax.xml.bind - jaxb-api - 2.3.0 - - org.springframework.boot @@ -76,50 +56,6 @@ - - - org.apache.maven.plugins - maven-pmd-plugin - 3.8 - - - rulesets/java/ali-comment.xml - rulesets/java/ali-concurrent.xml - rulesets/java/ali-constant.xml - rulesets/java/ali-exception.xml - rulesets/java/ali-flowcontrol.xml - rulesets/java/ali-naming.xml - rulesets/java/ali-oop.xml - rulesets/java/ali-orm.xml - rulesets/java/ali-other.xml - rulesets/java/ali-set.xml - - true - false - - - - validate - validate - - check - - - - - - com.alibaba.p3c - p3c-pmd - 1.3.0 - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.0 - diff --git a/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/config/WebSocketConfig.java b/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/config/WebSocketConfig.java deleted file mode 100644 index 80fdfd6df311711d54f54698a6d77de8ad2c9547..0000000000000000000000000000000000000000 --- a/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/config/WebSocketConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.usthe.sureness.sample.bootstrap.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.socket.server.standard.ServerEndpointExporter; - -/** - * webSocket endpoint config - * @author tomsun28 - * @date 22:52 2019-05-26 - */ -@Configuration -public class WebSocketConfig { - - @Bean - public ServerEndpointExporter serverEndpointExporter() { - return new ServerEndpointExporter(); - } - -} diff --git a/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpoint.java b/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpoint.java deleted file mode 100644 index 61a40c1800ed89095216525038f847a13d5799c9..0000000000000000000000000000000000000000 --- a/sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpoint.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.usthe.sureness.sample.bootstrap.controller; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - -/** - * websocket simulate api, for testing websocket - * @author tomsun28 - * @date 22:21 2019-05-26 - */ -@Component -@ServerEndpoint(value = "/webSocket/demo") -public class WebSocketEndpoint { - - private static final Logger logger = LoggerFactory.getLogger(WebSocketEndpoint.class); - - @OnOpen - public void onOpen(Session session) { - logger.info("webSocket: /webSocket/demo onOpen, session is : {} ", session); - } - - @OnMessage - public void onMessage(String message, Session session) { - logger.info("webSocket: /webSocket/demo receive message: {}, the session is : {} ", - message, session); - } - - @OnClose - public void onClose() { - logger.info("webSocket: /webSocket/demo on Close"); - } - - @OnError - public void onError(Session session, Throwable error) { - logger.error("webSocket: /webSocket/demo on Error, the session is {} ", - session, error); - } -} diff --git a/sample-bootstrap/src/main/resources/sureness.yml b/sample-bootstrap/src/main/resources/sureness.yml index bb3909d42341f7a6f8bf6521e12ab516c95d1eb8..1a29c18f1aa9ea053be2a8333cc1e50f31b33ccd 100644 --- a/sample-bootstrap/src/main/resources/sureness.yml +++ b/sample-bootstrap/src/main/resources/sureness.yml @@ -1,4 +1,4 @@ -## -- sureness.yml txt dataSource-- ## +## -- sureness.yml document dataSource-- ## # load api resource which need be protected, config role who can access these resource. # resources that are not configured are also authenticated and protected by default, but not authorized diff --git a/sample-bootstrap/src/test/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpointTest.java b/sample-bootstrap/src/test/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpointTest.java deleted file mode 100644 index 446d436df47a1a170543dbab21ec495addd44f43..0000000000000000000000000000000000000000 --- a/sample-bootstrap/src/test/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpointTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.usthe.sureness.sample.bootstrap.controller; - -import org.junit.Test; - - -/** - * @author tomsun28 - * @date 23:01 2019-05-26 - */ -public class WebSocketEndpointTest { - - @Test - public void onOpen() { - } - - @Test - public void onMessage() { - } - - @Test - public void onClose() { - } - - @Test - public void onError() { - } - -} \ No newline at end of file