package com.ym.mec.oa;

import com.ym.mec.common.config.FeignConfiguration;
import com.ym.mec.common.entity.*;
import com.ym.mec.oa.entity.OAUser;
import com.ym.mec.oa.fallback.OaFeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "oa-server", url = "http://localhost:8002/api/v1", configuration = FeignConfiguration.class, fallback = OaFeignServiceFallback.class)
public interface OaFeignService {

    /**
     * 用户注册
     *
     * @param oaUser
     * @return
     */
    @PostMapping(value = "/register", consumes = MediaType.APPLICATION_JSON_VALUE)
    Object register(@RequestBody OAUser oaUser);

    /**
     * 用户信息修改
     *
     * @param oaUser
     * @return
     */
    @PostMapping(value = "/updateUser", consumes = MediaType.APPLICATION_JSON_VALUE)
    Object updateUser(@RequestBody OAUser oaUser);

    /**
     * 软删除
     *
     * @param oaUser
     * @return
     */
    @PostMapping(value = "/softDelMecUser", consumes = MediaType.APPLICATION_JSON_VALUE)
    Object delUser(@RequestBody OAUser oaUser);


    /**
     * 恢复软删除的用户
     *
     * @param oaUser
     * @return
     */
    @PostMapping(value = "/reInsertMecUser", consumes = MediaType.APPLICATION_JSON_VALUE)
    Object reInsertUser(@RequestBody OAUser oaUser);

}
