Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
Sureness
提交
b6d6f9d8
Sureness
项目概览
lzh_me
/
Sureness
与 Fork 源项目一致
Fork自
sureness / Sureness
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Sureness
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b6d6f9d8
编写于
1月 23, 2021
作者:
sinat_25235033
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete unused code in sample-bootstrap, simplify the demo
上级
cf54bfec
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
1 addition
and
161 deletion
+1
-161
sample-bootstrap/README.md
sample-bootstrap/README.md
+0
-1
sample-bootstrap/README_CN.md
sample-bootstrap/README_CN.md
+0
-1
sample-bootstrap/pom.xml
sample-bootstrap/pom.xml
+0
-64
sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/config/WebSocketConfig.java
...the/sureness/sample/bootstrap/config/WebSocketConfig.java
+0
-20
sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpoint.java
...reness/sample/bootstrap/controller/WebSocketEndpoint.java
+0
-46
sample-bootstrap/src/main/resources/sureness.yml
sample-bootstrap/src/main/resources/sureness.yml
+1
-1
sample-bootstrap/src/test/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpointTest.java
...ss/sample/bootstrap/controller/WebSocketEndpointTest.java
+0
-28
未找到文件。
sample-bootstrap/README.md
浏览文件 @
b6d6f9d8
...
...
@@ -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
sample-bootstrap/README_CN.md
浏览文件 @
b6d6f9d8
...
...
@@ -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`
即可
sample-bootstrap/pom.xml
浏览文件 @
b6d6f9d8
...
...
@@ -23,36 +23,16 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-websocket
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.usthe.sureness
</groupId>
<artifactId>
sureness-core
</artifactId>
</dependency>
<!-- lombok -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.6
</version>
<scope>
provided
</scope>
</dependency>
<!-- java api-->
<dependency>
<groupId>
javax.xml.bind
</groupId>
<artifactId>
jaxb-api
</artifactId>
<version>
2.3.0
</version>
</dependency>
<!--test-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -76,50 +56,6 @@
</execution>
</executions>
</plugin>
<!-- java code style check -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-pmd-plugin
</artifactId>
<version>
3.8
</version>
<configuration>
<rulesets>
<ruleset>
rulesets/java/ali-comment.xml
</ruleset>
<ruleset>
rulesets/java/ali-concurrent.xml
</ruleset>
<ruleset>
rulesets/java/ali-constant.xml
</ruleset>
<ruleset>
rulesets/java/ali-exception.xml
</ruleset>
<ruleset>
rulesets/java/ali-flowcontrol.xml
</ruleset>
<ruleset>
rulesets/java/ali-naming.xml
</ruleset>
<ruleset>
rulesets/java/ali-oop.xml
</ruleset>
<ruleset>
rulesets/java/ali-orm.xml
</ruleset>
<ruleset>
rulesets/java/ali-other.xml
</ruleset>
<ruleset>
rulesets/java/ali-set.xml
</ruleset>
</rulesets>
<printFailingErrors>
true
</printFailingErrors>
<linkXRef>
false
</linkXRef>
</configuration>
<executions>
<execution>
<id>
validate
</id>
<phase>
validate
</phase>
<goals>
<goal>
check
</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>
com.alibaba.p3c
</groupId>
<artifactId>
p3c-pmd
</artifactId>
<version>
1.3.0
</version>
</dependency>
</dependencies>
</plugin>
<!-- java doc -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<version>
3.0.0
</version>
</plugin>
</plugins>
</build>
...
...
sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/config/WebSocketConfig.java
已删除
100644 → 0
浏览文件 @
cf54bfec
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
();
}
}
sample-bootstrap/src/main/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpoint.java
已删除
100644 → 0
浏览文件 @
cf54bfec
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
);
}
}
sample-bootstrap/src/main/resources/sureness.yml
浏览文件 @
b6d6f9d8
## -- sureness.yml
tx
t dataSource-- ##
## -- sureness.yml
documen
t 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
...
...
sample-bootstrap/src/test/java/com/usthe/sureness/sample/bootstrap/controller/WebSocketEndpointTest.java
已删除
100644 → 0
浏览文件 @
cf54bfec
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录