1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| package com.ld.igds.sh.util;
|
| import com.ld.igds.sh.dto.ApiResponse;
| import com.ld.igds.sh.param.ApiRequest;
|
| /**
| * 响应封装工具类
| *
| * @author chen
| **/
| @SuppressWarnings({"unchecked", "rawtypes"})
| public class RespUtil {
|
| public static ApiResponse error(String code, String orderId) {
| return new ApiResponse(code, orderId);
| }
|
| public static ApiResponse error(String code, String orderId, Object data) {
| return new ApiResponse(code, orderId, data);
| }
|
| public static ApiResponse error(String code, ApiRequest request) {
| return new ApiResponse(code, request.getSign(), request.getOutId(), request.getOrderId(), request.getDeptId());
| }
|
| public static ApiResponse success(Object data, ApiRequest req) {
| return new ApiResponse(RespCodeEnum.CODE_0000.getCode(), req.getSign(), req.getOutId(), req.getOrderId(), req.getDeptId(), data);
| }
|
| }
|
|