package com.malk.server.vika;

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

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


    private int code;

    private String message;

    private boolean success;

    private T data;

    // 成功状态标记
    private final static int SUC_CODE = 200;

    /**
     * 断言错误信息
     */
    @Override
    public void assertSuccess() {
        McException.assertException(code != SUC_CODE || !isSuccess(), String.valueOf(code), message, "vika");
    }
}
