package cn.ysk.cashier.controller;

import cn.ysk.cashier.service.ThirdPartyCouponService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * 三方团购券
 */
@RestController
@RequestMapping("/api/thirdPartyCoupon")
public class ThirdPartyCouponController {

    private final ThirdPartyCouponService thirdPartyCouponService;

    public ThirdPartyCouponController(ThirdPartyCouponService thirdPartyCouponService) {
        this.thirdPartyCouponService = thirdPartyCouponService;
    }

    /**
     * 获取美团绑定链接
     * @return 美团绑定链接
     */
    @GetMapping
    public ResponseEntity<String> getBindUrl(@RequestParam Integer shopId) {
        return ResponseEntity.ok(thirdPartyCouponService.getBindUrl(shopId));
    }
}
