package com.tax.user.service.safe.impl;


import com.yxcheng.token.common.enumutil.ResultEnum;
import com.yxcheng.token.common.model.CrRpcResult;
import com.yxcheng.token.common.model.RestfulApi;
import com.tax.user.service.safe.RestFulCheckI;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * Created by 曹小红 on 2017-04-11.
 */
@Order(4)
@Component
public class RestFulCheckVersionImpl implements RestFulCheckI {

    public static final String SYSTEM_VERSION = "1.0";

    @Override
    public boolean checkData(String data, RestfulApi apiModel, CrRpcResult<String> rpcResult) {
        if(SYSTEM_VERSION.equals(apiModel.getVersion())) {
            return true;
        } else {
            rpcResult.errorResponse(ResultEnum.verson_error);
        }
        return false;
    }
}
