package com.bawei.es.remote;

import com.bawei.common.core.constant.ServiceNameConstants;
import com.bawei.common.core.domain.R;
import com.bawei.es.remote.factory.EsIndexRemoteFactory;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
@FeignClient(contextId = "EsIndexRemoteService",value = ServiceNameConstants.ES_SERVICE,fallbackFactory = EsIndexRemoteFactory.class,path = "/index")
public interface EsIndexRemoteService {
    @PostMapping("/createIndex/{indexName}")
    public R createIndex(@PathVariable("indexName") String indexName, @RequestBody Map<String,Object> docMsg);
    @PostMapping("/deleteIndex/{indexName}")
    public R deleteIndex(@PathVariable("indexName") String indexName);
    @PutMapping("/updateIndex/{indexName}")
    public R updateIndex(@PathVariable("indexName") String indexName,@RequestBody Map<String,Object> docMsg);
    @GetMapping("/findIndex/{indexName}")
    public R findIndex(@PathVariable("indexName") String indexName);
    @PostMapping("/getMapping/{indexName}")
    public R getMapping(@PathVariable("indexName") String indexName);
}
