package com.muyu.common.system.remote;

import com.muyu.common.core.constant.SecurityConstants;
import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.system.domain.SysEnt;
import com.muyu.common.system.domain.SysFirmUser;
import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
import com.muyu.common.system.domain.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Set;

/**
 * 用户服务
 *
 * @author muyu
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {

    /**
     * 注册用户信息
     *
     * @param sysUser 用户信息
     * @param source  请求来源
     *
     * @return 结果
     */
    @PostMapping("/user/register")
    public Result<Boolean> registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/user/companyList")
    public Result<List<SysUser>> companyList ();

    @PostMapping("/ent/list")
    public Result<List<SysEnt>> list (@RequestBody SysEnt sysEnt);

    /**
     * 获取角色数据权限
     *
     * @param user 用户
     *
     * @return 角色权限信息
     */
    @PostMapping("/permission/getRole")
    public Set<String> getRolePermission (@RequestBody SysUser user);

    /**
     * 获取菜单数据权限
     *
     * @param user 用户
     *
     * @return 菜单权限信息
     */
    @PostMapping("/permission/getMenu")
    public Set<String> getMenuPermission (@RequestBody SysUser user);
}
