package com.changhu.service.impl;

import com.changhu.common.pojo.vo.TokenInfo;
import com.changhu.common.utils.UserUtil;
import com.changhu.pojo.params.LoginParams;
import com.changhu.service.LoginService;
import org.springframework.stereotype.Service;

/**
 * @author 20252
 * @createTime 2024/8/28 下午5:29
 * @desc LoginServiceImpl...
 */
@Service
public class LoginServiceImpl implements LoginService {
    @Override
    public TokenInfo login(LoginParams loginParams) {
        return loginParams.getClientType()
                .getLoginHandler()
                .login(loginParams.getLoginParams());
    }

    @Override
    public void logout() {
        UserUtil.logout();
    }
}
