package com.zhiqiyun.open.core.service;

import com.alibaba.fastjson.JSONObject;
import com.dliyun.ClientException;
import com.dliyun.Response;

import java.util.Map;

/**
 * @author xin yang
 * @date 2022/6/13
 */
public interface UnifiedLoginService {

    /**
     * 账号密码登录
     *
     * @param account  账号
     * @param password 密码
     * @return Response
     * @throws ClientException ClientException
     */
    Response<JSONObject> login(String account, String password) throws ClientException;

    /**
     * 根据accessToken获取用户信息
     *
     * @param accessToken 账号
     * @return Response
     * @throws ClientException ClientException
     */
    Response<JSONObject> loginAccessToken(String accessToken) throws ClientException;

    /**
     * 新增用户
     *
     * @param form from
     * @return Response
     * @throws ClientException ClientException
     */
    Response<JSONObject> addUser(Map<String, Object> form) throws ClientException;

    /**
     * 修改用户
     *
     * @param form from
     * @return Response
     * @throws ClientException ClientException
     */
    Response<JSONObject> updateUser(Map<String, Object> form) throws ClientException;
}
