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
691059d5
Commit
691059d5
authored
Nov 02, 2025
by
周海峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用分组管理
parent
118b306a
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
73 行增加
和
9 行删除
+73
-9
doc/sql/update.sql
+6
-3
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsGroupController.java
+12
-0
src/main/java/com/metro/auth/platform/domain/ResultCode.java
+2
-1
src/main/java/com/metro/auth/platform/domain/auth/PlatformApplications.java
+12
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsGroupMapper.java
+3
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsGroupMapper.xml
+18
-0
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
+8
-4
src/main/java/com/metro/auth/platform/service/PlatformApplicationsGroupService.java
+3
-0
src/main/java/com/metro/auth/platform/service/PlatformApplicationsGroupServiceImpl.java
+9
-1
没有找到文件。
doc/sql/update.sql
View file @
691059d5
-- 添加分组菜单
INSERT
INTO
`platform_auth`
.
`platform_sys_menu`
(
`id`
,
`parentId`
,
`path`
,
`icon`
,
`title`
,
`name`
,
`leftMemu`
,
`functionCode`
,
`isLock`
,
`sort`
,
`webtype`
)
VALUES
(
'1482f54ad33a4266a3528cc2b7924a25'
,
'7'
,
'/platformapplicationsGroup'
,
'group'
,
'应用分组'
,
'platformapplicationsGroup'
,
'true'
,
'platformapplicationsGroup'
,
NULL
,
'1'
,
NULL
);
VALUES
(
'0452516c476b497d9fa0efd615e1434e'
,
'7'
,
'/platformapplicationsGroupManager'
,
'group_work'
,
'应用分组管理'
,
'groupManager'
,
'true'
,
'platformapplicationsGroupManager'
,
NULL
,
'111'
,
NULL
);
ALTER
TABLE
`platform_auth`
.
`platform_applications`
ADD
COLUMN
`group_code`
varchar
(
20
)
NULL
COMMENT
'分组编码'
AFTER
`mailtype`
;
ALTER
TABLE
`platform_auth`
.
`platform_applications`
ADD
COLUMN
`wechat_url`
varchar
(
255
)
NULL
COMMENT
'企业微信入口'
AFTER
`group_code`
;
\ No newline at end of file
src/main/java/com/metro/auth/platform/controller/PlatformApplicationsGroupController.java
View file @
691059d5
...
...
@@ -57,4 +57,16 @@ public class PlatformApplicationsGroupController {
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@PostMapping
(
"/updateSortIndex"
)
public
ResultJson
updateSortIndex
(
@RequestBody
List
<
PlatformApplicationsGroup
>
list
)
{
int
count
=
platformApplicationsGroupService
.
batchUpdateByPrimaryKey
(
list
);
if
(
count
>
0
)
{
return
ResultJson
.
ok
();
}
else
{
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
}
src/main/java/com/metro/auth/platform/domain/ResultCode.java
View file @
691059d5
...
...
@@ -20,7 +20,8 @@ public enum ResultCode {
OPERATE_ERROR
(
405
,
"操作失败,请求操作的资源不存在"
),
TIME_OUT
(
408
,
"请求超时"
),
SERVER_ERROR
(
500
,
"服务器内部错误"
),
RESPONSE_ERROR
(
0
,
"网络原因操作失败!"
)
RESPONSE_ERROR
(
0
,
"网络原因操作失败!"
),
BUSINESS_ERROR
(
409
,
"业务验证失败!"
)
;
private
final
int
code
;
...
...
src/main/java/com/metro/auth/platform/domain/auth/PlatformApplications.java
View file @
691059d5
...
...
@@ -102,6 +102,18 @@ public class PlatformApplications implements Serializable {
private
String
mailtype
;
private
String
groupCode
;
/**
* 企业微信入口
*/
private
String
wechatUrl
;
public
String
getWechatUrl
()
{
return
wechatUrl
;
}
public
void
setWechatUrl
(
String
wechatUrl
)
{
this
.
wechatUrl
=
wechatUrl
;
}
public
String
getGroupCode
()
{
return
groupCode
;
...
...
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsGroupMapper.java
View file @
691059d5
...
...
@@ -55,4 +55,6 @@ public interface PlatformApplicationsGroupMapper {
* @mbggenerated
*/
int
updateByPrimaryKey
(
PlatformApplicationsGroup
record
);
int
batchUpdateByPrimaryKey
(
List
<
PlatformApplicationsGroup
>
list
);
}
\ No newline at end of file
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsGroupMapper.xml
View file @
691059d5
...
...
@@ -140,4 +140,21 @@
update_by = #{updateBy,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<!-- 批量更新-->
<update
id=
"batchUpdateByPrimaryKey"
parameterType=
"java.util.List"
>
UPDATE platform_applications_group
SET
sort_index = CASE id
<foreach
collection=
"list"
item=
"item"
index=
"index"
>
WHEN #{item.id} THEN #{item.sortIndex}
</foreach>
END
WHERE
id IN
<foreach
collection=
"list"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
src/main/java/com/metro/auth/platform/mapper/PlatformApplicationsMapper.xml
View file @
691059d5
...
...
@@ -15,6 +15,7 @@
<result
column=
"openmail"
jdbcType=
"INTEGER"
property=
"openmail"
/>
<result
column=
"mailtype"
jdbcType=
"VARCHAR"
property=
"mailtype"
/>
<result
column=
"group_code"
jdbcType=
"VARCHAR"
property=
"groupCode"
/>
<result
column=
"wechat_url"
jdbcType=
"VARCHAR"
property=
"wechatUrl"
/>
</resultMap>
...
...
@@ -109,7 +110,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, title, img, href, addtime, tishi, databasename, databasepassword, databasecon, qyflag, appid, secret,
openmail, mailtype, group_code
openmail, mailtype, group_code
, wechat_url
</sql>
<select
id=
"selectByExample"
parameterType=
"com.metro.auth.platform.domain.auth.PlatformApplicationsExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -160,14 +161,16 @@
</delete>
<insert
id=
"insert"
parameterType=
"com.metro.auth.platform.domain.auth.PlatformApplications"
>
insert into platform_applications (id, title, img,
href, addtime, tishi,databasename,databasepassword,databasecon,qyflag,appid,secret,openmail,mailtype,group_code
href, addtime, tishi,databasename,databasepassword,
databasecon,qyflag,appid,secret,openmail,mailtype,
group_code, wechat_url
)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR},
#{href,jdbcType=VARCHAR}, #{addtime,jdbcType=VARCHAR}, #{tishi,jdbcType=INTEGER},
#{databasename,jdbcType=VARCHAR}, #{databasepassword,jdbcType=VARCHAR}, #{databasecon,jdbcType=VARCHAR},
#{qyflag,jdbcType=VARCHAR},
#{appid,jdbcType=VARCHAR},#{secret,jdbcType=VARCHAR},#{openmail,jdbcType=INTEGER},
#{mailtype,jdbcType=VARCHAR},#{groupCode,jdbcType=VARCHAR}
#{mailtype,jdbcType=VARCHAR},#{groupCode,jdbcType=VARCHAR}
, #{wechatUrl,jdbcType=VARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.metro.auth.platform.domain.auth.PlatformApplications"
>
...
...
@@ -280,7 +283,8 @@
qyflag = #{record.qyflag,jdbcType=VARCHAR},
openmail = #{record.openmail,jdbcType=INTEGER},
mailtype = #{record.mailtype,jdbcType=VARCHAR},
group_code = #{record.groupCode,jdbcType=VARCHAR}
group_code = #{record.groupCode,jdbcType=VARCHAR},
wechat_url = #{record.wechatUrl,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
src/main/java/com/metro/auth/platform/service/PlatformApplicationsGroupService.java
View file @
691059d5
...
...
@@ -57,4 +57,7 @@ public interface PlatformApplicationsGroupService {
* @mbggenerated
*/
int
updateByPrimaryKey
(
PlatformApplicationsGroup
record
);
int
batchUpdateByPrimaryKey
(
List
<
PlatformApplicationsGroup
>
list
);
}
src/main/java/com/metro/auth/platform/service/PlatformApplicationsGroupServiceImpl.java
View file @
691059d5
package
com
.
metro
.
auth
.
platform
.
service
;
import
com.metro.auth.platform.domain.ResultCode
;
import
com.metro.auth.platform.domain.ResultJson
;
import
com.metro.auth.platform.domain.auth.PlatformApplications
;
import
com.metro.auth.platform.domain.auth.PlatformApplicationsGroup
;
import
com.metro.auth.platform.exception.CustomException
;
import
com.metro.auth.platform.mapper.PlatformApplicationsGroupMapper
;
import
com.metro.auth.platform.mapper.PlatformApplicationsMapper
;
import
com.metro.auth.platform.utils.DateUtil
;
...
...
@@ -27,7 +30,7 @@ public class PlatformApplicationsGroupServiceImpl implements PlatformApplication
List
<
PlatformApplications
>
platformApplicationsList
=
platformApplicationsMapper
.
getPlatformApplicationsList
();
if
(!
CollectionUtils
.
isEmpty
(
platformApplicationsList
)
&&
platformApplicationsList
.
stream
().
anyMatch
(
app
->
platformApplicationsGroup
.
getGroupCode
().
equals
(
app
.
getGroupCode
())))
{
throw
new
RuntimeException
(
"该分组下存在应用,不能删除!"
);
throw
new
CustomException
(
ResultJson
.
failure
(
ResultCode
.
BUSINESS_ERROR
,
"该分组下存在应用,不能删除!"
)
);
}
return
platformApplicationsGroupMapper
.
deleteByPrimaryKey
(
id
);
}
...
...
@@ -75,4 +78,9 @@ public class PlatformApplicationsGroupServiceImpl implements PlatformApplication
public
int
updateByPrimaryKey
(
PlatformApplicationsGroup
record
)
{
return
platformApplicationsGroupMapper
.
updateByPrimaryKey
(
record
);
}
@Override
public
int
batchUpdateByPrimaryKey
(
List
<
PlatformApplicationsGroup
>
list
){
return
platformApplicationsGroupMapper
.
batchUpdateByPrimaryKey
(
list
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论