feat: 회원 탈퇴 (DELETE /v1/auth/me, 웹·앱 내 정보 시트 '탈퇴하기')
- 계정과 남긴 댓글·좋아요·저장을 한 트랜잭션으로 지우고 게시물·댓글 수를 맞춘다 - 로그아웃·탈퇴 때 내 정보 캐시를 먼저 버려 401 로 로그인 창이 뜨지 않게 - 탈퇴 테스트 추가, 공용 API 클라이언트 다시 생성
This commit is contained in:
1 parent
dd2d02758b
commit
86a0ea26ca
15 files changed
+313
-17
No files matched your search
@@ -171,6 +171,9 @@
|
||||
| [ ] | 안드로이드 댓글 쓰기·내 정보 바꾸기·로그아웃 확인 | 아직 안 눌러 봄 | `mobile/src/components/sheets/` |
|
||||
| [x] | 출시 빌드 설정: `eas.json`(production 은 운영 API·사이트 주소, 빌드 번호 자동 증가), iOS 수출 규정 암호화 없음, 안드로이드 권한은 대략 위치만(정밀 위치·저장소·다른 앱 위에 그리기 뺌) | | `mobile/eas.json`, `mobile/app.json` |
|
||||
| [ ] | 출시 빌드 전 준비(사용자): Apple Developer·Google Play Console·Expo 계정, 스토어 스크린샷·설명·데이터 안전 양식 | 서명·제출에 필요 | |
|
||||
| [x] | 회원 탈퇴(스토어 심사 필수): `DELETE /v1/auth/me` — 계정·댓글·좋아요·저장 모두 삭제, 게시물·댓글 수 맞춤. 웹·앱 내 정보 시트 '탈퇴하기'(한 번 더 확인) | Apple 5.1.1(v), Google Play 계정 삭제 정책 | `backend/crud/user_crud.py`, `backend/services/auth_service.py`, `frontend/src/b/Sheets.tsx`, `mobile/src/components/sheets/me.tsx` |
|
||||
| [ ] | 운영 배포 때 탈퇴 API 같이 나감 — 배포 전 웹 내 정보 시트 '탈퇴하기' 화면 확인 (앱은 안드로이드에서 확인, 웹은 빌드·린트만) | | `frontend/src/b/Sheets.tsx` |
|
||||
| [ ] | 백엔드 테스트 3개가 날짜 때문에 실패 (10/19): `test_feed`(제철 각 수 42≠40), `test_watch`, `test_weather_today`(10월 하순 18시가 일몰 뒤라 'sunset' 아이콘 아님) — 탈퇴 작업과 무관 | 기대값을 날짜에 안 묶이게 고쳐야 함 | `backend/tests/` |
|
||||
| [ ] | Xcode 설치 후 iOS 시뮬레이터에서 전체 확인 | | `mobile/` |
|
||||
| [x] | 안드로이드 개발 빌드(`expo run:android`) 설치 확인: 홈 화면 해 아이콘·'날씨각' 이름, 실데이터 화면 | | `mobile/` |
|
||||
| [ ] | **[결정 필요]** 앱 ID(안드로이드 패키지·iOS 번들 ID) — 지금 `com.anonymous.nalssigak`. 후보 `kr.o2o.nalssigak` / `kr.o2o.weather`. 스토어에 올리면 못 바꿈 | 스토어 등록 때 정하기로 | `mobile/app.json` |
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import uuid
|
||||
from collections import Counter
|
||||
from datetime import datetime, timezone
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import delete, select, update
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.model.models import User
|
||||
from common.database.model.models import Comment, CommentLike, Post, PostLike, PostSave, User
|
||||
|
||||
|
||||
class UserCRUD:
|
||||
@@ -31,3 +32,20 @@ class UserCRUD:
|
||||
user.updated_at = datetime.now(timezone.utc)
|
||||
await s.flush()
|
||||
return user
|
||||
|
||||
async def withdraw(self, s: AsyncSession, user_id: uuid.UUID) -> None:
|
||||
"""계정과 그 사람이 남긴 좋아요·저장·댓글을 모두 지우고, 게시물·댓글에 쌓인 수를 그만큼 줄인다."""
|
||||
liked_posts = (await s.scalars(delete(PostLike).where(PostLike.user_id == user_id).returning(PostLike.post_id))).all()
|
||||
if liked_posts:
|
||||
await s.execute(update(Post).where(Post.post_id.in_(liked_posts)).values(like_count=Post.like_count - 1))
|
||||
liked_comments = (await s.scalars(delete(CommentLike).where(CommentLike.user_id == user_id).returning(CommentLike.comment_id))).all()
|
||||
if liked_comments:
|
||||
await s.execute(update(Comment).where(Comment.comment_id.in_(liked_comments)).values(like_count=Comment.like_count - 1))
|
||||
await s.execute(delete(PostSave).where(PostSave.user_id == user_id))
|
||||
mine = (await s.execute(delete(Comment).where(Comment.user_id == user_id).returning(Comment.comment_id, Comment.post_id, Comment.deleted))).all()
|
||||
if mine:
|
||||
await s.execute(delete(CommentLike).where(CommentLike.comment_id.in_([c for c, _, _ in mine])))
|
||||
# 이미 지운 댓글은 댓글 수에서 빠져 있다
|
||||
for post_id, n in Counter(p for _, p, deleted in mine if not deleted).items():
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - n))
|
||||
await s.execute(delete(User).where(User.user_id == user_id))
|
||||
@@ -4,7 +4,7 @@ from common.auth import current_user
|
||||
from common.database.model.models import User
|
||||
from common.enums import AuthProvider, ErrorType
|
||||
from common.models.errors import error_info
|
||||
from router.v1.auth.protocol import Me, Req_Login, Req_Refresh, Req_Signup, Req_UpdateMe, Res_Auth, Res_Logout, Res_Me
|
||||
from router.v1.auth.protocol import Me, Req_Login, Req_Refresh, Req_Signup, Req_UpdateMe, Res_Auth, Res_Logout, Res_Me, Res_Withdraw
|
||||
from services.auth_service import AuthService
|
||||
|
||||
router = APIRouter(prefix="/v1/auth", tags=["auth"])
|
||||
@@ -56,3 +56,9 @@ async def update_me(req: Req_UpdateMe, user: User = Depends(current_user), servi
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_Me(result=error_info(err))
|
||||
return Res_Me(me=_me(updated))
|
||||
|
||||
|
||||
@router.delete("/me", response_model=Res_Withdraw, response_model_exclude_none=True, summary="탈퇴 (계정과 남긴 댓글·좋아요를 모두 지운다)")
|
||||
async def withdraw(user: User = Depends(current_user), service: AuthService = Depends()) -> Res_Withdraw:
|
||||
err = await service.withdraw(user)
|
||||
return Res_Withdraw() if err is ErrorType.SUCCESS else Res_Withdraw(result=error_info(err))
|
||||
@@ -45,5 +45,9 @@ class Res_Logout(Res_WebPacketProtocol):
|
||||
pass
|
||||
|
||||
|
||||
class Res_Withdraw(Res_WebPacketProtocol):
|
||||
pass
|
||||
|
||||
|
||||
class Res_Me(Res_WebPacketProtocol):
|
||||
me: Optional[Me] = None
|
||||
@@ -60,6 +60,10 @@ class AuthService:
|
||||
"""이 사용자의 모든 기기 토큰을 무효로 만든다."""
|
||||
return await DB_SESSION_MNG.execute_lambda_run([lambda s: self.crud.update(s, user.user_id, {"token_version": user.token_version + 1})])
|
||||
|
||||
async def withdraw(self, user: User) -> ErrorType:
|
||||
"""탈퇴: 계정과 남긴 댓글·좋아요를 한 번에 지운다. 계정이 없어지니 가진 토큰도 바로 못 쓴다."""
|
||||
return await DB_SESSION_MNG.execute_lambda_run([lambda s: self.crud.withdraw(s, user.user_id)])
|
||||
|
||||
async def update_me(self, user: User, nickname: Optional[str], character: Optional[str], color: Optional[str] = None, mood: Optional[str] = None) -> tuple[ErrorType, Optional[User]]:
|
||||
"""닉네임·캐릭터·배경색·기분 중 보낸 것만 바꾼다. 기분을 빈 문자열로 보내면 지운다."""
|
||||
values: dict = {}
|
||||
|
||||
@@ -121,3 +121,31 @@ async def test_logout_invalidates_access_and_refresh_tokens():
|
||||
assert (await c.post("/v1/auth/refresh", json={"refresh_token": body["refresh_token"]})).json()["result"]["desc"] == "AUTH_TOKEN_INVALID"
|
||||
again = (await c.post("/v1/auth/login", json={"login_id": "mina_out", "password": "password1"})).json()
|
||||
assert (await c.get("/v1/auth/me", headers={"Authorization": f"Bearer {again['access_token']}"})).status_code == 200
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_withdraw_deletes_account_and_reactions(offline):
|
||||
async with client() as c:
|
||||
body = await _signup(c, login_id="mina_bye")
|
||||
h = {"Authorization": f"Bearer {body['access_token']}"}
|
||||
other = {"Authorization": f"Bearer {(await _signup(c, 'other_bye', '남는사람'))['access_token']}"}
|
||||
post_id = (await c.get("/v1/feed", params={"region": REGION})).json()["posts"][0]["post_id"]
|
||||
await c.post(f"/v1/reaction/post/{post_id}/like", headers=h)
|
||||
await c.post(f"/v1/reaction/post/{post_id}/save", headers=h)
|
||||
mine = (await c.post(f"/v1/reaction/post/{post_id}/comment", headers=h, json={"body": "곧 떠나요"})).json()["comment"]
|
||||
kept = (await c.post(f"/v1/reaction/post/{post_id}/comment", headers=other, json={"body": "남아요"})).json()["comment"]
|
||||
await c.post(f"/v1/reaction/comment/{kept['comment_id']}/like", headers=h)
|
||||
await c.post(f"/v1/reaction/comment/{mine['comment_id']}/like", headers=other)
|
||||
|
||||
assert (await c.delete("/v1/auth/me")).status_code == 401
|
||||
assert (await c.delete("/v1/auth/me", headers=h)).json()["result"]["success"] is True
|
||||
|
||||
assert (await c.get("/v1/auth/me", headers=h)).status_code == 401
|
||||
assert (await c.post("/v1/auth/refresh", json={"refresh_token": body["refresh_token"]})).json()["result"]["desc"] == "AUTH_TOKEN_INVALID"
|
||||
assert (await c.post("/v1/auth/login", json={"login_id": "mina_bye", "password": "password1"})).json()["result"]["desc"] == "AUTH_FAILED"
|
||||
comments = (await c.get(f"/v1/reaction/post/{post_id}/comment/list")).json()["comments"]
|
||||
assert [x["body"] for x in comments] == ["남아요"] and comments[0]["like_count"] == 0
|
||||
p = next(x for x in (await c.get("/v1/feed", params={"region": REGION})).json()["posts"] if x["post_id"] == post_id)
|
||||
assert p["like_count"] == 0 and p["comment_count"] == 1
|
||||
# 같은 아이디로 다시 가입할 수 있다
|
||||
assert (await _signup(c, login_id="mina_bye"))["result"]["success"] is True
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, type InfiniteData } from '@tanstack/react-query'
|
||||
import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState, type FormEvent, type ReactNode } from 'react'
|
||||
import { setTokens, subscribeAuth } from '@nalssigak/shared/api/auth'
|
||||
import { clearTokens, setTokens, subscribeAuth } from '@nalssigak/shared/api/auth'
|
||||
import { SITE_URL } from '../api/setup'
|
||||
import {
|
||||
addCommentMutation,
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
signupMutation,
|
||||
unlikeCommentMutation,
|
||||
updateMeMutation,
|
||||
withdrawMutation,
|
||||
} from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import type { CommentData, Factor, ResAuth, ResCommentList, ResIndexDetail } from '@nalssigak/shared/api/client/types.gen'
|
||||
import { track } from '../lib/analytics'
|
||||
@@ -862,7 +863,52 @@ function LoginSheet({ onDone, onLoggedIn }: { onDone: () => void; onLoggedIn: ()
|
||||
)
|
||||
}
|
||||
|
||||
/* ---------- 내 정보: 캐릭터·닉네임·로그아웃 ---------- */
|
||||
/* ---------- 내 정보: 캐릭터·닉네임·로그아웃·탈퇴 ---------- */
|
||||
/** 탈퇴: 한 번 더 묻고 지운다. 계정이 없어지니 이 기기 토큰도 지운다 */
|
||||
function Withdraw({ onDone }: { onDone: () => void }) {
|
||||
const withdraw = useMutation(withdrawMutation())
|
||||
const [asking, setAsking] = useState(false)
|
||||
const [failed, setFailed] = useState(false)
|
||||
if (!asking)
|
||||
return (
|
||||
<button type="button" onClick={() => setAsking(true)} className="cursor-pointer self-center p-1 text-[13px] font-semibold text-(--ink3)">
|
||||
탈퇴하기
|
||||
</button>
|
||||
)
|
||||
const run = () => {
|
||||
setFailed(false)
|
||||
withdraw.mutate(
|
||||
{},
|
||||
{
|
||||
onSuccess: (res) => {
|
||||
if (!res.result?.success) return setFailed(true)
|
||||
clearTokens()
|
||||
onDone()
|
||||
},
|
||||
onError: () => setFailed(true),
|
||||
},
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div className="flex flex-col gap-2.5 rounded-[18px] bg-[#fff1f3] p-3.5" role="alert">
|
||||
<p className="m-0 text-center text-sm font-bold text-(--ink)">
|
||||
탈퇴하면 계정과 남긴 댓글·좋아요가
|
||||
<br />
|
||||
모두 지워져요. 되돌릴 수 없어요.
|
||||
</p>
|
||||
<div className="flex gap-2">
|
||||
<button type="button" onClick={() => setAsking(false)} disabled={withdraw.isPending} className="flex-1 cursor-pointer rounded-[14px] bg-white p-3 text-sm font-extrabold text-(--ink)">
|
||||
그만둘게요
|
||||
</button>
|
||||
<button type="button" onClick={run} disabled={withdraw.isPending} className="flex-1 cursor-pointer rounded-[14px] bg-(--heart) p-3 text-sm font-extrabold text-white disabled:opacity-60">
|
||||
탈퇴할게요
|
||||
</button>
|
||||
</div>
|
||||
{failed && <p className="m-0 text-center text-[13px] font-bold text-(--heart)">탈퇴하지 못했어요. 잠시 뒤에 다시 해 주세요.</p>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function MeSheet({ onDone }: { onDone: () => void }) {
|
||||
const { me, logout } = useAuth()
|
||||
const queryClient = useQueryClient()
|
||||
@@ -981,6 +1027,7 @@ function MeSheet({ onDone }: { onDone: () => void }) {
|
||||
>
|
||||
로그아웃
|
||||
</button>
|
||||
<Withdraw onDone={onDone} />
|
||||
</Body>
|
||||
)
|
||||
}
|
||||
|
||||
+11
-2
@@ -1,7 +1,7 @@
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useEffect, useMemo, useSyncExternalStore, type ReactNode } from 'react'
|
||||
import { clearTokens, getAccessToken, subscribeAuth } from '@nalssigak/shared/api/auth'
|
||||
import { meOptions } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import { meOptions, meQueryKey } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import { logout as logoutOnServer } from '@nalssigak/shared/api/client/sdk.gen'
|
||||
import { AuthContext } from './authContext'
|
||||
|
||||
@@ -18,7 +18,16 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
const me = useQuery({ ...meOptions(), enabled: !!token })
|
||||
|
||||
// 로그인·로그아웃하면 좋아요 여부가 달라지니 받아 둔 데이터를 다시 받는다
|
||||
useEffect(() => subscribeAuth((reason) => reason === 'change' && queryClient.invalidateQueries()), [queryClient])
|
||||
// 로그아웃·탈퇴 땐 내 정보 캐시를 먼저 버린다. 남겨 두면 다시 받다가 401 이 나서 로그인 창이 뜬다
|
||||
useEffect(
|
||||
() =>
|
||||
subscribeAuth((reason) => {
|
||||
if (reason !== 'change') return
|
||||
if (!getAccessToken()) queryClient.removeQueries({ queryKey: meQueryKey() })
|
||||
void queryClient.invalidateQueries()
|
||||
}),
|
||||
[queryClient],
|
||||
)
|
||||
|
||||
const mePending = !!token && me.isPending
|
||||
const api = useMemo(() => ({ loggedIn: !!token, me: (token && me.data?.me) || null, mePending, logout }), [token, me.data, mePending])
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { meQueryKey, updateMeMutation } from '@nalssigak/shared/api/client/@tanstack/react-query.gen';
|
||||
import { clearTokens } from '@nalssigak/shared/api/auth';
|
||||
import { meQueryKey, updateMeMutation, withdrawMutation } from '@nalssigak/shared/api/client/@tanstack/react-query.gen';
|
||||
import { AVATAR_COLORS, CHARACTERS, MOODS } from '@nalssigak/shared/lib';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useState } from 'react';
|
||||
@@ -9,7 +10,48 @@ import { useAuth } from '@/lib/auth';
|
||||
|
||||
import { Body, Field, useSoft } from './parts';
|
||||
|
||||
/** 내 정보: 캐릭터·배경색·기분·닉네임·로그아웃 */
|
||||
/** 탈퇴: 한 번 더 묻고 지운다. 계정이 없어지니 이 기기 토큰도 지운다 */
|
||||
function Withdraw({ onDone }: { onDone: () => void }) {
|
||||
const withdraw = useMutation(withdrawMutation());
|
||||
const [asking, setAsking] = useState(false);
|
||||
const [failed, setFailed] = useState(false);
|
||||
if (!asking)
|
||||
return (
|
||||
<Pressable onPress={() => setAsking(true)} hitSlop={8} className="self-center p-1">
|
||||
<Text className="text-[13px] font-semibold text-ink3">탈퇴하기</Text>
|
||||
</Pressable>
|
||||
);
|
||||
const run = () => {
|
||||
setFailed(false);
|
||||
withdraw.mutate(
|
||||
{},
|
||||
{
|
||||
onSuccess: (res) => {
|
||||
if (!res.result?.success) return setFailed(true);
|
||||
clearTokens();
|
||||
onDone();
|
||||
},
|
||||
onError: () => setFailed(true),
|
||||
},
|
||||
);
|
||||
};
|
||||
return (
|
||||
<View className="gap-2.5 rounded-[18px] p-3.5" style={{ backgroundColor: 'rgb(255 59 92 / 0.08)' }} accessibilityRole="alert">
|
||||
<Text className="text-center text-sm font-bold text-ink">{'탈퇴하면 계정과 남긴 댓글·좋아요가\n모두 지워져요. 되돌릴 수 없어요.'}</Text>
|
||||
<View className="flex-row gap-2">
|
||||
<Pressable onPress={() => setAsking(false)} disabled={withdraw.isPending} className="flex-1 rounded-[14px] bg-card p-3">
|
||||
<Text className="text-center text-sm font-extrabold text-ink">그만둘게요</Text>
|
||||
</Pressable>
|
||||
<Pressable onPress={run} disabled={withdraw.isPending} className="flex-1 rounded-[14px] bg-heart p-3 disabled:opacity-60">
|
||||
<Text className="text-center text-sm font-extrabold text-white">탈퇴할게요</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
{failed && <Text className="text-center text-[13px] font-bold text-heart">탈퇴하지 못했어요. 잠시 뒤에 다시 해 주세요.</Text>}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
/** 내 정보: 캐릭터·배경색·기분·닉네임·로그아웃·탈퇴 */
|
||||
export function MeSheet({ onDone }: { onDone: () => void }) {
|
||||
const { me, logout } = useAuth();
|
||||
const s = useSoft();
|
||||
@@ -123,6 +165,7 @@ export function MeSheet({ onDone }: { onDone: () => void }) {
|
||||
>
|
||||
<Text className="text-center text-[15px] font-extrabold text-ink">로그아웃</Text>
|
||||
</Pressable>
|
||||
<Withdraw onDone={onDone} />
|
||||
</Body>
|
||||
);
|
||||
}
|
||||
+11
-2
@@ -1,5 +1,5 @@
|
||||
import { clearTokens, getAccessToken, subscribeAuth } from '@nalssigak/shared/api/auth';
|
||||
import { meOptions } from '@nalssigak/shared/api/client/@tanstack/react-query.gen';
|
||||
import { meOptions, meQueryKey } from '@nalssigak/shared/api/client/@tanstack/react-query.gen';
|
||||
import { logout as logoutOnServer } from '@nalssigak/shared/api/client/sdk.gen';
|
||||
import type { Me } from '@nalssigak/shared/api/client/types.gen';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
@@ -29,7 +29,16 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
const me = useQuery({ ...meOptions(), enabled: !!token });
|
||||
|
||||
// 로그인·로그아웃하면 좋아요 여부가 달라지니 받아 둔 데이터를 다시 받는다
|
||||
useEffect(() => subscribeAuth((reason) => reason === 'change' && queryClient.invalidateQueries()), [queryClient]);
|
||||
// 로그아웃·탈퇴 땐 내 정보 캐시를 먼저 버린다. 남겨 두면 다시 받다가 401 이 나서 로그인 창이 뜬다
|
||||
useEffect(
|
||||
() =>
|
||||
subscribeAuth((reason) => {
|
||||
if (reason !== 'change') return;
|
||||
if (!getAccessToken()) queryClient.removeQueries({ queryKey: meQueryKey() });
|
||||
void queryClient.invalidateQueries();
|
||||
}),
|
||||
[queryClient],
|
||||
);
|
||||
|
||||
const mePending = !!token && me.isPending;
|
||||
const api = useMemo(() => ({ loggedIn: !!token, me: (token && me.data?.me) || null, mePending, logout }), [token, me.data, mePending]);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
|
||||
|
||||
import { client } from '../client.gen';
|
||||
import { addComment, deleteComment, getArticle, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, GetArticleData, GetArticleError, GetArticleResponse, GetFeedData, GetFeedError, GetFeedResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, RefreshData, RefreshError, RefreshResponse, SavePostData, SavePostError, SavePostResponse, SignupData, SignupError, SignupResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse } from '../types.gen';
|
||||
import { addComment, deleteComment, getArticle, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTodayPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe, withdraw } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, GetArticleData, GetArticleError, GetArticleResponse, GetFeedData, GetFeedError, GetFeedResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, RefreshData, RefreshError, RefreshResponse, SavePostData, SavePostError, SavePostResponse, SignupData, SignupError, SignupResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse, WithdrawData, WithdrawError, WithdrawResponse } from '../types.gen';
|
||||
|
||||
export type QueryKey<TOptions extends Options> = [
|
||||
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
||||
@@ -413,6 +413,23 @@ export const logoutMutation = (options?: Partial<Options<LogoutData>>): UseMutat
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 탈퇴 (계정과 남긴 댓글·좋아요를 모두 지운다)
|
||||
*/
|
||||
export const withdrawMutation = (options?: Partial<Options<WithdrawData>>): UseMutationOptions<WithdrawResponse, WithdrawError, Options<WithdrawData>> => {
|
||||
const mutationOptions: UseMutationOptions<WithdrawResponse, WithdrawError, Options<WithdrawData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await withdraw({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const meQueryKey = (options?: Options<MeData>) => createQueryKey('me', options);
|
||||
|
||||
/**
|
||||
@@ -745,6 +762,24 @@ export const getImageOptions = (options: Options<GetImageData>) => queryOptions<
|
||||
queryKey: getImageQueryKey(options)
|
||||
});
|
||||
|
||||
export const getTodayPageQueryKey = (options: Options<GetTodayPageData>) => createQueryKey('getTodayPage', options);
|
||||
|
||||
/**
|
||||
* 지역 검색 페이지: 정적 HTML 에 오늘 날씨·각을 채워 돌려준다 (nginx 가 /today/... 를 넘김)
|
||||
*/
|
||||
export const getTodayPageOptions = (options: Options<GetTodayPageData>) => queryOptions<GetTodayPageResponse, GetTodayPageError, GetTodayPageResponse, ReturnType<typeof getTodayPageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTodayPage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTodayPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const healthzHealthzGetQueryKey = (options?: Options<HealthzHealthzGetData>) => createQueryKey('healthzHealthzGet', options);
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,4 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen';
|
||||
*/
|
||||
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
||||
|
||||
export const client: Client = createClient(createConfig<ClientOptions2>({ baseUrl: 'http://localhost:9810', throwOnError: true }));
|
||||
export const client: Client = createClient(createConfig<ClientOptions2>({ throwOnError: true }));
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { addComment, deleteComment, getArticle, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type ClientOptions, type CommentData, type CommuteData, Confidence, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HourCell, type HoursSlide, type HttpValidationError, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListPlacesData, type ListPlacesError, type ListPlacesErrors, type ListPlacesResponse, type ListPlacesResponses, type ListRegionsData, type ListRegionsError, type ListRegionsErrors, type ListRegionsResponse, type ListRegionsResponses, type ListSavedData, type ListSavedError, type ListSavedErrors, type ListSavedResponse, type ListSavedResponses, type LoginData, type LoginError, type LoginErrors, type LoginResponse, type LoginResponses, type LogoutData, type LogoutError, type LogoutErrors, type LogoutResponse, type LogoutResponses, type Me, type MeData, type MeError, type MeErrors, type MeResponse, type MeResponses, type NearestRegionData, type NearestRegionError, type NearestRegionErrors, type NearestRegionResponse, type NearestRegionResponses, type PlaceData, type PlanSlide, type PlanSpot, type PlanStep, type PostData, PostType, type Rain2h, type RainHourData, RainType, type RankData, type RefreshData, type RefreshError, type RefreshErrors, type RefreshResponse, type RefreshResponses, type RegionData, type ReqComment, type ReqLogin, type ReqRefresh, type ReqSignup, type ReqUpdateMe, type ResArticle, type ResArticleList, type ResAuth, type ResComment, type ResCommentLike, type ResCommentList, type ResEventList, type ResFeed, type ResHealth, type ResIndexDetail, type ResIndexList, type ResLogout, type ResMe, type ResPlaceList, type ResPost, type ResPostLike, type ResPostSave, type ResRegion, type ResRegionList, type ResSavedList, type ResSeasonWeek, type ResSky, type ResSkyRanking, type ResWatchSummary, type ResWeatherNow, type ResWeatherToday, type ResWebPacketProtocol, type ResWeek, type ResWeekRanking, type Row, type RowsSlide, type SavedPost, type SavePostData, type SavePostError, type SavePostErrors, type SavePostResponse, type SavePostResponses, type ScoreBand, type SignupData, type SignupError, type SignupErrors, type SignupResponse, type SignupResponses, Sky, SkyGrade, type SkyPlanData, type SkyScoreData, SkySituation, SkyType, type SlotPoint, SlotTone, type SpotData, type SunsetSlide, type TermData, type Tomorrow, type TopIndex, type TrendPoint, type UnlikeCommentData, type UnlikeCommentError, typeLine truncated
|
||||
export { addComment, deleteComment, getArticle, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTodayPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe, withdraw } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type ClientOptions, type CommentData, type CommuteData, Confidence, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetTodayPageData, type GetTodayPageError, type GetTodayPageErrors, type GetTodayPageResponse, type GetTodayPageResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HourCell, type HoursSlide, type HttpValidationError, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListPlacesData, type ListPlacesError, type ListPlacesErrors, type ListPlacesResponse, type ListPlacesResponses, type ListRegionsData, type ListRegionsError, type ListRegionsErrors, type ListRegionsResponse, type ListRegionsResponses, type ListSavedData, type ListSavedError, type ListSavedErrors, type ListSavedResponse, type ListSavedResponses, type LoginData, type LoginError, type LoginErrors, type LoginResponse, type LoginResponses, type LogoutData, type LogoutError, type LogoutErrors, type LogoutResponse, type LogoutResponses, type Me, type MeData, type MeError, type MeErrors, type MeResponse, type MeResponses, type NearestRegionData, type NearestRegionError, type NearestRegionErrors, type NearestRegionResponse, type NearestRegionResponses, type PlaceData, type PlanSlide, type PlanSpot, type PlanStep, type PostData, PostType, type Rain2h, type RainHourData, RainType, type RankData, type RefreshData, type RefreshError, type RefreshErrors, type RefreshResponse, type RefreshResponses, type RegionData, type ReqComment, type ReqLogin, type ReqRefresh, type ReqSignup, type ReqUpdateMe, type ResArticle, type ResArticleList, type ResAuth, type ResComment, type ResCommentLike, type ResCommentList, type ResEventList, type ResFeed, type ResHealth, type ResIndexDetail, type ResIndexList, type ResLogout, type ResMe, type ResPlaceList, type ResPost, type ResPostLike, type ResPostSave, type ResRegion, type ResRegionList, type ResSavedList, type ResSeasonWeek, type ResSky, type ResSkyRanking, type ResWatchSummary, type ResWeatherNow, type ResWeatherToday, type ResWebPacketProtocol, type ResWeek, type ResWeekRanking, type ResWithdraw, type Row, type RowsSlide, type SavedPost, type SavePostData, type SavePostError, type SavePostErrors, type SavePostResponse, type SavePostResponses, type ScoreBand, type SignupData, type SignupError, type SignupErrors, type SignupResponse, type SignupResponses, Sky, SkyGrade, type SkyPlanData, type SkyScoreData, SkySituation, SkyType, type SlotPoint, SlotTone, typLine truncated
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
|
||||
import { client } from './client.gen';
|
||||
import type { AddCommentData, AddCommentErrors, AddCommentResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetImageData, GetImageErrors, GetImageResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetWatchSummaryData, GetWatchSummaryErrors, GetWatchSummaryResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekRankingData, GetWeekRankingResponses, GetWeekResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutErrors, LogoutResponses, MeData, MeErrors, MeResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, RefreshData, RefreshErrors, RefreshResponses, SavePostData, SavePostErrors, SavePostResponses, SignupData, SignupErrors, SignupResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses, UpdateMeData, UpdateMeErrors, UpdateMeResponses } from './types.gen';
|
||||
import type { AddCommentData, AddCommentErrors, AddCommentResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetImageData, GetImageErrors, GetImageResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetTodayPageData, GetTodayPageErrors, GetTodayPageResponses, GetWatchSummaryData, GetWatchSummaryErrors, GetWatchSummaryResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekRankingData, GetWeekRankingResponses, GetWeekResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutErrors, LogoutResponses, MeData, MeErrors, MeResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, RefreshData, RefreshErrors, RefreshResponses, SavePostData, SavePostErrors, SavePostResponses, SignupData, SignupErrors, SignupResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses, UpdateMeData, UpdateMeErrors, UpdateMeResponses, WithdrawData, WithdrawErrors, WithdrawResponses } from './types.gen';
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
||||
/**
|
||||
@@ -144,6 +144,11 @@ export const refresh = <ThrowOnError extends boolean = true>(options: Options<Re
|
||||
*/
|
||||
export const logout = <ThrowOnError extends boolean = true>(options?: Options<LogoutData, ThrowOnError>): RequestResult<LogoutResponses, LogoutErrors, ThrowOnError> => (options?.client ?? client).post<LogoutResponses, LogoutErrors, ThrowOnError>({ url: '/v1/auth/logout', ...options });
|
||||
|
||||
/**
|
||||
* 탈퇴 (계정과 남긴 댓글·좋아요를 모두 지운다)
|
||||
*/
|
||||
export const withdraw = <ThrowOnError extends boolean = true>(options?: Options<WithdrawData, ThrowOnError>): RequestResult<WithdrawResponses, WithdrawErrors, ThrowOnError> => (options?.client ?? client).delete<WithdrawResponses, WithdrawErrors, ThrowOnError>({ url: '/v1/auth/me', ...options });
|
||||
|
||||
/**
|
||||
* 내 정보
|
||||
*/
|
||||
@@ -228,6 +233,11 @@ export const getWatchSummary = <ThrowOnError extends boolean = true>(options: Op
|
||||
*/
|
||||
export const getImage = <ThrowOnError extends boolean = true>(options: Options<GetImageData, ThrowOnError>): RequestResult<GetImageResponses, GetImageErrors, ThrowOnError> => (options.client ?? client).get<GetImageResponses, GetImageErrors, ThrowOnError>({ url: '/v1/image', ...options });
|
||||
|
||||
/**
|
||||
* 지역 검색 페이지: 정적 HTML 에 오늘 날씨·각을 채워 돌려준다 (nginx 가 /today/... 를 넘김)
|
||||
*/
|
||||
export const getTodayPage = <ThrowOnError extends boolean = true>(options: Options<GetTodayPageData, ThrowOnError>): RequestResult<GetTodayPageResponses, GetTodayPageErrors, ThrowOnError> => (options.client ?? client).get<GetTodayPageResponses, GetTodayPageErrors, ThrowOnError>({ url: '/v1/seo/today/{sido}/{place}', ...options });
|
||||
|
||||
/**
|
||||
* 헬스체크
|
||||
*/
|
||||
|
||||
@@ -1919,6 +1919,17 @@ export type ResWeekRanking = {
|
||||
days?: Array<WeekRankDay>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Res_Withdraw
|
||||
*/
|
||||
export type ResWithdraw = {
|
||||
result?: ErrorInfo;
|
||||
/**
|
||||
* Msg
|
||||
*/
|
||||
msg?: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Row
|
||||
*/
|
||||
@@ -2635,6 +2646,10 @@ export type WatchNow = {
|
||||
* Rain 2H
|
||||
*/
|
||||
rain_2h?: boolean | null;
|
||||
/**
|
||||
* Thunder
|
||||
*/
|
||||
thunder?: boolean | null;
|
||||
/**
|
||||
* Text
|
||||
*/
|
||||
@@ -3528,6 +3543,37 @@ export type LogoutResponses = {
|
||||
|
||||
export type LogoutResponse = LogoutResponses[keyof LogoutResponses];
|
||||
|
||||
export type WithdrawData = {
|
||||
body?: never;
|
||||
headers?: {
|
||||
/**
|
||||
* Authorization
|
||||
*/
|
||||
authorization?: string | null;
|
||||
};
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/v1/auth/me';
|
||||
};
|
||||
|
||||
export type WithdrawErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type WithdrawError = WithdrawErrors[keyof WithdrawErrors];
|
||||
|
||||
export type WithdrawResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: ResWithdraw;
|
||||
};
|
||||
|
||||
export type WithdrawResponse = WithdrawResponses[keyof WithdrawResponses];
|
||||
|
||||
export type MeData = {
|
||||
body?: never;
|
||||
headers?: {
|
||||
@@ -4031,6 +4077,40 @@ export type GetImageResponses = {
|
||||
200: unknown;
|
||||
};
|
||||
|
||||
export type GetTodayPageData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Sido
|
||||
*/
|
||||
sido: string;
|
||||
/**
|
||||
* Place
|
||||
*/
|
||||
place: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/v1/seo/today/{sido}/{place}';
|
||||
};
|
||||
|
||||
export type GetTodayPageErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type GetTodayPageError = GetTodayPageErrors[keyof GetTodayPageErrors];
|
||||
|
||||
export type GetTodayPageResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: string;
|
||||
};
|
||||
|
||||
export type GetTodayPageResponse = GetTodayPageResponses[keyof GetTodayPageResponses];
|
||||
|
||||
export type HealthzHealthzGetData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
|
||||
Reference in new issue
Block a user