package com.sonic.lion.controller.api;

import com.sonic.common.auth.IgnoreAuth;
import com.sonic.common.rpc.Result;
import com.sonic.lion.lib.input.GetSubscribeInput;
import com.sonic.lion.service.UserSubscriptionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: code
 * @date: 2025/05/11
 * @Description:
 * @version: 1.0.0
 */
@RestController
public class SubscribeApi {

    @Autowired
    private UserSubscriptionService userSubscriptionService;

    @ApiOperation(value = "查询当前用户是否是会员", tags = "API-接口")
    @IgnoreAuth
    @PostMapping("/api/pay/subscribe/query")
    public Result<List<Long>> queryUserSubscribe(@RequestBody GetSubscribeInput input) {
        return Result.success(userSubscriptionService.queryUserIsSubscribe(input.getUserIdList()));
    }

}
