package com.hotent.auth.server.service;

import com.hotent.base.jwt.JwtAuthenticationRequest;
import com.hotent.base.jwt.JwtAuthenticationResponse;
import com.hotent.base.model.CommonResult;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.AuthenticationException;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Map;
import java.util.Optional;

/**
 * 用户认证 服务类
 *
 * @company 清众科技股份有限公司
 * @date 2024-06-06 17:29
 */
public interface AuthenticationThirdPartyService {


    /**
     * 登录系统
     *
     * @param authenticationRequest
     * @return
     */
    CommonResult<?> createAuthenticationTokenCode(JwtAuthenticationRequest authenticationRequest);

    /**
     * 开发者登录系统
     *
     * @param authenticationRequest
     * @return
     */
    ResponseEntity<?>createAuthenticationTokenDevelop(JwtAuthenticationRequest authenticationRequest);

    /**
     * 生成短code
     * @param request
     * @return
     */
    CommonResult<?> generateShortAuthenticationToken(HttpServletRequest request);

    /**
     * 短code换取token
     * @param shortCode
     * @return
     */
    CommonResult<?> convertShortAuthenticationToken(String shortCode);


    /**
     * 生成图形验证码
     * @param shortCode
     * @return
     */
    void saveCaptchaCode(String codeId, String code);

}
