package com.sptg.pay.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.pay.api.dto.UserOrderDto;
import com.sptg.pay.api.entity.UserOrder;
import com.sptg.pay.api.feigns.fallback.UserOrderFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zwx
 * @create 2020/5/16 9:16
 */
@FeignClient(value = "smart-house-pay", fallbackFactory = UserOrderFeignFallbackFactory.class)
public interface UserOrderFeign {

    /**
     * 功能描述：分页展示用户订单记录
     * @param userOrderDto
     * @return
     */
    @PostMapping(value = "/userOrder/showUserOrderPage")
    ResultBean<Page<UserOrder>> showUserOrderPage(@RequestBody UserOrderDto userOrderDto);

    /**
     * 功能描述，获取用户订单列表
     * @param userOrderDto
     * @return
     */
    @GetMapping(value = "/userOrder/showUserOrderList")
    List<UserOrder> getUserOrderList(@RequestBody UserOrderDto userOrderDto);

    /**
     * 功能描述：添加用户订单
     * @param userOrderDto
     * @return
     */
    @PostMapping(value = "/userOrder/addUserOrder")
    ResultBean<UserOrder> addUserOrder(@RequestBody UserOrderDto userOrderDto);

    /**
     * 功能描述：更新用户订单
     * @param userOrder
     * @return
     */
    @PostMapping(value = "/userOrder/updateUserOrder")
    ResultBean<Boolean> updateUserOrder(@RequestBody UserOrder userOrder);

    /**
     * 功能描述：根据id获取用户订单
     * @param id
     * @return
     */
    @PostMapping(value = "/userOrder/findUserOrderById")
    UserOrder findUserOrderById(@RequestParam("id") Long id);

    /**
     * 功能描述：根据条件获取用户订单
     * @param userOrderDto
     * @return
     */
    @PostMapping(value = "/userOrder/findUserOrderByCondition")
    UserOrder findUserOrderByCondition(@RequestBody UserOrderDto userOrderDto);

    /**
     * 功能描述：订单支付完成
     * @param userOrder
     * @return
     */
    @PostMapping(value = "/userOrder/payFinish")
    boolean payFinish(@RequestBody UserOrder userOrder);

    /**
     * 功能描述：第三方订单查询
     * @param userOrder
     * @return
     */
    @PostMapping(value = "/userOrder/orderQuery")
    ResultBean<Boolean> orderQuery(@RequestBody UserOrderDto userOrderDto);

    @PostMapping("/userOrder/addUserOrderByImport")
    UserOrder addUserOrderByImport(@RequestBody UserOrderDto userOrderDto);

    @GetMapping(value = "/userOrder/getByOldId/{oldId}")
    UserOrder getByOldId(@PathVariable(value = "oldId") String oldId);
}
