package com.docus.server.collect.basic.http;

import com.docus.infrastructure.web.api.CommonResult;
import com.docus.log.context.TrackContext;
import com.docus.server.collect.IHttpResult;
import com.docus.server.collect.web.process.VisitorProcessor;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 被动http返回响应类型，需要和controller返回类型一致
 *
 * @see BasicRestController#insertHttpPassiveBasic(String)
 * @see VisitorProcessor#doProcess(TrackContext)
 */
@Component("httpBasicResultImpl")
public class HttpBasicResultImpl implements IHttpResult {

    @Override
    public CommonResult ok(Map<String, Object> params) {
        return CommonResult.success("ok");
    }

    @Override
    public CommonResult fail(Map<String, Object> params) {
        return CommonResult.failed("fail");
    }
}
