zhanglin
2023-07-20 cde69bd6e9ce00b22df3690d85ea295459e3b168
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
31
32
33
34
35
36
37
38
39
40
41
package com.ruoyi.order.tools.response;
 
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class AbstractResponse {
    protected int httpStatusCode;
    protected String code;
    protected String message;
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getMessage() {
        return message;
    }
 
    public void setMessage(String message) {
        this.message = message;
    }
 
    public int getHttpStatusCode() {
        return httpStatusCode;
    }
 
    public void setHttpStatusCode(int httpStatusCode) {
        this.httpStatusCode = httpStatusCode;
    }
 
    @JsonIgnore
    public boolean isOk () {
        // 认为200内的是正常的
        return httpStatusCode >= 200 && httpStatusCode < 300;
    }
}