package com.yuchen.saas.manage.user.api.feign;

import com.yuchen.saas.manage.user.api.entity.UserVehicleData;
import com.yuchen.saas.manage.user.api.entity.UserVehicleWalletPaySort;
import com.yuchen.saas.manage.user.api.request.dto.*;
import com.yuchen.saas.manage.user.api.vo.UserVehicleCertificationLogVO;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName UserVehicleDataClient
 * @Description 用户车辆 feign 接口
 * @Author 张逸飞
 * @Date 2022/6/16 15:50
 */
@FeignClient(
        value = AppNameConstant.SAAS_USER,
        fallbackFactory = UserVehicleDataClientFallback.class
)
public interface UserVehicleDataClient {

    /**
     * 用户获取车辆数据分页
     * @param userDetailId 移动端用户唯一ID
     * @param current 当前页码
     * @param size 分页数量
     * @return
     */
    @GetMapping("/parking/user/vehicle/getPage")
    R getPage(@RequestParam Long userDetailId, @RequestParam Integer current, @RequestParam Integer size);

    /**
     * 用户保存车辆数据
     * @param userVehicleData 用户车辆数据
     * @return
     */
    @PostMapping("/parking/user/vehicle/save")
    R save(@RequestBody UserVehicleData userVehicleData);

    @PostMapping("/parking/user/vehicle/saveUserVehicleAuthorize")
    R saveUserVehicleAuthorize(@RequestBody UserVehicleData userVehicleData);

    /**
     * 用户保存车辆数据
     * @param userVehicleData 用户车辆数据
     * @return
     */
    @PostMapping("/parking/user/vehicle/update")
    R update(@RequestBody UserVehicleData userVehicleData);

    /**
     * 认证车辆-相关设置
     * @param reqDTO 设置数据
     * @return true/false
     */
    @PostMapping("/parking/user/vehicle/saveUserVehiclePrivacyConfig")
    R<Boolean> saveUserVehiclePrivacyConfig(@RequestBody UserVehiclePrivacyReqDTO reqDTO);

    /**
     * 变更车牌号
     * @param changePlateNoDTO 变更车牌号传参
     * @return true/false
     */
    @PostMapping("/parking/user/vehicle/updatePlateNo")
    R<Boolean> updatePlateNo(@RequestBody ChangePlateNoDTO changePlateNoDTO);

    /**
     * 判断该车牌号车辆是否已被认证并且被认证用户关闭了可代缴功能
     * @param plateNo 车牌号
     * @return true/false
     */
    @GetMapping("/parking/user/vehicle/isReplacePayJudge")
    R<Boolean> isReplacePayJudge(@RequestParam String plateNo);

    /**
     * 判断当前车牌是否被其他用户开启无感支付
     * @param dto 判断当前车牌是否被其他用户开启无感支付传参
     * @return true/false
     */
    @PostMapping("/parking/user/vehicle/senselessPayJudge")
    R<Boolean> senselessPayJudge(@RequestBody SenselessPayJudgeDTO dto);

    /**
     * 开启/关闭可代缴、个人钱包账户无感支付、优惠券无感支付、微信支付分|先享后付无感支付
     * @param dto 可代缴、无感支付传参
     * @return true/false
     */
    @PostMapping("/parking/user/vehicle/enableFunction")
    R<Boolean> enableFunction(@RequestBody UserVehicleEnableFunctionDTO dto);

    /**
     * 获取钱包无感支付数据
     * @param vehicleId 车辆数据ID
     * @return list
     */
    @GetMapping("/parking/user/vehicle/getUserVehicleWalletPaySortInfo/{vehicleId}")
    R<List<UserVehicleWalletPaySort>> getUserVehicleWalletPaySortInfo(@PathVariable Long vehicleId);

    /**
     * 用户删除车辆数据
     * @param id 车辆数据ID
     * @return
     */
    @DeleteMapping("/parking/user/vehicle/remove")
    R remove(@RequestParam String id);

    @DeleteMapping("/parking/user/vehicle/getVechicles")
    R<List<UserVehicleData>> getVechicles(@RequestParam String payUserId, @RequestParam String plateNo);


    @GetMapping ("/parking/user/vehicle/getUserCertifiedVechicle")
    R<List<UserVehicleData>> getUserCertifiedVechicle(@RequestParam Long userDetailId);

    @GetMapping("/parking/user/vehicle/getVehicleListByPlateNo")
    R<List<UserVehicleData>> getVehicleListByPlateNo(@RequestParam String plateNo);


    /**
     * @tag 1.4.0
     */
    @GetMapping("/userVehicleCertificationLog/getUserUnreadList")
    R<List<UserVehicleCertificationLogVO>> getUserUnreadList() ;

    /**
     * @tag 1.4.0
     */
    @PostMapping("/userVehicleCertificationLog/updateReadStatus")
    R<Boolean>updateReadStatus(@RequestBody UserVehicleCertificatioLogUpdateReadDTO dto) ;
}
