Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
auth-master
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
auth-master
Commits
be9aff95
Commit
be9aff95
authored
Dec 25, 2025
by
周海峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
41cc9554
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
47 行增加
和
16 行删除
+47
-16
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsController.java
+15
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
+8
-16
src/main/java/com/metro/auth/platform/service/PlatformApplicationsService.java
+7
-0
src/main/java/com/metro/auth/platform/service/PlatformApplicationsServiceImpl.java
+17
-0
没有找到文件。
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsController.java
View file @
be9aff95
...
...
@@ -52,6 +52,21 @@ public class PlatformApplicationsController {
return
ResultJson
.
ok
(
list
);
}
/**
* 批量更新应用排序
* @param list 包含 id 与 num 字段的应用列表
* @return 操作结果
*/
@PostMapping
(
"/platformapplications/updateOrder"
)
public
ResultJson
updateOrder
(
@RequestBody
List
<
PlatformApplications
>
list
)
{
int
count
=
platformApplicationsService
.
updateOrder
(
list
);
if
(
count
>=
0
)
{
return
ResultJson
.
ok
();
}
else
{
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@GetMapping
(
"/platformapplications/listbyrole/{roleid}"
)
public
ResultJson
listbyrole
(
@PathVariable
String
roleid
){
List
<
PlatformApplications
>
list
=
platformApplicationsService
.
getPlatformApplicationsListByRole
(
roleid
);
...
...
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
View file @
be9aff95
...
...
@@ -21,10 +21,6 @@
<select
id=
"selectListByMailType"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
from platform_applications
...
...
@@ -38,10 +34,6 @@
<sql
id=
"Example_Where_Clause"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
...
...
@@ -120,9 +112,10 @@
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause} + 0
</if>
<!-- <if test="orderByClause != null">-->
<!-- order by ${orderByClause}-->
<!-- </if>-->
order by num + 0
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -315,6 +308,9 @@
<if
test=
"tishi != null"
>
tishi = #{tishi,jdbcType=INTEGER},
</if>
<if
test=
"num != null"
>
num = #{num,jdbcType=VARCHAR},
</if>
<if
test=
"appEnable != null"
>
app_enable = #{appEnable,jdbcType=VARCHAR},
</if>
...
...
@@ -338,13 +334,9 @@
<select
id=
"getPlatformApplicationsList"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select *,id value,title label
from platform_applications
order by num + 0
</select>
<select
id=
"getPlatformApplicationsListByRole"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
...
...
src/main/java/com/metro/auth/platform/service/PlatformApplicationsService.java
View file @
be9aff95
...
...
@@ -16,4 +16,11 @@ public interface PlatformApplicationsService {
List
<
PlatformApplications
>
getPlatformApplicationsList
();
List
<
PlatformApplications
>
getPlatformApplicationsListByUserid
(
String
userid
);
List
<
PlatformApplications
>
getPlatformApplicationsListByRole
(
String
id
);
/**
* 批量更新应用排序(num 字段)
* @param list 包含 id 与 num 的应用列表
* @return 更新数量
*/
int
updateOrder
(
List
<
PlatformApplications
>
list
);
}
src/main/java/com/metro/auth/platform/service/PlatformApplicationsServiceImpl.java
View file @
be9aff95
...
...
@@ -88,6 +88,23 @@ public class PlatformApplicationsServiceImpl implements PlatformApplicationsServ
}
@Override
public
int
updateOrder
(
List
<
PlatformApplications
>
list
)
{
int
updated
=
0
;
if
(
list
==
null
||
list
.
isEmpty
())
{
return
updated
;
}
for
(
PlatformApplications
item
:
list
)
{
if
(
item
.
getId
()
!=
null
)
{
PlatformApplications
record
=
new
PlatformApplications
();
record
.
setId
(
item
.
getId
());
record
.
setNum
(
item
.
getNum
());
updated
+=
platformApplicationsMapper
.
updateByPrimaryKeySelective
(
record
);
}
}
return
updated
;
}
@Override
public
List
<
PlatformApplications
>
getPlatformApplicationsListByUserid
(
String
userid
)
{
// 1. 查询所有启用的应用
PlatformApplicationsExample
example
=
new
PlatformApplicationsExample
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论