import { useUserService } from "@/apis/hooks/service";
import Response from "@/utils/common/Response";
import useContext from "@/apis/hooks/context";

export async function login(username: string, password: string) {
  const userService = await useUserService();
  const ctx = useContext();
  const userID = await userService.login(username, password);
  await userService.test();
  ctx.session.userID = userID;
  return new Response(userID);
}

export const userInfo = async (userID: string) => {
  //
};

export const test = async () => {};
