package com.backendsys.modules.system.service;

import com.backendsys.modules.system.entity.*;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface SysAuthService {

    void renderCaptcha(HttpServletResponse response) throws IOException;
    Map<String, Object> checkCaptchaRequired(String username);
    List<SysMobileArea> getMobileAreaList(SysMobileArea sysMobileArea);

    SysUserInfo login(SysAuth sysAuth);
    SysUserInfo loginWithPhone(SysAuthPhone sysAuthPhone);

    Map<String, Object> register(SysUserDTO sysUserDTO);
    Map<String, Object> forgotPassword(SysUserDTO sysUserDTO);
    Map<String, Object> logout();

    // [方法] 登录失败 (通用) (errMsg: 错误提示文本, username: 用户名, intercept: 是否拦截)
    void loginFail(String errMsg, String username, Boolean isIntercept);
    void cleanLoginRequired(String key);
    // [方法] 登录成功
    SysUserInfo loginSuccess(Long user_id, Integer is_remember);
}
