package com.brframework.webapppatch.utils;

import com.alibaba.fastjson.JSON;
import com.brframework.commonweb.utils.ServletUtils;
import com.brframework.webapppatch.domain.RequestFlag;

/**
 * @author xu
 * @date 2019/11/14 23:18
 */
public class RequestFlagUtils {

    /**
     * 获取请求标记
     * @return
     */
    public static RequestFlag getReqeustFlag(){
        String requestFlagJson = ServletUtils.request().getHeader("request-flag");

        if(requestFlagJson == null){
            return new RequestFlag();
        }

        return JSON.parseObject(requestFlagJson, RequestFlag.class);
    }


}
