package com.vctgo.system.api;

import com.vctgo.common.core.constant.ServiceNameConstants;
import com.vctgo.common.core.domain.R;
import com.vctgo.common.core.web.domain.AjaxResult;
import com.vctgo.system.api.domain.SysTenant;
import com.vctgo.system.api.domain.dto.SysBranchKindergartenDto;
import com.vctgo.system.api.domain.dto.SysGardenManageDto;
import com.vctgo.system.api.factory.RemoteBranchKindergartenFallbackFactory;
import com.vctgo.system.api.factory.RemoteTenantFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户服务
 *
 * @author vctgo
 */
@FeignClient(contextId = "remoteBranchKindergartenService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteBranchKindergartenFallbackFactory.class)
public interface RemoteBranchKindergartenService {

    /**
     * 全量查询租户管理列表
     *
     * @return
     */
    @GetMapping("/branch/{id}")
    R<SysBranchKindergartenDto> allBranchKindergartenList(@PathVariable("id") Long id);

    /**
     * 查询幼儿园管理基本信息列表
     *
     * @return
     */
    @GetMapping("/branch/list/all")
    R<List<SysBranchKindergartenDto>> branchKindergartenAllList(@RequestParam(name = "belongRegion", required = false) String belongRegion);

    /**
     * 获取幼儿园管理基本信息详细信息
     *
     * @return
     */
    @GetMapping(value = "/branch/kindergarten/{id}")
    R<SysBranchKindergartenDto> getKindergartenInfo(@PathVariable("id") Long id);

    /**
     * 获取幼儿园Id列表
     *
     * @return
     */
    @GetMapping(value = "/branch/kindergarten")
    R<List<Long>> getKindergartenIdList(@SpringQueryMap SysBranchKindergartenDto sysBranchKindergartenDto);

    /**
     * 根据幼儿园集团ID获取幼儿园列表
     *
     * @return
     */
    @GetMapping(value = "/branch/kindergarten/list/{gardenId}")
    R<List<SysBranchKindergartenDto>> getKindergartenListByGardenId(@PathVariable("gardenId") Long gardenId);

    /**
     * 查询幼儿园集团管理列表
     *
     * @return
     */
    @GetMapping("/garden/list/all")
    R<List<SysGardenManageDto>> gardenManageList();

    /**
     * 获取幼儿园集团管理详细信息
     *
     * @return
     */
    @GetMapping(value = "/garden/gardenManage/{id}")
    R<SysGardenManageDto> getGardenManageInfo(@PathVariable("id") Long id);


    /**
     * 获取幼儿园集团Id列表
     *
     * @return
     */
    @GetMapping(value = "/garden/gardenManage")
    R<List<Long>> getGardenManageIdList(@SpringQueryMap SysGardenManageDto sysGardenManageDto);


    @GetMapping("/branch/get")
    R<List<SysBranchKindergartenDto>> get(@RequestParam(value = "provinceId", required = false) String provinceId,
                                          @RequestParam(value = "cityId", required = false) String cityId,
                                          @RequestParam(value = "districtId", required = false) String districtId);


    @PostMapping("/branch/add")
    R<Integer> add(@RequestBody SysBranchKindergartenDto sysBranchKindergartenDto);


    @GetMapping("/branch/getById/{id}")
    R<SysBranchKindergartenDto> getById(@PathVariable("id") Long id);
}
