package com.malk.server.xbongbong;

import com.malk.server.common.McException;
import com.malk.server.common.VenR;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 返回值配置参考McR
 */
@Data
@NoArgsConstructor
public class XBBR<T> extends VenR {

    private boolean success;

    private String code;

    private String msg;

    private T result;

    // 成功状态标记
    private final static String SUC_CODE = "1";

    /**
     * 断言错误信息
     */
    @Override
    public void assertSuccess() {
        McException.assertException(!code.equals(SUC_CODE) || !success, code, msg, "xbongbong");
    }
}
