package com.persagy.dmp.auth.client;

import com.persagy.dmp.auth.config.AuthFeignConfig;
import com.persagy.dmp.auth.domain.BossAuthMenu;
import com.persagy.dmp.auth.domain.BossAuthPermission;
import com.persagy.dmp.auth.domain.BossAuthUser;
import com.persagy.dmp.common.model.response.CommonResult;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * boss-auth服务
 * @author : lijie
 * Update By 2022/1/10 18:18
 */
@FeignClient(name = "boss-auth",fallbackFactory = BossAuthFallbackFactory.class,
        url = "${boss.auth.service:}",path = "/auth",configuration = AuthFeignConfig.class)
public interface BossAuthClient {

    /**
     * 查询登录账号个人信息（内部系统）
     * @return : com.persagy.dmp.common.model.response.CommonResult<java.lang.String>
     * @author : lijie
     * Update By 2022/1/11 10:31
     */
    @GetMapping(value = "/login/inner/loginInfo")
    @Headers({"Content-Type: application/x-www-form-urlencoded"})
    CommonResult<BossAuthUser> loginInnerLoginInfo();

    /**
     * 查询登录账号个人信息（saas系统）
     * @return : com.persagy.dmp.common.model.response.CommonResult<java.lang.String>
     * @author : lijie
     * Update By 2022/1/11 10:34
     */
    @GetMapping(value = "/login/outer/loginInfo")
    @Headers({"Content-Type: application/x-www-form-urlencoded"})
    CommonResult<BossAuthUser> loginOuterLoginInfo();

    /**
     * 查询登录账号菜单权限
     * @param websiteId : 网站id
     * @return : com.persagy.dmp.common.model.response.CommonResult<java.lang.String>  
     * @author : lijie
     * Update By 2022/1/11 10:30
     */
    @GetMapping(value = "/login/loginMenu/{websiteId}")
    @Headers({"Content-Type: application/x-www-form-urlencoded"})
    CommonResult<List<BossAuthMenu>> loginMenu(@PathVariable String websiteId);

    /**
     * 查询登录账号数据权限
     * @param websiteId : 网站id
     * @return : com.persagy.dmp.common.model.response.CommonResult<java.lang.String>  
     * @author : lijie
     * Update By 2022/1/11 10:33
     */
    @GetMapping(value = "/login/loginPermission/{websiteId}")
    @Headers({"Content-Type: application/x-www-form-urlencoded"})
    CommonResult<List<BossAuthPermission>> loginPermission(@PathVariable String websiteId);


}
