package ink.wgink.module.wechat.pay.pojo.v3;

/**
 * @ClassName: ErrorResponse
 * @Description: 错误返回
 * @Author: wanggeng
 * @Date: 2021/8/19 6:02 下午
 * @Version: 1.0
 */
public class PayErrorResponse {

    private String code;
    private String message;
    private Detail detail;

    public String getCode() {
        return code == null ? "" : code.trim();
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message == null ? "" : message.trim();
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Detail getDetail() {
        return detail;
    }

    public void setDetail(Detail detail) {
        this.detail = detail;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"code\":\"")
                .append(code).append('\"');
        sb.append(",\"message\":\"")
                .append(message).append('\"');
        sb.append(",\"detail\":")
                .append(detail);
        sb.append('}');
        return sb.toString();
    }

    public static class Detail {
        private String field;
        private String value;
        private String issue;
        private String location;

        public String getField() {
            return field == null ? "" : field.trim();
        }

        public void setField(String field) {
            this.field = field;
        }

        public String getValue() {
            return value == null ? "" : value.trim();
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getIssue() {
            return issue == null ? "" : issue.trim();
        }

        public void setIssue(String issue) {
            this.issue = issue;
        }

        public String getLocation() {
            return location == null ? "" : location.trim();
        }

        public void setLocation(String location) {
            this.location = location;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"field\":\"")
                    .append(field).append('\"');
            sb.append(",\"value\":\"")
                    .append(value).append('\"');
            sb.append(",\"issue\":\"")
                    .append(issue).append('\"');
            sb.append(",\"location\":\"")
                    .append(location).append('\"');
            sb.append('}');
            return sb.toString();
        }
    }

}
