Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EncryptedFileSystem
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhangshuang
EncryptedFileSystem
Commits
bdda6d3f
提交
bdda6d3f
authored
3月 26, 2020
作者:
xc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
消失提醒
上级
03a65f95
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
213 行增加
和
43 行删除
+213
-43
AttentionDao.java
efs-bus/src/main/java/com/zjty/efs/bus/Dao/AttentionDao.java
+9
-0
NoticeDao.java
efs-bus/src/main/java/com/zjty/efs/bus/Dao/NoticeDao.java
+8
-0
AttentionController.java
...java/com/zjty/efs/bus/controller/AttentionController.java
+35
-0
NoticeController.java
...in/java/com/zjty/efs/bus/controller/NoticeController.java
+12
-24
Attention.java
efs-bus/src/main/java/com/zjty/efs/bus/entity/Attention.java
+51
-0
FileList.java
efs-bus/src/main/java/com/zjty/efs/bus/entity/FileList.java
+3
-0
Notice.java
efs-bus/src/main/java/com/zjty/efs/bus/entity/Notice.java
+4
-4
AttentionService.java
.../main/java/com/zjty/efs/bus/service/AttentionService.java
+8
-0
NoticeService.java
...src/main/java/com/zjty/efs/bus/service/NoticeService.java
+16
-7
AttentionServiceImpl.java
...a/com/zjty/efs/bus/service/impl/AttentionServiceImpl.java
+12
-0
NoticeServiceImpl.java
...java/com/zjty/efs/bus/service/impl/NoticeServiceImpl.java
+55
-8
没有找到文件。
efs-bus/src/main/java/com/zjty/efs/bus/Dao/AttentionDao.java
0 → 100644
浏览文件 @
bdda6d3f
package
com
.
zjty
.
efs
.
bus
.
Dao
;
import
com.zjty.efs.bus.entity.Attention
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
AttentionDao
extends
JpaRepository
<
Attention
,
Integer
>
{
}
efs-bus/src/main/java/com/zjty/efs/bus/Dao/NoticeDao.java
浏览文件 @
bdda6d3f
package
com
.
zjty
.
efs
.
bus
.
Dao
;
import
com.zjty.efs.bus.entity.Notice
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
NoticeDao
extends
JpaRepository
<
Notice
,
Integer
>
{
Notice
findById
(
int
id
);
Page
<
Notice
>
findOutBySenderAndType
(
int
sender
,
int
type
,
Pageable
pageable
);
}
efs-bus/src/main/java/com/zjty/efs/bus/controller/AttentionController.java
0 → 100644
浏览文件 @
bdda6d3f
package
com
.
zjty
.
efs
.
bus
.
controller
;
import
com.zjty.efs.bus.entity.Attention
;
import
com.zjty.efs.misc.config.AutoDocument
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
@AutoDocument
@Api
(
tags
=
"提醒接口"
)
@RestController
@RequestMapping
(
"/attention"
)
public
class
AttentionController
{
@ApiOperation
(
value
=
"获取提醒列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"当前登录用户"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"页码"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"条数"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
)
})
@PostMapping
(
"/getAttention"
)
public
ResponseEntity
<
Page
<
Attention
>>
test
(
@RequestParam
int
userId
,
int
pageNum
,
int
pageSize
){
return
ResponseEntity
.
ok
(
new
PageImpl
<>(
new
ArrayList
<>()));
}
}
efs-bus/src/main/java/com/zjty/efs/bus/controller/NoticeController.java
浏览文件 @
bdda6d3f
...
...
@@ -29,14 +29,6 @@ public class NoticeController {
private
NoticeService
noticeService
;
@ApiOperation
(
value
=
"测试接口"
)
@ApiImplicitParam
(
name
=
"test"
,
value
=
""
,
dataType
=
"String"
,
paramType
=
"query"
,
required
=
true
)
@PostMapping
(
"/testNotice"
)
public
ResponseEntity
test
(
@RequestParam
String
notice
){
System
.
out
.
println
(
notice
);
return
ResponseEntity
.
ok
(
true
);
}
/**
* 新增通知
* @param notice
...
...
@@ -46,8 +38,7 @@ public class NoticeController {
@ApiImplicitParam
(
name
=
"notice"
,
value
=
"通知实体"
,
dataType
=
"Notice"
,
paramType
=
"body"
,
required
=
true
)
@PostMapping
(
"/addNotice"
)
public
ResponseEntity
addNotice
(
@RequestBody
@Valid
Notice
notice
){
System
.
out
.
println
(
notice
);
return
ResponseEntity
.
ok
(
true
);
return
ResponseEntity
.
ok
(
noticeService
.
addNotice
(
notice
));
}
/**
...
...
@@ -59,8 +50,8 @@ public class NoticeController {
@ApiImplicitParam
(
name
=
"notice"
,
value
=
"通知实体"
,
dataType
=
"Notice"
,
paramType
=
"body"
,
required
=
true
)
@PutMapping
(
"/updateNotice"
)
public
ResponseEntity
updateNotice
(
@RequestBody
@Valid
Notice
notice
){
System
.
out
.
println
(
notice
);
return
ResponseEntity
.
ok
(
true
);
return
ResponseEntity
.
ok
(
noticeService
.
updateNotice
(
notice
)
);
}
@ApiOperation
(
value
=
"查看通知接口"
)
...
...
@@ -68,29 +59,26 @@ public class NoticeController {
required
=
true
,
example
=
"1"
,
dataType
=
"int"
)
@GetMapping
(
"/getNotice"
)
public
ResponseEntity
<
Notice
>
getNotice
(
@RequestParam
int
id
){
System
.
out
.
println
(
id
);
return
ResponseEntity
.
ok
(
new
Notice
());
return
ResponseEntity
.
ok
(
noticeService
.
getNotice
(
id
));
}
@GetMapping
(
"/getNoticeList"
)
@ApiOperation
(
value
=
"获取通知列表接口"
,
notes
=
"获取列表,type为通知类型,接收 0,发送 1,草稿 2,消息提醒 0"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"user"
,
value
=
"当前用户名称"
,
paramType
=
"query"
,
required
=
true
,
example
=
"username"
,
dataType
=
"
String
"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"user"
,
value
=
"当前用户名称"
,
paramType
=
"query"
,
required
=
true
,
example
=
"username"
,
dataType
=
"
int
"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"通知类型"
,
paramType
=
"query"
,
required
=
true
,
example
=
"0"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageNum"
,
value
=
"页码"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"条数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)})
public
ResponseEntity
<
List
<
Notice
>>
getNoticeList
(
@RequestParam
String
user
,
int
type
,
int
pageNum
,
int
pageSize
){
return
ResponseEntity
.
ok
(
new
ArrayList
<>()
);
public
ResponseEntity
<
Page
<
Notice
>>
getNoticeList
(
@RequestParam
int
user
,
int
type
,
int
pageNum
,
int
pageSize
){
Page
<
Notice
>
data
=
noticeService
.
getReceiveList
(
user
,
type
,
pageNum
,
pageSize
);
return
ResponseEntity
.
ok
(
data
);
}
@PutMapping
(
"/updateStatus"
)
@ApiOperation
(
value
=
"修改通知为已读"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"通知id列表"
,
paramType
=
"query"
,
required
=
true
,
allowMultiple
=
true
,
dataType
=
"int"
)})
public
ResponseEntity
updateStatus
(
@RequestParam
List
<
Integer
>
ids
){
System
.
out
.
println
(
ids
);
return
ResponseEntity
.
ok
(
true
);
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"notices"
,
value
=
"通知列表"
,
paramType
=
"body"
,
required
=
true
,
allowMultiple
=
true
,
dataType
=
"Notice"
)})
public
ResponseEntity
updateStatus
(
@RequestBody
List
<
Notice
>
notices
){
return
ResponseEntity
.
ok
(
noticeService
.
updateStatus
(
notices
));
}
}
efs-bus/src/main/java/com/zjty/efs/bus/entity/Attention.java
0 → 100644
浏览文件 @
bdda6d3f
package
com
.
zjty
.
efs
.
bus
.
entity
;
import
com.zjty.efs.misc.config.AutoDocument
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.*
;
import
java.lang.annotation.Documented
;
@AutoDocument
@ApiModel
(
value
=
"提醒"
,
description
=
"提醒实体类"
)
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
@Table
(
name
=
"attention"
)
public
class
Attention
{
/**
* id
*/
@ApiModelProperty
(
value
=
"id"
,
example
=
"1"
)
@Id
@GeneratedValue
@Column
(
name
=
"id"
)
private
int
id
;
/**
* 标题
*/
@ApiModelProperty
(
value
=
"data"
,
example
=
"您收到来自XX单位的文件,请及时查收。"
,
dataType
=
"String"
,
name
=
"提醒内容"
)
@Column
(
name
=
"data"
)
private
String
data
;
/**
* 通知编号
*/
@ApiModelProperty
(
value
=
"noticeId"
,
example
=
"1"
,
dataType
=
"int"
,
name
=
"通知编号"
)
@Column
(
name
=
"notice_id"
)
private
int
noticeId
;
/**
* 当前用户
*/
@ApiModelProperty
(
value
=
"userId"
,
example
=
"1"
,
dataType
=
"int"
,
name
=
"当前用户编号"
)
@Column
(
name
=
"user_id"
)
private
int
userId
;
}
efs-bus/src/main/java/com/zjty/efs/bus/entity/FileList.java
浏览文件 @
bdda6d3f
...
...
@@ -4,6 +4,9 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Table
;
import
java.lang.annotation.Documented
;
@AllArgsConstructor
@NoArgsConstructor
@Data
...
...
efs-bus/src/main/java/com/zjty/efs/bus/entity/Notice.java
浏览文件 @
bdda6d3f
...
...
@@ -43,16 +43,16 @@ public class Notice {
/**
* 收件人
*/
@ApiModelProperty
(
value
=
"addressee"
,
example
=
"
谢潮"
,
dataType
=
"String
"
,
name
=
"收件人"
)
@ApiModelProperty
(
value
=
"addressee"
,
example
=
"
1"
,
dataType
=
"int
"
,
name
=
"收件人"
)
@Column
(
name
=
"addressee"
)
private
String
addressee
;
private
int
addressee
;
/**
* 发件人
*/
@ApiModelProperty
(
value
=
"sender"
,
example
=
"
谢借口
"
,
dataType
=
"String"
,
name
=
"发件人"
)
@ApiModelProperty
(
value
=
"sender"
,
example
=
"
2
"
,
dataType
=
"String"
,
name
=
"发件人"
)
@Column
(
name
=
"sender"
)
private
String
sender
;
private
int
sender
;
/**
* 留言
...
...
efs-bus/src/main/java/com/zjty/efs/bus/service/AttentionService.java
0 → 100644
浏览文件 @
bdda6d3f
package
com
.
zjty
.
efs
.
bus
.
service
;
import
com.zjty.efs.bus.entity.Attention
;
import
org.springframework.data.domain.Page
;
public
interface
AttentionService
{
Page
<
Attention
>
getAttentionList
(
int
userId
,
int
pageNum
,
int
pageSize
);
}
efs-bus/src/main/java/com/zjty/efs/bus/service/NoticeService.java
浏览文件 @
bdda6d3f
...
...
@@ -2,29 +2,32 @@ package com.zjty.efs.bus.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.zjty.efs.bus.entity.Notice
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
public
interface
NoticeService
{
/**
* 新增通知
* @param jsonObject 通知
json
对象
* @param jsonObject 通知对象
* @return
*/
String
addNotice
(
Notice
jsonObject
);
boolean
addNotice
(
Notice
jsonObject
);
/**
* 修改通知
* @param jsonObject 通知
json
对象
* @param jsonObject 通知对象
* @return
*/
String
updateNotice
(
Notice
jsonObject
);
boolean
updateNotice
(
Notice
jsonObject
);
/**
* 查看通知
* @param id
* @param id
通知id
* @return
*/
String
getNotice
(
int
id
);
Notice
getNotice
(
int
id
);
/**
* 获取通知列表
...
...
@@ -34,7 +37,13 @@ public interface NoticeService {
*
* @return 通知json对象
*/
String
getReceiveList
(
String
user
,
int
type
);
Page
<
Notice
>
getReceiveList
(
int
user
,
int
type
,
int
pageNum
,
int
pageSize
);
/**
* 修改通知为已读
* @param notices 需要修改的通知实体列表
*/
boolean
updateStatus
(
List
<
Notice
>
notices
);
}
efs-bus/src/main/java/com/zjty/efs/bus/service/impl/AttentionServiceImpl.java
0 → 100644
浏览文件 @
bdda6d3f
package
com
.
zjty
.
efs
.
bus
.
service
.
impl
;
import
com.zjty.efs.bus.entity.Attention
;
import
com.zjty.efs.bus.service.AttentionService
;
import
org.springframework.data.domain.Page
;
public
class
AttentionServiceImpl
implements
AttentionService
{
@Override
public
Page
<
Attention
>
getAttentionList
(
int
userId
,
int
pageNum
,
int
pageSize
)
{
return
null
;
}
}
efs-bus/src/main/java/com/zjty/efs/bus/service/impl/NoticeServiceImpl.java
浏览文件 @
bdda6d3f
...
...
@@ -5,8 +5,16 @@ import com.zjty.efs.bus.Dao.NoticeDao;
import
com.zjty.efs.bus.entity.Notice
;
import
com.zjty.efs.bus.service.NoticeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
NoticeServiceImpl
implements
NoticeService
{
@Autowired
...
...
@@ -14,22 +22,61 @@ public class NoticeServiceImpl implements NoticeService {
@Override
public
String
addNotice
(
Notice
jsonObject
)
{
return
"成功"
;
public
boolean
addNotice
(
Notice
notice
)
{
try
{
noticeDao
.
save
(
notice
);
notice
.
setType
(
0
);
noticeDao
.
save
(
notice
);
return
true
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
false
;
}
}
@Override
public
boolean
updateNotice
(
Notice
notice
)
{
try
{
noticeDao
.
save
(
notice
);
return
true
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
false
;
}
}
@Override
public
String
updateNotice
(
Notice
jsonObject
)
{
return
null
;
public
Notice
getNotice
(
int
id
)
{
try
{
return
noticeDao
.
findById
(
id
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
null
;
}
}
@Override
public
String
getNotice
(
int
id
)
{
return
null
;
public
Page
<
Notice
>
getReceiveList
(
int
user
,
int
type
,
int
pageNum
,
int
pageSize
)
{
Pageable
pageable
=
PageRequest
.
of
(
pageNum
-
1
,
pageSize
,
Sort
.
Direction
.
DESC
,
"updateTime"
);
Page
<
Notice
>
p
=
noticeDao
.
findOutBySenderAndType
(
user
,
type
,
pageable
);
return
p
;
}
@Override
public
String
getReceiveList
(
String
user
,
int
type
)
{
return
null
;
public
boolean
updateStatus
(
List
<
Notice
>
notices
)
{
try
{
for
(
Notice
notice:
notices
){
noticeDao
.
save
(
notice
);
}
return
true
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
false
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论