@uniai-fe/uds-templates 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/cctv/apis/client.ts +4 -13
- package/src/cctv/apis/server.ts +13 -23
- package/src/cctv/components/Provider.tsx +16 -9
- package/src/cctv/hooks/useCompanyData.tsx +16 -15
- package/src/cctv/hooks/useContext.ts +2 -2
- package/src/cctv/types/api.ts +30 -12
- package/src/cctv/types/context.ts +45 -6
- package/src/cctv/types/hook.ts +3 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/uds-templates",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "UNIAI Design System; UI Templates Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
|
-
"packageManager": "pnpm@10.33.
|
|
15
|
+
"packageManager": "pnpm@10.33.2",
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=24",
|
|
18
18
|
"pnpm": ">=10"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@svgr/webpack": "^8.1.0",
|
|
73
|
-
"@tanstack/react-query": "^5.
|
|
73
|
+
"@tanstack/react-query": "^5.100.1",
|
|
74
74
|
"@types/node": "^24.10.2",
|
|
75
75
|
"@types/react": "^19.2.14",
|
|
76
76
|
"@types/react-dom": "^19.2.3",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"jotai": "^2.19.1",
|
|
90
90
|
"next": "^15.5.11",
|
|
91
91
|
"prettier": "^3.8.3",
|
|
92
|
-
"react-hook-form": "^7.
|
|
92
|
+
"react-hook-form": "^7.73.1",
|
|
93
93
|
"sass": "^1.99.0",
|
|
94
94
|
"typescript": "5.9.3"
|
|
95
95
|
}
|
package/src/cctv/apis/client.ts
CHANGED
|
@@ -6,31 +6,22 @@ import type {
|
|
|
6
6
|
API_Res_CctvCompany,
|
|
7
7
|
API_Res_CctvRtcToken,
|
|
8
8
|
} from "../types";
|
|
9
|
-
import { getQueryString } from "@uniai-fe/util-functions";
|
|
10
9
|
|
|
11
10
|
export const getClientCctvCompanyList = async ({
|
|
12
|
-
username,
|
|
13
11
|
url,
|
|
14
12
|
}: {
|
|
15
|
-
username: string;
|
|
16
13
|
url?: string;
|
|
17
|
-
}) =>
|
|
18
|
-
await (
|
|
19
|
-
await fetch(
|
|
20
|
-
`${url ?? "/api/cctv/company-list"}${getQueryString({ username })}`,
|
|
21
|
-
)
|
|
22
|
-
).json();
|
|
14
|
+
}): Promise<API_Res_CctvCompany> =>
|
|
15
|
+
await (await fetch(url ?? "/api/cctv/company-list")).json();
|
|
23
16
|
|
|
24
17
|
export const useQueryCctvCompanyList = ({
|
|
25
|
-
username,
|
|
26
18
|
url,
|
|
27
19
|
}: {
|
|
28
|
-
username: string;
|
|
29
20
|
url?: string;
|
|
30
21
|
}): UseQueryResult<API_Res_CctvCompany> =>
|
|
31
22
|
useQuery({
|
|
32
|
-
queryKey: ["cctv_company_list",
|
|
33
|
-
queryFn: () => getClientCctvCompanyList({
|
|
23
|
+
queryKey: ["cctv_company_list", url],
|
|
24
|
+
queryFn: () => getClientCctvCompanyList({ url }),
|
|
34
25
|
});
|
|
35
26
|
|
|
36
27
|
export const postCctvRtcToken = async ({
|
package/src/cctv/apis/server.ts
CHANGED
|
@@ -132,46 +132,39 @@ export function classifyGroups(
|
|
|
132
132
|
/**
|
|
133
133
|
* CCTV; company-list API route.ts 로직
|
|
134
134
|
* @api
|
|
135
|
-
* @route /
|
|
135
|
+
* @route /common/cctvs/{me|all}
|
|
136
136
|
* @param {API_Req_GetCompanyListParams} params
|
|
137
137
|
* @property {string} domain API 요청 도메인(서버)
|
|
138
138
|
* @property {string} routeUrl Next.js app/api 이하 경로 url
|
|
139
139
|
* @property {string} [queryUrl] 백엔드 요청 url
|
|
140
|
-
* @property {
|
|
140
|
+
* @property {"me" | "all"} [scope] common/cctvs 조회 범위
|
|
141
141
|
*/
|
|
142
142
|
export async function getServerCompanyList({
|
|
143
143
|
domain,
|
|
144
144
|
routeUrl,
|
|
145
145
|
queryUrl,
|
|
146
|
-
|
|
146
|
+
scope = "me",
|
|
147
147
|
}: API_Req_GetCompanyListParams): Promise<{
|
|
148
148
|
res: API_Res_CctvCompany;
|
|
149
149
|
domain: string;
|
|
150
150
|
queryUrl: string;
|
|
151
151
|
options?: ResponseInit;
|
|
152
152
|
}> {
|
|
153
|
-
const
|
|
154
|
-
const query_url = queryUrl || `/v1/users/${username}/cctvs`;
|
|
153
|
+
const query_url = queryUrl || `/common/cctvs/${scope}`;
|
|
155
154
|
|
|
156
|
-
const alternateResponse = {
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
const alternateResponse: API_Res_CctvCompany = {
|
|
156
|
+
status: "error",
|
|
157
|
+
data: {
|
|
158
|
+
items: [],
|
|
159
|
+
total_count: 0,
|
|
160
|
+
},
|
|
161
|
+
errors: [],
|
|
159
162
|
};
|
|
160
163
|
const API_OPTION = {
|
|
161
164
|
domain,
|
|
162
165
|
queryUrl: query_url,
|
|
163
|
-
// searchParams,
|
|
164
166
|
};
|
|
165
167
|
|
|
166
|
-
if (!queryUrl && !username) {
|
|
167
|
-
nextAPILog("GET", routeUrl, query_url, { searchParams });
|
|
168
|
-
return {
|
|
169
|
-
res: alternateResponse,
|
|
170
|
-
...API_OPTION,
|
|
171
|
-
options: { status: 400, statusText: "유저 아이디를 확인할 수 없습니다." },
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
168
|
// 요청 URL 구성
|
|
176
169
|
const url = generateQueryUrl({
|
|
177
170
|
routeUrl,
|
|
@@ -181,12 +174,9 @@ export async function getServerCompanyList({
|
|
|
181
174
|
try {
|
|
182
175
|
const originRes: API_Res_CctvCompany = await (await fetch(url)).json();
|
|
183
176
|
|
|
184
|
-
//
|
|
185
|
-
const originGroups = originRes?.data || [];
|
|
186
|
-
const resGourps = classifyGroups(originGroups);
|
|
187
|
-
|
|
177
|
+
// 변경: server helper는 common/cctvs raw 응답을 유지하고 template 변환은 hook에서 처리한다.
|
|
188
178
|
return {
|
|
189
|
-
res:
|
|
179
|
+
res: originRes,
|
|
190
180
|
...API_OPTION,
|
|
191
181
|
};
|
|
192
182
|
} catch (err) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
import { Form } from "@uniai-fe/uds-primitives";
|
|
5
|
+
import type { DefaultValues } from "react-hook-form";
|
|
5
6
|
|
|
6
7
|
import type {
|
|
7
8
|
CctvApiUrlContext,
|
|
@@ -39,26 +40,32 @@ export function useCctvApiUrl(): CctvApiUrlContext {
|
|
|
39
40
|
* @property {string} [listUrl] company-list API 요청 경로
|
|
40
41
|
* @property {string} [tokenUrl] token API 요청 경로
|
|
41
42
|
* @property {string} [username] CCTV 조회시 권한 확인을 위한 계정명
|
|
43
|
+
* @property {ContextExtension} [defaultValues] 서비스 확장 context 기본값
|
|
42
44
|
* @property {React.ReactNode} children
|
|
43
45
|
*/
|
|
44
|
-
export default function CCTVProvider({
|
|
46
|
+
export default function CCTVProvider<ContextExtension extends object = object>({
|
|
45
47
|
username,
|
|
46
48
|
company_id,
|
|
47
49
|
cam_id,
|
|
48
50
|
listUrl,
|
|
49
51
|
tokenUrl,
|
|
52
|
+
defaultValues,
|
|
50
53
|
children,
|
|
51
|
-
}: CctvProviderProps) {
|
|
54
|
+
}: CctvProviderProps<ContextExtension>) {
|
|
55
|
+
const mergedDefaultValues = {
|
|
56
|
+
// 변경 설명: service 확장 context 기본값을 core CCTV form context와 한 RHF scope에서 병합한다.
|
|
57
|
+
...defaultValues,
|
|
58
|
+
...CCTV_CONTEXT_DEFAULT_VALUES,
|
|
59
|
+
username,
|
|
60
|
+
company_id,
|
|
61
|
+
cam_id,
|
|
62
|
+
} as DefaultValues<CctvContext<ContextExtension>>;
|
|
63
|
+
|
|
52
64
|
return (
|
|
53
65
|
<ApiUrlContext.Provider value={{ listUrl, tokenUrl }}>
|
|
54
|
-
<Form.Provider<CctvContext
|
|
66
|
+
<Form.Provider<CctvContext<ContextExtension>>
|
|
55
67
|
options={{
|
|
56
|
-
defaultValues:
|
|
57
|
-
...CCTV_CONTEXT_DEFAULT_VALUES,
|
|
58
|
-
username,
|
|
59
|
-
company_id,
|
|
60
|
-
cam_id,
|
|
61
|
-
},
|
|
68
|
+
defaultValues: mergedDefaultValues,
|
|
62
69
|
}}
|
|
63
70
|
>
|
|
64
71
|
{children}
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useMemo } from "react";
|
|
4
|
-
import { useQueryCctvCompanyList } from "../apis";
|
|
4
|
+
import { classifyGroups, useQueryCctvCompanyList } from "../apis";
|
|
5
5
|
import { useCctvApiUrl } from "../components/Provider";
|
|
6
6
|
import useCctvContext from "./useContext";
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
UseCctvCompanyDataParams,
|
|
9
|
+
UseCctvCompanyDataReturn,
|
|
10
|
+
} from "../types";
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* CCTV 회사 리스트 API를 호출해 데이터를 가져오는 훅.
|
|
11
14
|
* @hook
|
|
12
15
|
* @param {UseCctvCompanyDataParams} [params] 훅 파라미터
|
|
13
|
-
* @property {string} [username] 사용자 계정 아이디 (Provider에서 주입된 기본값 대신 사용)
|
|
14
16
|
* @property {string} [url] 회사 리스트 API URL (Provider에서 주입된 기본값 대신 사용)
|
|
15
17
|
* @return {UseCctvCompanyDataReturn} 회사 리스트 쿼리 반환값
|
|
16
18
|
* @desc
|
|
17
19
|
* return {
|
|
18
|
-
* data, //
|
|
20
|
+
* data, // common/cctvs 원본 API 응답 데이터
|
|
19
21
|
* isFetching, // 데이터 로딩 중 상태
|
|
20
22
|
* isError, // 데이터 로딩 에러 상태
|
|
21
23
|
* ...rest, // react-query useQuery 반환값
|
|
22
24
|
* }
|
|
23
25
|
*/
|
|
24
|
-
export default function useCctvCompanyData(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const { username, url } = params || {};
|
|
26
|
+
export default function useCctvCompanyData(
|
|
27
|
+
params?: UseCctvCompanyDataParams,
|
|
28
|
+
): UseCctvCompanyDataReturn {
|
|
29
|
+
// 변경: list 조회 계약은 URL만 override 대상으로 유지한다.
|
|
30
|
+
const { url } = params || {};
|
|
30
31
|
|
|
31
32
|
const { listUrl } = useCctvApiUrl();
|
|
32
33
|
const resolvedUrl = useMemo(() => url ?? listUrl, [url, listUrl]);
|
|
33
|
-
const {
|
|
34
|
+
const { setValue } = useCctvContext();
|
|
34
35
|
|
|
35
|
-
//
|
|
36
|
+
// URL에 맞춰 회사 리스트 API를 호출한다.
|
|
36
37
|
const { data, isFetching, isError, ...rest } = useQueryCctvCompanyList({
|
|
37
|
-
username: username ?? contextUsername,
|
|
38
38
|
url: resolvedUrl,
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
// 응답 데이터를 react-hook-form rawData 필드로 반영한다.
|
|
42
42
|
useEffect(() => {
|
|
43
|
-
if (data?.data) {
|
|
44
|
-
|
|
43
|
+
if (data?.data?.items) {
|
|
44
|
+
// 변경: common/cctvs raw items를 template form data 계약에 맞게 재분류한다.
|
|
45
|
+
setValue("rawData", classifyGroups(data.data.items));
|
|
45
46
|
}
|
|
46
47
|
}, [data, setValue]);
|
|
47
48
|
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
CctvCompanyCameraList,
|
|
12
12
|
CctvCompanyGroup,
|
|
13
13
|
CctvCompanyGroupItems,
|
|
14
|
-
|
|
14
|
+
CctvBaseContext,
|
|
15
15
|
UseCctvContextReturn,
|
|
16
16
|
} from "../types";
|
|
17
17
|
import { initCompanyList } from "../utils/data";
|
|
@@ -49,7 +49,7 @@ export default function useCctvContext(): UseCctvContextReturn {
|
|
|
49
49
|
const setCtx = useSetAtom(cctvSelectedContext);
|
|
50
50
|
const liveRegistry = useAtomValue(cctvRtcLiveRegistryAtom);
|
|
51
51
|
// react-hook-form context에서 control/setValue 등을 꺼낸다.
|
|
52
|
-
const { control, setValue, ...context } = useFormContext<
|
|
52
|
+
const { control, setValue, ...context } = useFormContext<CctvBaseContext>();
|
|
53
53
|
|
|
54
54
|
// 폼 상태를 watch 하여 실시간 컨텍스트 값을 얻는다.
|
|
55
55
|
const username = useWatch({ control, name: "username" });
|
package/src/cctv/types/api.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { API_Res_Base } from "@uniai-fe/util-api";
|
|
1
2
|
import type { UtilQueryBaseParams } from "@uniai-fe/util-functions";
|
|
2
3
|
import type { NextRequest } from "next/server";
|
|
3
4
|
|
|
@@ -6,20 +7,25 @@ import type { NextRequest } from "next/server";
|
|
|
6
7
|
* @property {string} domain API 요청 도메인(서버)
|
|
7
8
|
* @property {string} routeUrl Next.js app/api 이하 경로 url
|
|
8
9
|
* @property {string} [queryUrl] 백엔드 요청 url
|
|
9
|
-
* @property {
|
|
10
|
+
* @property {"me" | "all"} [scope] common/cctvs 조회 범위
|
|
10
11
|
*/
|
|
11
|
-
export interface API_Req_GetCompanyListParams
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export interface API_Req_GetCompanyListParams {
|
|
13
|
+
/**
|
|
14
|
+
* API 도메인
|
|
15
|
+
*/
|
|
16
|
+
domain: string;
|
|
17
|
+
/**
|
|
18
|
+
* Next.js app/api 이하 경로 url
|
|
19
|
+
*/
|
|
20
|
+
routeUrl: string;
|
|
15
21
|
/**
|
|
16
22
|
* 백엔드 요청 url
|
|
17
23
|
*/
|
|
18
24
|
queryUrl?: string;
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
26
|
+
* common/cctvs 조회 범위
|
|
21
27
|
*/
|
|
22
|
-
|
|
28
|
+
scope?: "me" | "all";
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/**
|
|
@@ -115,15 +121,27 @@ export interface API_Res_CctvCompanyGroup {
|
|
|
115
121
|
}
|
|
116
122
|
|
|
117
123
|
/**
|
|
118
|
-
* CCTV;
|
|
119
|
-
* @property {API_Res_CctvCompanyGroup[]}
|
|
120
|
-
* @property {number} total_count
|
|
124
|
+
* CCTV; common/cctvs 원본 응답 데이터
|
|
125
|
+
* @property {API_Res_CctvCompanyGroup[]} items 백엔드 원본 업체 그룹 목록
|
|
126
|
+
* @property {number} total_count 전체 업체 그룹 수
|
|
121
127
|
*/
|
|
122
|
-
export interface
|
|
123
|
-
|
|
128
|
+
export interface API_Res_CctvCompanyData {
|
|
129
|
+
/**
|
|
130
|
+
* 백엔드 원본 업체 그룹 목록
|
|
131
|
+
*/
|
|
132
|
+
items: API_Res_CctvCompanyGroup[];
|
|
133
|
+
/**
|
|
134
|
+
* 전체 업체 그룹 수
|
|
135
|
+
*/
|
|
124
136
|
total_count: number;
|
|
125
137
|
}
|
|
126
138
|
|
|
139
|
+
/**
|
|
140
|
+
* CCTV; common/cctvs 원본 응답
|
|
141
|
+
* @typedef {API_Res_Base<API_Res_CctvCompanyData>} API_Res_CctvCompany
|
|
142
|
+
*/
|
|
143
|
+
export type API_Res_CctvCompany = API_Res_Base<API_Res_CctvCompanyData>;
|
|
144
|
+
|
|
127
145
|
/**
|
|
128
146
|
* CCTV; 실시간 스트리밍 토큰 요청 (Next.js API 요청)
|
|
129
147
|
* @property {string} company_id 업체 id코드
|
|
@@ -59,13 +59,17 @@ export interface CctvApiUrlContext {
|
|
|
59
59
|
* CCTV; 실시간 영상보기 컨텍스트
|
|
60
60
|
* @property {string} [company_id] 선택된 업체 id코드
|
|
61
61
|
* @property {string} [cam_id] 선택된 카메라 id코드
|
|
62
|
+
* @property {string} username CCTV 조회시 권한 확인을 위한 계정명
|
|
62
63
|
* @property {string} [search] 검색 키워드 (입력값)
|
|
63
64
|
* @property {string} [filter] 검색 키워드 (필터값)
|
|
64
65
|
* @property {API_Res_CctvCompanyGroup[]} rawData 원본 데이터 배열
|
|
65
66
|
* @property {boolean} isFetching 데이터 로딩 상태
|
|
66
67
|
* @property {boolean} isError 데이터 에러 상태
|
|
67
68
|
*/
|
|
68
|
-
export interface
|
|
69
|
+
export interface CctvBaseContext extends CctvSelectedContext {
|
|
70
|
+
/**
|
|
71
|
+
* CCTV 조회시 권한 확인을 위한 계정명
|
|
72
|
+
*/
|
|
69
73
|
username: string;
|
|
70
74
|
/**
|
|
71
75
|
* 검색 키워드 (입력값)
|
|
@@ -79,21 +83,56 @@ export interface CctvContext extends CctvSelectedContext {
|
|
|
79
83
|
* 원본 데이터 배열
|
|
80
84
|
*/
|
|
81
85
|
rawData: API_Res_CctvCompanyGroup[];
|
|
86
|
+
/**
|
|
87
|
+
* 데이터 로딩 상태
|
|
88
|
+
*/
|
|
82
89
|
isFetching: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* 데이터 에러 상태
|
|
92
|
+
*/
|
|
83
93
|
isError: boolean;
|
|
84
94
|
}
|
|
85
95
|
|
|
96
|
+
/**
|
|
97
|
+
* CCTV; Provider form context
|
|
98
|
+
* @template ContextExtension
|
|
99
|
+
* @typedef {CctvBaseContext & ContextExtension} CctvContext
|
|
100
|
+
* @property {string} [company_id] 선택된 업체 id코드
|
|
101
|
+
* @property {string} [cam_id] 선택된 카메라 id코드
|
|
102
|
+
* @property {string} username CCTV 조회시 권한 확인을 위한 계정명
|
|
103
|
+
* @property {string} search 검색 키워드 입력값
|
|
104
|
+
* @property {string} filter 검색 키워드 필터값
|
|
105
|
+
* @property {API_Res_CctvCompanyGroup[]} rawData 원본 데이터 배열
|
|
106
|
+
* @property {boolean} isFetching 데이터 로딩 상태
|
|
107
|
+
* @property {boolean} isError 데이터 에러 상태
|
|
108
|
+
*/
|
|
109
|
+
export type CctvContext<ContextExtension extends object = object> =
|
|
110
|
+
CctvBaseContext & ContextExtension;
|
|
111
|
+
|
|
86
112
|
/**
|
|
87
113
|
* CCTV; Provider props
|
|
114
|
+
* @template ContextExtension
|
|
88
115
|
* @property {string} [company_id] 선택된 업체 id코드
|
|
89
116
|
* @property {string} [cam_id] 선택된 카메라 id코드
|
|
90
117
|
* @property {string} [listUrl] company-list API 요청 경로
|
|
91
118
|
* @property {string} [tokenUrl] token API 요청 경로
|
|
92
119
|
* @property {string} [username] CCTV 조회시 권한 확인을 위한 계정명
|
|
120
|
+
* @property {ContextExtension} [defaultValues] 서비스 확장 context 기본값
|
|
93
121
|
* @property {React.ReactNode} children
|
|
94
122
|
*/
|
|
95
|
-
export type CctvProviderProps =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
123
|
+
export type CctvProviderProps<ContextExtension extends object = object> =
|
|
124
|
+
CctvSelectedContext &
|
|
125
|
+
CctvApiUrlContext & {
|
|
126
|
+
/**
|
|
127
|
+
* CCTV 조회시 권한 확인을 위한 계정명
|
|
128
|
+
*/
|
|
129
|
+
username?: string;
|
|
130
|
+
/**
|
|
131
|
+
* 서비스 확장 context 기본값
|
|
132
|
+
*/
|
|
133
|
+
defaultValues?: ContextExtension;
|
|
134
|
+
/**
|
|
135
|
+
* Provider 하위 콘텐츠
|
|
136
|
+
*/
|
|
137
|
+
children: React.ReactNode;
|
|
138
|
+
};
|
package/src/cctv/types/hook.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
CctvCompanyGroupItems,
|
|
8
8
|
} from "./list";
|
|
9
9
|
import type { UseFormReturn } from "react-hook-form";
|
|
10
|
-
import type {
|
|
10
|
+
import type { CctvBaseContext } from "./context";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* CCTV; useCctvRtcStream params
|
|
@@ -92,14 +92,9 @@ export interface UseCctvRtcStreamReturn extends UseCctvRtcStreamState {
|
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* CCTV; useCctvCompanyData params
|
|
95
|
-
* @property {string} [username] 사용자 계정 아이디
|
|
96
95
|
* @property {string} [url] 업체 리스트 API URL
|
|
97
96
|
*/
|
|
98
97
|
export interface UseCctvCompanyDataParams {
|
|
99
|
-
/**
|
|
100
|
-
* 사용자 계정 아이디
|
|
101
|
-
*/
|
|
102
|
-
username?: string;
|
|
103
98
|
/**
|
|
104
99
|
* 업체 리스트 API URL
|
|
105
100
|
*/
|
|
@@ -108,7 +103,7 @@ export interface UseCctvCompanyDataParams {
|
|
|
108
103
|
|
|
109
104
|
/**
|
|
110
105
|
* CCTV; useCctvCompanyData return
|
|
111
|
-
* @property {API_Res_CctvCompany | undefined} data
|
|
106
|
+
* @property {API_Res_CctvCompany | undefined} data common/cctvs 원본 API 응답 데이터
|
|
112
107
|
* @property {boolean} isFetching 데이터 로딩 중 상태
|
|
113
108
|
* @property {boolean} isError 데이터 로딩 에러 상태
|
|
114
109
|
*/
|
|
@@ -140,7 +135,7 @@ export interface UseCctvCompanyDataReturn extends Omit<
|
|
|
140
135
|
* @property {(cam_id: string) => void} onOpenCamera 카메라 선택 함수
|
|
141
136
|
* @property {() => void} onCloseCamera 카메라 선택 해제 함수
|
|
142
137
|
*/
|
|
143
|
-
export interface UseCctvContextReturn extends UseFormReturn<
|
|
138
|
+
export interface UseCctvContextReturn extends UseFormReturn<CctvBaseContext> {
|
|
144
139
|
/**
|
|
145
140
|
* 데이터 로딩 중 상태
|
|
146
141
|
*/
|