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.factory.RemoteLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * 工作流服务
 *
 * @author JiangYuQi
 */
@FeignClient(contextId = "remoteFlowService", value = ServiceNameConstants.MANAGE_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteFlowService {

    /**
     * 保存分包单位信息
     *
     * @param data 表单信息
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/proProjectInfoSubdepts/add")
    public R<Long> addSubdeptsEntity(@RequestBody Map<String, Object> data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 保存分包单位班组信息
     *
     * @param data 表单信息
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/proProjectInfoSubdeptsGroup/add")
    public R<Long> addSubdeptsGroupEntity(@RequestBody Map<String, Object> data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 保存分包单位班组用户信息
     *
     * @param data 表单信息
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/proProjectInfoSubdeptsUsers/add")
    public R<Long> addSubdeptsUsersEntity(@RequestBody Map<String, Object> data, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
