package com.ruoyi.common.utils.onenet;

import com.ruoyi.common.constant.HttpStatus;

public class IotUtil {

    /**
     * 消息格式化
     *
     * @param code 返回码
     * @return 结果
     */
    public static String formatMsg(String code) {
        if(HttpStatus.ERROR_CODE_DEVICE_NOT_ONLINE.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_NOT_ONLINE_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ALREADY_EXISTS.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ALREADY_EXISTS_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_NON_EXISTENT.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_NON_EXISTENT_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_SET_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_SET_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_SET_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_SET_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_QUERY_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_QUERY_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_GET_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_GET_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_SERVICE_CALL_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_SERVICE_CALL_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_DALETE_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_DESIRE_DALETE_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVIE_NEW_DATA_QUERY_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVIE_NEW_DATA_QUERY_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_HISTORY_QUERY_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_ATTRIBUTE_HISTORY_QUERY_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_EVENT_HISTORY_DATA_QUERY_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_EVENT_HISTORY_DATA_QUERY_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_DEVICE_OPERATE_RECORD_QUERY_FAIL.equals(code)){
            return HttpStatus.ERROR_CODE_DEVICE_OPERATE_RECORD_QUERY_FAIL_MSG;
        }else if(HttpStatus.ERROR_CODE_TIMEOUT.equals(code)){
            return HttpStatus.ERROR_CODE_TIMEOUT_MSG;
        }
        return "";
    }

}
