package com.yanzhu.system.api;

import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.constant.ServiceNameConstants;
import com.yanzhu.common.core.domain.R;
import com.yanzhu.system.api.domain.SysUser;
import com.yanzhu.system.api.factory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 项目服务
 * 
 * @author JiangYuQi
 */
@FeignClient(contextId = "remoteProService", value = ServiceNameConstants.MANAGE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteProService
{

    /**
     * 项目详情
     *
     * @param id 项目主键
     * @return 结果
     */
    @GetMapping(value = "/proProjectInfo/info/{id}")
    public R<Map<String,Object>> info(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取当前用户入场项目信息
     *
     * @param userId 用户主键
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/proProjectInfoUsers/projects/{userId}")
    public R<List<Map<String, Object>>> getProjects(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
