Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
my-gitflow
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
mry
my-gitflow
Commits
030d2e0f
提交
030d2e0f
authored
11月 10, 2021
作者:
mrunyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
一号添加了Message的查询
上级
f29133e0
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
78 行增加
和
1 行删除
+78
-1
README.md
README.md
+4
-0
SwaggerConfig.java
src/main/java/com/git/mygitflow/config/SwaggerConfig.java
+1
-1
MessageController.java
.../java/com/git/mygitflow/controller/MessageController.java
+35
-0
MessageDao.java
src/main/java/com/git/mygitflow/dao/MessageDao.java
+8
-0
MessageServiceImpl.java
...va/com/git/mygitflow/service/Impl/MessageServiceImpl.java
+21
-0
MessageService.java
src/main/java/com/git/mygitflow/service/MessageService.java
+9
-0
没有找到文件。
README.md
浏览文件 @
030d2e0f
# GitFlow
# GitFlow
-
根据gitflow规范,已经拉取了远程的User的基本功能
-
继续进行Message的基本功能
\ No newline at end of file
src/main/java/com/git/mygitflow/config/SwaggerConfig.java
浏览文件 @
030d2e0f
...
@@ -22,7 +22,7 @@ public class SwaggerConfig {
...
@@ -22,7 +22,7 @@ public class SwaggerConfig {
.
apiInfo
(
adminApiInfo
())
.
apiInfo
(
adminApiInfo
())
.
select
()
// 过滤器,用于实现对接口的分组,过滤掉不希望放在adminApi组的接口信息
.
select
()
// 过滤器,用于实现对接口的分组,过滤掉不希望放在adminApi组的接口信息
//只显示admin路径下的页面
//只显示admin路径下的页面
.
paths
(
Predicates
.
or
(
PathSelectors
.
regex
(
"/users.*"
)))
.
paths
(
Predicates
.
or
(
PathSelectors
.
regex
(
"/users.*"
)
,
PathSelectors
.
regex
(
"/messages.*"
)
))
.
build
();
.
build
();
}
}
...
...
src/main/java/com/git/mygitflow/controller/MessageController.java
0 → 100644
浏览文件 @
030d2e0f
package
com
.
git
.
mygitflow
.
controller
;
import
com.git.mygitflow.entity.Message
;
import
com.git.mygitflow.service.MessageService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@CrossOrigin
@RestController
@RequestMapping
(
"/messages"
)
@Api
(
tags
=
"messages的CRUD"
)
public
class
MessageController
{
@Autowired
private
MessageService
messageService
;
@GetMapping
@ApiOperation
(
value
=
"查询所有"
)
public
ResponseEntity
<
List
<
Message
>>
find
(){
List
<
Message
>
result
=
messageService
.
find
();
if
(
result
.
size
()
==
0
){
return
ResponseEntity
.
status
(
404
).
body
(
result
);
}
else
{
return
ResponseEntity
.
ok
(
result
);
}
}
}
src/main/java/com/git/mygitflow/dao/MessageDao.java
0 → 100644
浏览文件 @
030d2e0f
package
com
.
git
.
mygitflow
.
dao
;
import
com.git.mygitflow.entity.Message
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
public
interface
MessageDao
extends
JpaRepository
<
Message
,
Integer
>,
JpaSpecificationExecutor
<
Message
>
{
}
src/main/java/com/git/mygitflow/service/Impl/MessageServiceImpl.java
0 → 100644
浏览文件 @
030d2e0f
package
com
.
git
.
mygitflow
.
service
.
Impl
;
import
com.git.mygitflow.dao.MessageDao
;
import
com.git.mygitflow.entity.Message
;
import
com.git.mygitflow.service.MessageService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
MessageServiceImpl
implements
MessageService
{
@Autowired
private
MessageDao
messageDao
;
@Override
public
List
<
Message
>
find
()
{
return
messageDao
.
findAll
();
}
}
src/main/java/com/git/mygitflow/service/MessageService.java
0 → 100644
浏览文件 @
030d2e0f
package
com
.
git
.
mygitflow
.
service
;
import
com.git.mygitflow.entity.Message
;
import
java.util.List
;
public
interface
MessageService
{
List
<
Message
>
find
();
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论