Merge remote-tracking branch 'origin/main'

This commit is contained in:
houwei 2024-06-24 10:00:01 +08:00
commit 936264d43a

View File

@ -174,47 +174,27 @@
## 2.1、新增菜单 ## 2.1、新增菜单
```java ```java
@PostMapping("/api/menus/add") 请求接口 /api/menus/add
public ResponseEntity<?> createMenu(@RequestBody MenuDto menuDto) {
// 处理菜单的创建逻辑
// ...
}
``` ```
入参定义 入参定义
```java ```json
import lombok.Data;
import java.io.Serializable;
@Data {
public class MenuDto implements Serializable { "id": "123",
/** 菜单ID */ "menuName": "菜单1",
private Long id ; "menuOrder": 1,
/** 菜单名称 */ "menuIcon": "icon1",
private String menuName ; "funType": 1,
/** 菜单排列顺序 */ "funParam": "param",
private Integer menuOrder ; "authorityId": "123",
/** 菜单图标名称 */ "parentMenuId": "0",
private String menuIcon ; "revision": 1,
/** 菜单操作类型 */ "createdBy": "aaa",
private Integer funType ; "createdTime": 123456,
/** 菜单操作参数 */ "updatedBy": "aaa",
private String funParam ; "updatedTime": 12345
/** 权限ID */
private Long authorityId ;
/** 上级菜单ID */
private Long parentMenuId ;
/** 乐观锁 */
private Integer revision ;
/** 创建人 */
private String createdBy ;
/** 创建时间 */
private Date createdTime ;
/** 更新人 */
private String updatedBy ;
/** 更新时间 */
private Date updatedTime ;
} }
``` ```
@ -246,26 +226,15 @@ public class MenuDto implements Serializable {
## 2.2、查询菜单 ## 2.2、查询菜单
```java ```java
@PostMapping("/api/menus/query") 请求接口 /api/menus/query
public ResponseEntity<?> queryMenus(@RequestBody MenuQueryDto menuQueryDto) {
// 处理查询逻辑并返回菜单列表
// ...
return ResponseEntity.ok(menus); // 假设menus是查询结果列表
}
``` ```
入参定义 入参定义
```java ```json
import lombok.Data; {
import java.io.Serializable; "id": "123",
"parentMenuId": "0"
@Data
public class MenuQueryDto implements Serializable {
/** 菜单ID */
private Long id ;
/** 上级菜单ID */
private Long parentMenuId ;
} }
``` ```
@ -299,63 +268,59 @@ public class MenuQueryDto implements Serializable {
## 2.3、更新菜单 ## 2.3、更新菜单
```java ```java
@PostMapping("/api/menus/update") 请求接口
public ResponseEntity<?> updateMenu(@RequestBody MenuUpdateDto menuUpdateDto) { /api/menus/update
// 验证ID并处理菜单的更新逻辑
// ...
return ResponseEntity.ok().build();
}
// MenuUpdateDto 示例 ```
public class MenuUpdateDto {
/** 菜单ID */ 入参定义
private Long id ; ```json
/** 菜单名称 */ {
private String menuName ; "id": "123",
/** 菜单排列顺序 */ "menuName": "菜单1",
private Integer menuOrder ; "menuOrder": 1,
/** 菜单图标名称 */ "menuIcon": "icon1",
private String menuIcon ; "funType": 1,
/** 菜单操作类型 */ "funParam": "param",
private Integer funType ; "authorityId": "123",
/** 菜单操作参数 */ "parentMenuId": "0",
private String funParam ; "revision": 1
/** 权限ID */
private Long authorityId ;
/** 上级菜单ID */
private Long parentMenuId ;
/** 乐观锁 */
private Integer revision ;
/** 创建人 */
private String createdBy ;
/** 创建时间 */
private Date createdTime ;
/** 更新人 */
private String updatedBy ;
/** 更新时间 */
private Date updatedTime ;
} }
``` ```
调用成功返回示例
```json
{
"code":"200",
"msg":"更新成功",
"data":"null",
"success": true
}
```
## 2.4、删除菜单 ## 2.4、删除菜单
```java ```java
@PostMapping("/api/menus/delete") 请求接口 /api/menus/delete
public ResponseEntity<?> deleteMenu(@RequestBody MenuDeleteDto menuDeleteDto) { ```
// 验证ID并处理菜单的删除逻辑 入参定义
// ... ```json
return ResponseEntity.noContent().build(); {
} "id": ""
// MenuDeleteDto 示例
public class MenuDeleteDto {
/** 菜单ID */
private Long id;
} }
``` ```
调用成功返回示例
```json
{
"code":"200",
"msg":"成功",
"data":"null",
"success": true
}
```
@ -563,9 +528,7 @@ public class MenuDeleteDto {
调用成功返回示例 调用成功返回示例
```json
```
{ {
"code":"200", "code":"200",
"msg":"修改成功", "msg":"修改成功",
@ -584,7 +547,7 @@ public class MenuDeleteDto {
入参示例 入参示例
``` ```json
{ {
"id":"111" "id":"111"
} }
@ -598,7 +561,7 @@ public class MenuDeleteDto {
调用成功返回示例 调用成功返回示例
``` ```json
{ {
"code":"200", "code":"200",
"msg":"修改成功", "msg":"修改成功",
@ -630,7 +593,7 @@ public class MenuDeleteDto {
入参示例 入参示例
``` ```json
{ {
"userName":"xx", "userName":"xx",
"orgId":"xxx", "orgId":"xxx",
@ -688,7 +651,7 @@ public class MenuDeleteDto {
入参示例 入参示例
``` ```json
{ {
"account": "xxx", "account": "xxx",
"password": "xxx", "password": "xxx",
@ -712,7 +675,7 @@ public class MenuDeleteDto {
调用成功返回示例 调用成功返回示例
``` ```json
{ {
"code":"200", "code":"200",
"msg":"创建成功", "msg":"创建成功",
@ -731,7 +694,7 @@ public class MenuDeleteDto {
``` ```json
{ {
"id":"xxx", "id":"xxx",
"account": "xxx", "account": "xxx",
@ -757,7 +720,7 @@ public class MenuDeleteDto {
调用成功返回示例 调用成功返回示例
``` ```json
{ {
"code":"200", "code":"200",
"msg":"修改成功", "msg":"修改成功",
@ -774,7 +737,7 @@ public class MenuDeleteDto {
入参示例 入参示例
``` ```json
{ {
"id":"123" "id":"123"
} }
@ -788,7 +751,7 @@ public class MenuDeleteDto {
调用成功返回示例 调用成功返回示例
``` ```json
{ {
"code":"200", "code":"200",
"msg":"修改成功", "msg":"修改成功",