package com.tofly.base.api.feign;

import com.tofly.base.api.entity.MemberUser;
import com.tofly.base.api.entity.User;
import com.tofly.base.api.feign.factory.FlowableServiceFallbackFactory;
import com.tofly.common.core.constant.SecurityConstants;
import com.tofly.common.core.entity.ResultRespone;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author tuonbed
 * @date 2019/12/3  15:35
 */
@FeignClient(contextId = "flowableService",value = "tofly-flowable",fallbackFactory = FlowableServiceFallbackFactory.class)
public interface FlowableService {


    @PostMapping("/flowable/addUser")
    public ResultRespone addUser(@RequestBody User user,@RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/updateUser")
    public ResultRespone updateUser(@RequestBody User user,@RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/deleteUser")
    public ResultRespone deleteUser(@RequestBody User user, @RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/addUserGroup")
    public ResultRespone addUserGroup(@RequestBody Map map, @RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/addUserToGroup")
    public ResultRespone addUserToGroup(@RequestBody MemberUser user, @RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/deleteUserToGroup")
    public ResultRespone deleteUserToGroup(@RequestBody MemberUser user,@RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/updateGroup")
    public ResultRespone updateGroup(@RequestBody Map map,@RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/flowable/deleteGroup")
    public ResultRespone deleteGroup(@RequestParam("id") String id, @RequestHeader(SecurityConstants.FROM) String from);

    @GetMapping("/flowable/getuploadForm")
    public ResultRespone uploadForm(@RequestParam("appform") String appform, @RequestHeader(SecurityConstants.FROM) String from);

}
