package com.sptg.estate.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.UserFeedbackDto;
import com.sptg.estate.api.entity.UserFeedback;
import com.sptg.estate.api.feigns.fallback.UserFeedbackFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "smart-house-estate",fallbackFactory = UserFeedbackFeignFallbackFactory.class)
public interface UserFeedbackFeign {

    /**
     * 分页遍历
     * @param userFeedbackDto 查询条件
     * @return ResultBean<Page<UserFeedback>>
     */
    @PostMapping(value = "/userFeedback/pagingQuery")
    ResultBean<Page<UserFeedback>> pagingQuery(@RequestBody UserFeedbackDto userFeedbackDto);

    /**
     * 添加反馈
     * @param userFeedbackDto 反馈
     * @return
     */
    @PostMapping(value = "/userFeedback/add")
    ResultBean<Boolean> add(@RequestBody UserFeedbackDto userFeedbackDto);

    /**
     * 处理反馈
     * @param userFeedback 反馈
     * @return
     */
    @PostMapping(value = "/userFeedback/handle")
    ResultBean<Boolean> handle(@RequestBody UserFeedbackDto userFeedbackDto);

    /**
     * 获取一条反馈记录
     * @param userFeedbackDto 反馈
     * @return
     */
    @GetMapping(value = "/userFeedback/getOne")
    ResultBean<UserFeedback> getOne(@RequestBody UserFeedbackDto userFeedbackDto);

    /**
     * 根据id获取一条反馈记录
     * @param id 反馈记录id
     * @return ResultBean<UserFeedback>
     */
    @GetMapping(value = "/userFeedback/getById/{id}")
    UserFeedback getById(@PathVariable(value = "id") Long id);
}
