package org.jeecg.modules.adweb.subscription.service;

import com.baomidou.mybatisplus.extension.service.IService;

import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.adweb.subscription.entity.SubscribePlan;
import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;

/**
 * @Description: AdWeb套餐订购
 * @Author: jeecg-boot
 * @Date: 2024-10-15
 * @Version: V1.0
 */
public interface IUserPlanSubscriptionService extends IService<UserPlanSubscription> {

    /**
     * 绑定AdWeb套餐
     *
     * @param userPlanSubscription
     * @param sysUser
     * @return
     */
    Result<?> addUserPlanSubscription(UserPlanSubscription userPlanSubscription, LoginUser sysUser);

    /**
     * 新增套餐订阅记录
     *
     * @param userPlanSubscription
     * @param subscribePlan
     * @return
     */
    boolean addNewSubscription(
            UserPlanSubscription userPlanSubscription, SubscribePlan subscribePlan);

    /** 获取正在使用中的AdWeb套餐，如果没有使用中的SEO和建站套餐，则查询过期的套餐 */
    UserPlanSubscription getCurrentSubscription(Integer siteId);
}
