package org.matrix.socket.vo;

import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * socket的返回标准版
 * @author Administrator
 */
@Data
@AllArgsConstructor
public class SocketResponseMessage {

    private int code;

    private String message;



    public static String success(String message){
        return JSONObject.toJSONString(new SocketResponseMessage(HttpStatus.HTTP_OK,message));
    }

    public static String fail(String message){
        return JSONObject.toJSONString(new SocketResponseMessage(HttpStatus.HTTP_INTERNAL_ERROR,message));
    }
}
