@farmzone/fz-template-react 1.0.3 → 1.0.5

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.
Files changed (51) hide show
  1. package/README.md +46 -50
  2. package/package.json +1 -1
  3. package/template/.env.example +5 -5
  4. package/template/package.json +55 -55
  5. package/template/pnpm-lock.yaml +4214 -4214
  6. package/template/public/mockServiceWorker.js +349 -349
  7. package/template/src/app/api/api.ts +178 -178
  8. package/template/src/app/api/queries.ts +326 -321
  9. package/template/src/app/api/queryKey.ts +7 -7
  10. package/template/src/app/api/token.ts +7 -7
  11. package/template/src/app/layout/Layout.tsx +33 -33
  12. package/template/src/app/layout/ListContents.tsx +9 -9
  13. package/template/src/app/layout/ListHeader.tsx +41 -41
  14. package/template/src/app/layout/MultiTabNav.tsx +101 -101
  15. package/template/src/app/layout/Sidebar.tsx +33 -33
  16. package/template/src/app/layout/UserInfo.tsx +94 -94
  17. package/template/src/app/layout/tabSwitchStore.ts +11 -11
  18. package/template/src/app/router/Router.tsx +56 -56
  19. package/template/src/app/store/index.ts +26 -26
  20. package/template/src/index.tsx +21 -21
  21. package/template/src/mocks/browser.ts +17 -17
  22. package/template/src/mocks/handlers.ts +43 -43
  23. package/template/src/mocks/scenarios.ts +57 -57
  24. package/template/src/pages/dashboard/index.tsx +541 -541
  25. package/template/src/pages/error/Error.tsx +29 -29
  26. package/template/src/pages/error/NotFound.tsx +27 -27
  27. package/template/src/pages/login/index.tsx +317 -317
  28. package/template/src/pages/post/PostFormModal.tsx +128 -128
  29. package/template/src/pages/post/detail/index.tsx +548 -548
  30. package/template/src/pages/post/index.tsx +266 -267
  31. package/template/src/pages/sample/SampleFormModal.tsx +115 -77
  32. package/template/src/pages/sample/detail/index.tsx +400 -424
  33. package/template/src/pages/sample/index.tsx +278 -269
  34. package/template/src/pages/sample/modal/index.tsx +300 -253
  35. package/template/src/pages/system/log/index.tsx +173 -173
  36. package/template/src/pages/user/config/columns.tsx +102 -109
  37. package/template/src/pages/user/config/schema.ts +54 -54
  38. package/template/src/pages/user/index.tsx +641 -641
  39. package/template/src/shared/components/CommentInput.tsx +243 -243
  40. package/template/src/shared/config/text.ts +27 -27
  41. package/template/src/shared/utils/format.ts +11 -11
  42. package/template/src/types/auth.ts +10 -10
  43. package/template/src/types/comment.ts +33 -33
  44. package/template/src/types/common.ts +19 -19
  45. package/template/src/types/dashboard.ts +53 -53
  46. package/template/src/types/index.ts +16 -16
  47. package/template/src/types/log.ts +21 -21
  48. package/template/src/types/post.ts +32 -32
  49. package/template/src/types/sample.ts +29 -28
  50. package/template/src/types/user.ts +51 -51
  51. package/template/src/vite-env.d.ts +10 -10
@@ -1,19 +1,19 @@
1
- export interface PageResponse<T> {
2
- content: Array<T>;
3
- totalElements: number;
4
- totalPages: number;
5
- page: number;
6
- size: number;
7
- }
8
-
9
- export interface FileResponse {
10
- id: number;
11
- fileName: string;
12
- filePath: string;
13
- fileType: string;
14
- fileSize: number;
15
- serviceCode: string;
16
- refId: number;
17
- createdAt: string;
18
- path?: string;
19
- }
1
+ export interface PageResponse<T> {
2
+ content: Array<T>;
3
+ totalElements: number;
4
+ totalPages: number;
5
+ page: number;
6
+ size: number;
7
+ }
8
+
9
+ export interface FileResponse {
10
+ id: number;
11
+ fileName: string;
12
+ filePath: string;
13
+ fileType: string;
14
+ fileSize: number;
15
+ serviceCode: string;
16
+ refId: number;
17
+ createdAt: string;
18
+ path?: string;
19
+ }
@@ -1,53 +1,53 @@
1
- export interface DashboardSummary {
2
- totalUsers: number;
3
- todayJoinedUsers: number;
4
- recentActiveUsers: number;
5
- withdrawalRate: number;
6
- }
7
-
8
- export interface DashboardTrend {
9
- labels: string[];
10
- joinedCounts: number[];
11
- withdrawnCounts: number[];
12
- }
13
-
14
- export interface DashboardGender {
15
- maleRate: number;
16
- femaleRate: number;
17
- unknownRate: number;
18
- }
19
-
20
- export interface DashboardAgeGroup {
21
- label: string;
22
- count: number;
23
- rate: number;
24
- }
25
-
26
- export interface DashboardDemographics {
27
- gender: DashboardGender;
28
- ageGroups: DashboardAgeGroup[];
29
- }
30
-
31
- export interface DashboardRecentUser {
32
- id: number;
33
- userId: string;
34
- name: string;
35
- gender: string;
36
- age: number;
37
- createdAt: string;
38
- role: string;
39
- active: boolean;
40
- }
41
-
42
- export interface DashboardDailyActiveUsers {
43
- labels: string[];
44
- counts: number[];
45
- }
46
-
47
- export interface UserDashboardResponse {
48
- summary: DashboardSummary;
49
- trend: DashboardTrend;
50
- demographics: DashboardDemographics;
51
- recentUsers: DashboardRecentUser[];
52
- dailyActiveUsers: DashboardDailyActiveUsers;
53
- }
1
+ export interface DashboardSummary {
2
+ totalUsers: number;
3
+ todayJoinedUsers: number;
4
+ recentActiveUsers: number;
5
+ withdrawalRate: number;
6
+ }
7
+
8
+ export interface DashboardTrend {
9
+ labels: string[];
10
+ joinedCounts: number[];
11
+ withdrawnCounts: number[];
12
+ }
13
+
14
+ export interface DashboardGender {
15
+ maleRate: number;
16
+ femaleRate: number;
17
+ unknownRate: number;
18
+ }
19
+
20
+ export interface DashboardAgeGroup {
21
+ label: string;
22
+ count: number;
23
+ rate: number;
24
+ }
25
+
26
+ export interface DashboardDemographics {
27
+ gender: DashboardGender;
28
+ ageGroups: DashboardAgeGroup[];
29
+ }
30
+
31
+ export interface DashboardRecentUser {
32
+ id: number;
33
+ userId: string;
34
+ name: string;
35
+ gender: string;
36
+ age: number;
37
+ createdAt: string;
38
+ role: string;
39
+ active: boolean;
40
+ }
41
+
42
+ export interface DashboardDailyActiveUsers {
43
+ labels: string[];
44
+ counts: number[];
45
+ }
46
+
47
+ export interface UserDashboardResponse {
48
+ summary: DashboardSummary;
49
+ trend: DashboardTrend;
50
+ demographics: DashboardDemographics;
51
+ recentUsers: DashboardRecentUser[];
52
+ dailyActiveUsers: DashboardDailyActiveUsers;
53
+ }
@@ -1,16 +1,16 @@
1
- export type { PageResponse, FileResponse } from "./common";
2
- export type { LoginResponse } from "./auth";
3
- export type { SampleCategory, Sample, GetSamplesParams, SampleForm } from "./sample";
4
- export type { NoticeCategory, Post, GetPostsParams, PostForm } from "./post";
5
- export type { CommentReply, Comment, CommentForm, CommentTargetType, CommentEditForm } from "./comment";
6
- export type { UserRole, User, GetUsersParams, UserForm, UserEditForm } from "./user";
7
- export type { ActionLog, GetLogsParams } from "./log";
8
- export type {
9
- UserDashboardResponse,
10
- DashboardSummary,
11
- DashboardTrend,
12
- DashboardDemographics,
13
- DashboardAgeGroup,
14
- DashboardRecentUser,
15
- DashboardDailyActiveUsers,
16
- } from "./dashboard";
1
+ export type { PageResponse, FileResponse } from "./common";
2
+ export type { LoginResponse } from "./auth";
3
+ export type { SampleCategory, Sample, GetSamplesParams, SampleForm } from "./sample";
4
+ export type { NoticeCategory, Post, GetPostsParams, PostForm } from "./post";
5
+ export type { CommentReply, Comment, CommentForm, CommentTargetType, CommentEditForm } from "./comment";
6
+ export type { UserRole, User, GetUsersParams, UserForm, UserEditForm } from "./user";
7
+ export type { ActionLog, GetLogsParams } from "./log";
8
+ export type {
9
+ UserDashboardResponse,
10
+ DashboardSummary,
11
+ DashboardTrend,
12
+ DashboardDemographics,
13
+ DashboardAgeGroup,
14
+ DashboardRecentUser,
15
+ DashboardDailyActiveUsers,
16
+ } from "./dashboard";
@@ -1,21 +1,21 @@
1
- export interface ActionLog {
2
- id: number;
3
- userId: string;
4
- userName: string;
5
- action: string;
6
- target: string;
7
- detail: string;
8
- createdAt: string;
9
- }
10
-
11
- export interface GetLogsParams {
12
- page: number;
13
- size: number;
14
- userRole?: string;
15
- action?: string;
16
- pageOption?: string;
17
- keywordType?: string;
18
- keyword?: string;
19
- startDate?: string;
20
- endDate?: string;
21
- }
1
+ export interface ActionLog {
2
+ id: number;
3
+ userId: string;
4
+ userName: string;
5
+ action: string;
6
+ target: string;
7
+ detail: string;
8
+ createdAt: string;
9
+ }
10
+
11
+ export interface GetLogsParams {
12
+ page: number;
13
+ size: number;
14
+ userRole?: string;
15
+ action?: string;
16
+ pageOption?: string;
17
+ keywordType?: string;
18
+ keyword?: string;
19
+ startDate?: string;
20
+ endDate?: string;
21
+ }
@@ -1,32 +1,32 @@
1
- import type { FileResponse } from "./common";
2
-
3
- export type NoticeCategory = "NOTICE";
4
-
5
- export interface Post {
6
- id: number;
7
- title: string;
8
- content: string;
9
- noticeCategory: NoticeCategory;
10
- files?: Array<FileResponse>;
11
- createdAt: string;
12
- updatedAt: string;
13
- writer: string; // User login id
14
- visible: boolean;
15
- }
16
-
17
- export interface GetPostsParams {
18
- page: number;
19
- size: number;
20
- title?: string;
21
- noticeCategory?: string;
22
- sortKey?: string;
23
- sortOrder?: "asc" | "desc";
24
- }
25
-
26
- export interface PostForm {
27
- title: string;
28
- content: string;
29
- noticeCategory: NoticeCategory;
30
- visible: boolean;
31
- writer: string;
32
- }
1
+ import type { FileResponse } from "./common";
2
+
3
+ export type NoticeCategory = "NOTICE";
4
+
5
+ export interface Post {
6
+ id: number;
7
+ title: string;
8
+ content: string;
9
+ noticeCategory: NoticeCategory;
10
+ files?: Array<FileResponse>;
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ writer: string; // User login id
14
+ visible: boolean;
15
+ }
16
+
17
+ export interface GetPostsParams {
18
+ page: number;
19
+ size: number;
20
+ title?: string;
21
+ noticeCategory?: string;
22
+ sortKey?: string;
23
+ sortOrder?: "asc" | "desc";
24
+ }
25
+
26
+ export interface PostForm {
27
+ title: string;
28
+ content: string;
29
+ noticeCategory: NoticeCategory;
30
+ visible: boolean;
31
+ writer: string;
32
+ }
@@ -1,28 +1,29 @@
1
- export type SampleCategory = "BASIC" | "ADVANCED";
2
-
3
- export interface Sample {
4
- id: number;
5
- name: string;
6
- description: string;
7
- category: SampleCategory;
8
- priority: number;
9
- active: boolean;
10
- createdAt: string;
11
- updatedAt: string;
12
- }
13
-
14
- export interface GetSamplesParams {
15
- page: number;
16
- size: number;
17
- name?: string;
18
- category?: string;
19
- sortKey?: string;
20
- sortOrder?: "asc" | "desc";
21
- }
22
-
23
- export interface SampleForm {
24
- name: string;
25
- description: string;
26
- category: SampleCategory;
27
- active: boolean;
28
- }
1
+ export type SampleCategory = "BASIC" | "ADVANCED";
2
+
3
+ export interface Sample {
4
+ id: number;
5
+ name: string;
6
+ description: string;
7
+ category: SampleCategory;
8
+ priority: number;
9
+ active: boolean;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+
14
+ export interface GetSamplesParams {
15
+ page: number;
16
+ size: number;
17
+ name?: string;
18
+ category?: string;
19
+ sortKey?: string;
20
+ sortOrder?: "asc" | "desc";
21
+ }
22
+
23
+ export interface SampleForm {
24
+ name: string;
25
+ description: string;
26
+ category: SampleCategory;
27
+ priority: number;
28
+ active: boolean;
29
+ }
@@ -1,51 +1,51 @@
1
- import type { FileResponse } from "./common";
2
-
3
- export type UserRole = "ADMIN" | "USER";
4
-
5
- export interface User {
6
- id: number;
7
- userId: string;
8
- name: string;
9
- role: UserRole;
10
- active: boolean;
11
- gender?: string;
12
- birthday?: string;
13
- phone?: string;
14
- deletedAt?: string | null;
15
- createdAt: string;
16
- updatedAt?: string;
17
- lastLoginAt: string | null;
18
- files?: Array<FileResponse>;
19
- }
20
-
21
- export interface GetUsersParams {
22
- page: number;
23
- size: number;
24
- role?: string;
25
- keywordType?: string;
26
- keyword?: string;
27
- dateType?: string;
28
- startDate?: string;
29
- endDate?: string;
30
- }
31
-
32
- export interface UserForm {
33
- userId: string;
34
- password: string;
35
- name: string;
36
- role: UserRole;
37
- gender?: string;
38
- birthday?: string;
39
- phone?: string;
40
- }
41
-
42
- export interface UserEditForm {
43
- name: string;
44
- role: UserRole;
45
- active: boolean;
46
- gender?: string;
47
- birthday?: string;
48
- phone?: string;
49
- password?: string;
50
- deleteFileIds?: Array<number>;
51
- }
1
+ import type { FileResponse } from "./common";
2
+
3
+ export type UserRole = "ADMIN" | "USER";
4
+
5
+ export interface User {
6
+ id: number;
7
+ userId: string;
8
+ name: string;
9
+ role: UserRole;
10
+ active: boolean;
11
+ gender?: string;
12
+ birthday?: string;
13
+ phone?: string;
14
+ deletedAt?: string | null;
15
+ createdAt: string;
16
+ updatedAt?: string;
17
+ lastLoginAt: string | null;
18
+ files?: Array<FileResponse>;
19
+ }
20
+
21
+ export interface GetUsersParams {
22
+ page: number;
23
+ size: number;
24
+ role?: string;
25
+ keywordType?: string;
26
+ keyword?: string;
27
+ dateType?: string;
28
+ startDate?: string;
29
+ endDate?: string;
30
+ }
31
+
32
+ export interface UserForm {
33
+ userId: string;
34
+ password: string;
35
+ name: string;
36
+ role: UserRole;
37
+ gender?: string;
38
+ birthday?: string;
39
+ phone?: string;
40
+ }
41
+
42
+ export interface UserEditForm {
43
+ name: string;
44
+ role: UserRole;
45
+ active: boolean;
46
+ gender?: string;
47
+ birthday?: string;
48
+ phone?: string;
49
+ password?: string;
50
+ deleteFileIds?: Array<number>;
51
+ }
@@ -1,10 +1,10 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_APP_API_HOST: string;
5
- readonly VITE_APP_API_VERSION: string;
6
- }
7
-
8
- interface ImportMeta {
9
- readonly env: ImportMetaEnv;
10
- }
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_API_HOST: string;
5
+ readonly VITE_APP_API_VERSION: string;
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv;
10
+ }