package com.ai.da.service;

import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.mapper.primary.entity.TrialOrder;
import com.ai.da.model.dto.*;
import com.ai.da.model.vo.AccountLoginVO;
import com.ai.da.model.vo.AccountPreLoginVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 服务类
 *
 * @author easy-generator
 * @since 2022-08-11
 */
public interface AccountService extends IService<Account> {

    /**
     * 账户预先登入
     *
     * @param accountDTO
     * @return
     */
    AccountPreLoginVO preLogin(AccountPreLoginDTO accountDTO);

    /**
     * 账户登入
     *
     * @param accountLoginDTO
     * @return
     */
    AccountLoginVO login(AccountLoginDTO accountLoginDTO, HttpServletRequest request);

    /**
     * 绑定邮箱
     *
     * @param accountBindEmailDTO
     * @return
     */
    Boolean bindEmail(AccountBindEmailDTO accountBindEmailDTO);

    /**
     * 忘记密码
     *
     * @param accountDTO
     * @return
     */
    Boolean forgetPwd(AccountRegisterDTO accountDTO);

    /**
     * 发送邮件
     *
     * @param emailSendDTO
     * @return
     */
    Boolean sendEmail(EmailSendDTO emailSendDTO);

    /**
     * 登出
     *
     * @param accountLogoutDTO
     * @return
     */
    Boolean logout(AccountLogoutDTO accountLogoutDTO);

    /**
     * 判断是否登出 Boolean为登入
     *
     * @param accountLogoutDTO
     * @return
     */
    Boolean isLogin(AccountLogoutDTO accountLogoutDTO);

    /**
     * 添加用户信息
     *
     * @param accountAddDTO
     * @return
     */
    Boolean addUser(AccountAddDTO accountAddDTO);

    /**
     * 编辑用户信息
     *
     * @param accountEditDTO
     * @return
     */
    Boolean editUser(AccountEditDTO accountEditDTO);

    String getUserLanguage();

    String changeUserLanguage(String language);

    Boolean trialUserLogout();

    Boolean completeGuidance();

    Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request);

    IPage<TrialOrder> trialOrderList(TrialOrderDTO trialOrderDTO);

    Boolean trialOrderApproval(List<Long> ids);

    Boolean getIsAutoApproval();

    Boolean switchIsAutoApproval();

    Boolean trialOrderRefuse(List<Long> ids);

    Long getExpiredTime();

    Boolean addNoLoginRequired(NoLoginRequiredDTO noLoginRequiredDTO);

    Boolean deleteNoLoginRequired(NoLoginRequiredDTO noLoginRequiredDTO);

    AccountLoginVO noLoginRequired(NoLoginRequiredDTO noLoginRequiredDTO, HttpServletRequest request);

    Boolean existNoLoginRequired(NoLoginRequiredDTO noLoginRequiredDTO, HttpServletRequest request);

    String addNoLoginRequiredNew(NoLoginRequiredDTO noLoginRequiredDTO, HttpServletRequest request);

    Boolean deleteNoLoginRequiredNew(NoLoginRequiredDTO noLoginRequiredDTO, HttpServletRequest request);

    void upgradeNotification();

    void moveLibraryDate();

    void updateCredits(Long accountId, String value);
}
