package com.xy.service;

import com.xy.annotate.RestMappingController;
import com.xy.dto.AuthorizeDto;
import com.xy.utils.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 鉴权相关接口
 */

@RestMappingController("authorize")
public interface AuthorizeService {

    /**
     * 获取所有系统ID
     *
     * @return
     */
    @PostMapping("getSystemIds")
    R<List<Long>> getSystemIds();

    /**
     * 获取所有角色ID
     *
     * @return
     */
    @PostMapping("getRoleIds")
    R<List<Long>> getRoleIds(@RequestBody AuthorizeDto authorizeDto);

    /**
     * 获取所有角色code
     *
     * @param authorizeDto
     * @return
     */
    @PostMapping("getRoleCodes")
    R<List<String>> getRoleCodes(@RequestBody AuthorizeDto authorizeDto);

    /**
     * 是否是管理员
     *
     * @param authorizeDto
     * @return
     */
    @PostMapping("isAdmin")
    R<Boolean> isAdmin(@RequestBody AuthorizeDto authorizeDto);

    /**
     * 获取所有菜单接口uri
     *
     * @param authorizeDto
     * @return
     */
    @PostMapping("getMenuInterfaceUri")
    R<List<String>> getMenuInterfaceUri(@RequestBody AuthorizeDto authorizeDto);

    /**
     * 登录鉴权
     *
     * @return
     */
    @PostMapping("authByLogin")
    R<Boolean> authByLogin();

    /**
     * 接口鉴权
     *
     * @return
     */
    @PostMapping("authByInterface")
    R<Boolean> authByInterface(@RequestBody AuthorizeDto authorizeDto);

    /**
     * 数据鉴权
     *
     * @return
     */
    @PostMapping("authByData")
    R<Boolean> authByData(@RequestBody AuthorizeDto authorizeDto);

    /**
     * 获取登录id
     *
     * @return
     */
    @PostMapping("getLoginId")
    R<Object> getLoginId();

    /**
     * token续签
     *
     * @return
     */
    @PostMapping("renewTimeout")
    R<Boolean> renewTimeout();

    /**
     * 获取登录客户端
     *
     * @return
     */
    @PostMapping("getClientType")
    R<String> getClientType();

}
