# 全局响应体

统一响应类:pro.haichuang.framework.base.response.ResultVO (opens new window)


👇全局响应体默认包含以下内容👇

/**
 * 错误码
 */
private String errorCode;

/**
 * 错误信息
 */
private String errorMessage;

/**
 * 用户提示信息
 */
private String userTip;
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# BaseVO (opens new window)

全限定名:pro.haichuang.framework.base.response.vo.BaseVO (opens new window)

VO基类

该类为VO基类,所有VO类继承该类

@ApiOperation("接口示例")
@ApiOperationSupport(order = 1)
@GetMapping("/test")
public BaseVO test(){
    return ResultVO.ok();
}
1
2
3
4
5
6

{
    // 错误码
    "errorCode": "00000",
    // 错误信息
    "errorMessage": "OK",
    // 用户提示信息
    "userTip": "操作成功"
}
1
2
3
4
5
6
7
8

# SingleVO (opens new window)

全限定名:pro.haichuang.framework.base.response.vo.SingleVO (opens new window)

单条数据VO

该类为单条数据VO,响应单条数据时使用此类

@ApiOperation("接口示例")
@ApiOperationSupport(order = 1)
@GetMapping("/test")
public SingleVO<T> test(){
    return ResultVO.okOfSingle([T]);
}
1
2
3
4
5
6

{
    // 错误码
    "errorCode": "00000",
    // 错误信息
    "errorMessage": "OK",
    // 用户提示信息
    "userTip": "操作成功",
    // 数据
    "data": [T]
}
1
2
3
4
5
6
7
8
9
10

# MultiVO (opens new window)

全限定名:pro.haichuang.framework.base.response.vo.MultiVO (opens new window)

多条数据VO

该类为多条数据VO,响应多条数据时使用此类

@ApiOperation("接口示例")
@ApiOperationSupport(order = 1)
@GetMapping("/test")
public MultiVO<T> test(){
    return ResultVO.okOfMulti([Collection<T>]);
}
1
2
3
4
5
6

{
    // 错误码
    "errorCode": "00000",
    // 错误信息
    "errorMessage": "OK",
    // 用户提示信息
    "userTip": "操作成功",
    // 数据
    "data": java.util.Collection[T](Default is [])
}
1
2
3
4
5
6
7
8
9
10

# PageVO (opens new window)

全限定名:pro.haichuang.framework.base.response.vo.PageVO (opens new window)

Pageable请参见Pageable

分页数据VO

该类为分页数据VO,响应分页数据时使用此类

@ApiOperation("接口示例")
@ApiOperationSupport(order = 1)
@GetMapping("/test")
public PageVO<T> test(){
    return ResultVO.okOfPage([Pageable<T>]);
}
1
2
3
4
5
6

{
    // 错误码
    "errorCode": "00000",
    // 错误信息
    "errorMessage": "OK",
    // 用户提示信息
    "userTip": "操作成功",
    // 分页详情数据 [pro.haichuang.framework.base.response.vo.PageDetailVO]
    "detail": {
      // 页码
      "pageNo": 1,
      // 每页展示数量
      "pageSize": 10,
      // 总数
      "totalCount": 0
    },
    // 数据
    "data": java.util.Collection[T](Default is [])
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# PageDetailVO (opens new window)

全限定名:pro.haichuang.framework.base.response.vo.PageDetailVO (opens new window)

分页详情数据VO

该类为分页详情数据VO,该类一般联合PageVO进行使用

该类主要用于辅助分页返回结构, 查看完整源码:pro.haichuang.framework.base.response.vo.PageDetailVO (opens new window)

Last Updated: 10/28/2021, 5:59:51 PM