package com.yeejoin.amos.boot.module.elevator.flc.api.feign;


import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;

import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;


import com.yeejoin.amos.feign.privilege.model.VerifyCodeAuthModel;
import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;

import feign.Response;

@FeignClient(value = "AMOS-API-PRIVILEGE", configuration = {FeignConfiguration.class})
public interface PrivilegeFeginService {

    @RequestMapping(value = "/privilege/v1/agencyuser/me", method = RequestMethod.GET)
    ResponseModel<AgencyUserModel> getMe();

    //获取单位树
    @RequestMapping(value = "/privilege/v1/company/tree", method = RequestMethod.GET)
    FeignClientResult tree(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product);

    //获取省级行政区划
    @RequestMapping(value = "systemctl/v1/region/level", method = RequestMethod.GET)
    FeignClientResult getProvince(@RequestParam String level);

    //获取行政区划树
    @RequestMapping(value = "systemctl/v1/region/tree", method = RequestMethod.GET)
    FeignClientResult getTree();

    /**
     * 手机号验证码登录
     */
    @RequestMapping(value = "/privilege/v1/auth/mobile/verifycode", method = RequestMethod.POST)
    FeignClientResult mobileVerifyCode(@RequestBody VerifyCodeAuthModel model) throws InnerInvokException;

    /**
     *
     * 以流的形式下载文件
     *
     * @param path  下载文件路径，minio中存储路径（存储桶+存储文件夹+存储名称）
     * @return res
     * @throws InnerInvokException
     */
    @RequestMapping(value = "/systemctl/v1/filestorage/stream", method = RequestMethod.GET)
    Response downloadFileByStream(@RequestParam(value = "path") String path) throws InnerInvokException;
}
