package com.boman.web.core.api;

import com.boman.domain.TableDataInfo;
import com.boman.domain.VaccineInfoOperation;
import com.boman.domain.constant.ServiceNameConstants;
import com.boman.domain.dto.AjaxResult;
import com.boman.domain.dto.FormDataDto;
import com.boman.domain.dto.ImportExcelDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author shiqian
 * @date 2021年04月07日 10:31
 **/
@FeignClient(contextId = "remoteObjService", value = ServiceNameConstants.WEB_CORE_SERVICE)
public interface RemoteObjService {

    /**
     * 功能描述: 根据id查找
     *
     * @param tableName tableName
     * @param pkName    pkName
     * @return com.boman.domain.dto.AjaxResult
     */
    @GetMapping("common/tableName/{tableName}/pkName/{pkName}")
    Long getMaxId(@PathVariable("tableName") String tableName, @PathVariable("pkName") String pkName);

    /**
     * 功能描述: 批量导入数据
     *
     * @param dto dto
     * @return com.boman.domain.dto.AjaxResult
     */
    @PostMapping("web-core/file/common/import")
    AjaxResult importCommonData(@RequestBody ImportExcelDto dto);

    /**
     * 功能描述: 根据表名和自定义字段查找
     *
     * @param dto dto
     * @return com.boman.domain.dto.AjaxResult
     */
    @PostMapping("common/")
    AjaxResult getByMap(@RequestBody FormDataDto dto);

    @GetMapping("core/info/list")
    TableDataInfo list(VaccineInfoOperation vaccineInfo);
}

