package shop.alien.store.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import shop.alien.entity.store.LifeUserExpertPurchase;
import shop.alien.store.service.LifeUserExpertPurchaseService;

import java.util.Map;

/**
 * @Author: fcw
 * @CreateTime: 2025-03-061
 * @Description: 用户购买达人推广产品
 */
@Api(tags = {"用户-用户购买达人推广产品"})
@Slf4j
@RestController
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/lifeUserExpertPurchase")
public class LifeUserExpertPurchaseController {

    private final LifeUserExpertPurchaseService lifeUserExpertPurchaseService;

    @ApiOperation("用户购买达人推广产品")
    @ApiOperationSupport(order = 1)
    @PostMapping("/purchaseTalentPromotedProduct")
    public Map<String, Object> purchaseTalentPromotedProduct(@RequestBody LifeUserExpertPurchase lifeUserExpertPurchase) {
        log.info("LifeUserExpertPurchaseController.purchaseTalentPromotedProduct?lifeUserExpertPurchase={}", lifeUserExpertPurchase);
        return lifeUserExpertPurchaseService.purchaseTalentPromotedProduct(lifeUserExpertPurchase);
    }

}
