Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
68498533
提交
68498533
authored
3月 05, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码修改
上级
b9065143
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
35 行增加
和
7 行删除
+35
-7
MySuccessHandler.java
...com/zjty/tynotes/pas/config/handler/MySuccessHandler.java
+2
-1
ConfigController.java
...ava/com/zjty/tynotes/pas/controller/ConfigController.java
+7
-2
ConfigService.java
...main/java/com/zjty/tynotes/pas/service/ConfigService.java
+4
-1
ConfigServiceImpl.java
.../com/zjty/tynotes/pas/service/impl/ConfigServiceImpl.java
+7
-2
RoleServiceImpl.java
...va/com/zjty/tynotes/pas/service/impl/RoleServiceImpl.java
+15
-1
没有找到文件。
notes-pas/src/main/java/com/zjty/tynotes/pas/config/handler/MySuccessHandler.java
浏览文件 @
68498533
...
...
@@ -95,7 +95,8 @@ public class MySuccessHandler implements AuthenticationSuccessHandler {
}
}
// redisTemplate.opsForValue().set(user.getUsername(),0);
redisTemplate
.
opsForValue
().
set
(
user
.
getUsername
(),
0
);
if
((
"root"
).
equals
(
user
.
getUsername
())){
user
=
init
.
root
;
}
else
{
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/controller/ConfigController.java
浏览文件 @
68498533
...
...
@@ -32,11 +32,16 @@ public class ConfigController {
@ApiOperation
(
"保存基础参数配置"
)
@PostMapping
(
"/addConfig"
)
public
ResponseEntity
addConfig
(
@RequestBody
List
<
Config
>
configs
){
return
ok
(
configService
.
save
(
config
s
));
public
ResponseEntity
addConfig
(
@RequestBody
Config
config
){
return
ok
(
configService
.
save
(
config
));
}
@ApiOperation
(
"查询基础参数配置"
)
@GetMapping
(
"/findConfig"
)
public
ResponseEntity
findConfig
(){
return
ok
(
configService
.
findConfig
());
}
@ApiOperation
(
"获取节假日集合"
)
@GetMapping
(
"/getHoliday"
)
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/service/ConfigService.java
浏览文件 @
68498533
...
...
@@ -17,7 +17,7 @@ public interface ConfigService {
* @param configs
* @return
*/
List
<
Config
>
save
(
List
<
Config
>
configs
);
Config
save
(
Config
configs
);
/**
* 查找节假日
...
...
@@ -46,4 +46,7 @@ public interface ConfigService {
* @return
*/
List
<
Day
>
findHolidaysByMonth
(
String
date
);
Config
findConfig
();
}
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/ConfigServiceImpl.java
浏览文件 @
68498533
...
...
@@ -29,8 +29,8 @@ public class ConfigServiceImpl implements ConfigService {
private
DayDao
dayDao
;
@Override
public
List
<
Config
>
save
(
List
<
Config
>
configs
)
{
return
configDao
.
save
All
(
configs
);
public
Config
save
(
Config
configs
)
{
return
configDao
.
save
(
configs
);
}
@Override
...
...
@@ -113,4 +113,9 @@ public class ConfigServiceImpl implements ConfigService {
return
null
;
}
@Override
public
Config
findConfig
()
{
return
configDao
.
findAll
().
get
(
0
);
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/RoleServiceImpl.java
浏览文件 @
68498533
package
com
.
zjty
.
tynotes
.
pas
.
service
.
impl
;
import
com.zjty.tynotes.pas.dao.AuthorityDao
;
import
com.zjty.tynotes.pas.dao.RoleAuthorityDao
;
import
com.zjty.tynotes.pas.dao.RoleDao
;
import
com.zjty.tynotes.pas.dao.UserRoleDao
;
...
...
@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.validation.constraints.NotNull
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -32,6 +34,8 @@ public class RoleServiceImpl implements IRoleService {
private
RoleAuthorityDao
roleAuthorityDao
;
@Autowired
private
UserRoleDao
userRoleDao
;
@Autowired
private
AuthorityDao
authorityDao
;
@Override
public
Role
findRoleById
(
String
id
)
{
...
...
@@ -41,7 +45,17 @@ public class RoleServiceImpl implements IRoleService {
@Override
public
List
<
Role
>
findAll
()
{
return
roleDao
.
findAll
();
List
<
Role
>
roles
=
roleDao
.
findAll
();
for
(
Role
role
:
roles
)
{
List
<
String
>
authorityIds
=
new
ArrayList
<>();
List
<
RoleAuthority
>
roleAuthorities
=
roleAuthorityDao
.
findAllByRoleId
(
role
.
getId
());
for
(
RoleAuthority
roleAuthority
:
roleAuthorities
)
{
authorityIds
.
add
(
roleAuthority
.
getAuthorityId
());
}
List
<
Authority
>
authorities
=
authorityDao
.
findAllByIdIn
(
authorityIds
);
role
.
setAuthorities
(
authorities
);
}
return
roles
;
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论