package com.chinaweal.aiccs.org.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * IMS响应结果
 * @author lroyia
 * @since 2026/3/23 13:44
 **/
@Data
@ApiModel("IMS响应结果")
public class ImsResultVO implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String SUCCESS_MSG = "success";

    /**
     * 编码
     */
    @ApiModelProperty("编码")
    private String code;

    /**
     * 响应信息
     */
    @ApiModelProperty("响应信息")
    private String message;

    /**
     * 成功
     *
     * @return 信息体
     */
    public static ImsResultVO ok() {
        ImsResultVO resultVO = new ImsResultVO();
        resultVO.setCode("0");
        resultVO.setMessage(SUCCESS_MSG);
        return resultVO;
    }

    /**
     * 失败
     *
     * @param msg 失败消息
     * @return 信息体
     */
    public static ImsResultVO fail(String msg) {
        ImsResultVO resultVO = new ImsResultVO();
        resultVO.setCode("1");
        resultVO.setMessage(msg);
        return resultVO;
    }
}
