package com.yh.saas.plugin.yiliangyiyun.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.winsea.svc.base.base.entity.CommonCompany;
import com.winsea.svc.base.base.entity.CommonStaff;
import com.winsea.svc.base.base.entity.CommonStaffRole;
import com.winsea.svc.base.security.entity.Account;
import com.winsea.svc.notice.entity.NoticeTaskInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.CommonUser;
import com.baomidou.mybatisplus.service.IService;
import com.yh.saas.plugin.yiliangyiyun.exception.ServiceException;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Gongdc
 * @since 2021-07-12
 */
public interface ICommonUserService extends IService<CommonUser> {

    /**
     * 注册
     * @param commonUser
     * @return
     * @throws ServiceException
     */
    String register(CommonUser commonUser) throws ServiceException;

    /**
     * 发送验证码
     * @param phone
     * @return
     * @throws ServiceException
     */
    String sendVerifyCode(String phone) throws ServiceException;


    /**
     * 登录
     * @param commonUser
     * @return
     * @throws ServiceException
     */
    CommonUser login(CommonUser commonUser) throws ServiceException;

    /**
     * 快捷登录
     * @param commonUser
     * @return
     * @throws ServiceException
     */
    CommonUser loginVerifyCode(CommonUser commonUser) throws ServiceException;
    /**
     * 校验验证码
     * @param commonUser
     * @return
     * @throws ServiceException
     */
    CommonUser checkVerifyCode(CommonUser commonUser) throws ServiceException;


    /**
     * 重置密码
     * @param commonUser
     * @return
     * @throws ServiceException
     */
    String resetPassword(CommonUser commonUser) throws ServiceException;


    /**
     * 修改用户信息
     * @param commonUser
     * @return
     * @throws ServiceException
     */
    String editUserInfo(CommonUser commonUser) throws ServiceException;

    List<String> getCompList(String userMobilePhone);

    Account getUserByLoginName(String loginName, String compId, Account.AccountType accountType);

    Account login(Account user, String veriCode);

    Page<NoticeTaskInfo> findHisPageNoticeTasks(NoticeTaskInfo noticeTask);


    String checkApp(CommonUser commonUser) throws ServiceException;
    String checkSession() throws ServiceException;

    String saveRole(CommonStaffRole commonStaffRole);

    List<CommonCompany> getComp();

    List<CommonCompany> getCompOwn(String phone);

    void changeInfo(CommonStaff staff);
}
