package com.yuchen.saas.parking.api.feign;

import com.yuchen.saas.parking.api.entity.PmgBatParkingCoupon;
import com.yuchen.saas.parking.api.vo.ParkingCouponPageVo;
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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @ClassName ParkingCouponClient
 * @Description 优惠券 fegin 接口
 * @Author 张逸飞
 * @Date 2022/9/15 15:38
 */
@FeignClient(
        value = AppNameConstant.SAAS_PARKING,
        fallback = ParkingCouponClientFallBack.class
)
public interface ParkingCouponClient {

    /**
     * 获取优惠券数据
     * @param couponCode 优惠券 code
     * @return
     */
    @GetMapping("/parking/coupon/getCoupon")
    R<PmgBatParkingCoupon> getCoupon(@RequestParam("couponCode") String couponCode);


    /**
     * 小程序扫描二维码获得的优惠券信息
     * @param couponCode
     * @return
     */
    @GetMapping("/parking/coupon/record/detail")
    R getCouponRecordInfo(@RequestParam("couponCode") String couponCode);

    /**
     * 根据手机号当前用户优惠券分页列表
     * @param map
     * @return
     */
    @GetMapping("/parking/coupon/getPage")
    R getCouponPage(@RequestParam Map map);

    /**
     * 获得优惠券记录分页信息
     * @param map
     * @return
     */
    @GetMapping("/parking/coupon/record/page")
    R getCouponRecordPage(@RequestParam Map map);

    /**
     * 获得优惠券记录详情
     * @param id
     * @return
     */
    @GetMapping("/parking/coupon/record/info")
    R getRecordInfo(@RequestParam("id") Long id);

    /**
     * 创建优惠券记录
     * @param pageVo 需要创建的id
     * @return
     */
    @PostMapping("/parking/coupon/record/add")
    R createRecordImg(@RequestBody ParkingCouponPageVo pageVo);


}
