tjx
2025-10-29 b93dbb8f077b5415a0002c66973b716f874f1953
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.gs.xiaomi.dto;
 
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
 
@Data
public class BCS101Response {
 
    @JsonProperty("header")
    private BCS101ResponseHeader header;
 
    @JsonProperty("body")
    private BCS101ResponseBody body;
 
    /**
     * 判断响应是否成功
     * @return true表示成功(code=200), false表示失败
     */
    public boolean isSuccess() {
        return header != null && header.getCode() != null && header.getCode() == 200;
    }
 
    /**
     * 获取错误描述信息
     * @return 错误描述
     */
    public String getErrorDesc() {
        return header != null ? header.getDesc() : "未知错误";
    }
}