package com.czg.controller.user;

import com.czg.market.dto.ChatCouponGrantDTO;
import com.czg.market.service.ChatCouponService;
import com.czg.resp.CzgResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ww
 * @description
 */
@RestController
@RequestMapping("/user/chat/coupon")
public class UChatCouponController {
    @Resource
    private ChatCouponService chatCouponService;

    /**
     * 群聊优惠券活动-发放优惠券
     */
    @PostMapping("/grant")
    public CzgResult<Boolean> grantChatCoupon(@RequestBody ChatCouponGrantDTO chatCouponGrant) {
        chatCouponService.grantChatCoupon(chatCouponGrant.getId(), chatCouponGrant.getShopId(), chatCouponGrant.getUserId());
        return CzgResult.success(true);
    }
}
