build: 调整 JaCoCo 覆盖率检查配置 #7
+3
-10
@@ -1,21 +1,14 @@
|
|||||||
package cn.novalon.manage.sys.dto.request;
|
package cn.novalon.manage.sys.dto.request;
|
||||||
|
|
||||||
/**
|
import jakarta.validation.constraints.Min;
|
||||||
* 角色更新请求DTO
|
|
||||||
*
|
|
||||||
* 文件定义:用于更新角色的请求DTO对象,封装HTTP请求参数
|
|
||||||
* 涉及业务:角色管理、权限分配等场景
|
|
||||||
* 算法:支持部分字段更新,通过验证注解确保请求参数的有效性
|
|
||||||
*
|
|
||||||
* @author 张翔
|
|
||||||
* @date 2026-03-13
|
|
||||||
*/
|
|
||||||
public class RoleUpdateRequest {
|
public class RoleUpdateRequest {
|
||||||
|
|
||||||
private String roleName;
|
private String roleName;
|
||||||
|
|
||||||
private String roleKey;
|
private String roleKey;
|
||||||
|
|
||||||
|
@Min(value = 1, message = "显示顺序必须大于0")
|
||||||
private Integer roleSort;
|
private Integer roleSort;
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function RoleManagement() {
|
|||||||
try {
|
try {
|
||||||
const res = await roleApi.getAllPermissions()
|
const res = await roleApi.getAllPermissions()
|
||||||
setPermissions(Array.isArray(res) ? res : [])
|
setPermissions(Array.isArray(res) ? res : [])
|
||||||
} catch {}
|
} catch { /* ignored */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
@@ -86,7 +86,7 @@ export default function RoleManagement() {
|
|||||||
}
|
}
|
||||||
setModalOpen(false)
|
setModalOpen(false)
|
||||||
loadRoles()
|
loadRoles()
|
||||||
} catch {}
|
} catch { /* ignored */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
const permissionTreeData = buildPermissionTree(permissions)
|
const permissionTreeData = buildPermissionTree(permissions)
|
||||||
@@ -154,7 +154,7 @@ export default function RoleManagement() {
|
|||||||
open={modalOpen}
|
open={modalOpen}
|
||||||
onOk={handleSubmit}
|
onOk={handleSubmit}
|
||||||
onCancel={() => setModalOpen(false)}
|
onCancel={() => setModalOpen(false)}
|
||||||
destroyOnClose
|
destroyOnHidden
|
||||||
width={600}
|
width={600}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical">
|
<Form form={form} layout="vertical">
|
||||||
@@ -164,8 +164,8 @@ export default function RoleManagement() {
|
|||||||
<Form.Item name="roleKey" label="角色标识" rules={[{ required: true, message: '请输入角色标识' }]}>
|
<Form.Item name="roleKey" label="角色标识" rules={[{ required: true, message: '请输入角色标识' }]}>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="roleSort" label="排序" initialValue={0}>
|
<Form.Item name="roleSort" label="排序" initialValue={1} rules={[{ type: 'number' as const, min: 1, message: '排序必须大于0' }]}>
|
||||||
<InputNumber min={0} style={{ width: '100%' }} />
|
<InputNumber min={1} style={{ width: '100%' }} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="status" label="状态" initialValue={RoleStatus.ACTIVE}>
|
<Form.Item name="status" label="状态" initialValue={RoleStatus.ACTIVE}>
|
||||||
<Select options={Object.entries(roleStatusMap).map(([value, info]) => ({ label: info.label, value }))} />
|
<Select options={Object.entries(roleStatusMap).map(([value, info]) => ({ label: info.label, value }))} />
|
||||||
|
|||||||
Reference in New Issue
Block a user