wad-lab 1.1.6 → 1.1.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.
Files changed (93) hide show
  1. package/package.json +1 -1
  2. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/controller/CompanyController.java +88 -74
  3. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/model/Employee.java +73 -73
  4. package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/service/CompanyService.java +90 -60
  5. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/App.vue +429 -405
  6. package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/App.vue +177 -159
  7. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/App.vue +441 -427
  8. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/stores/companyStore.js +126 -96
  9. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/App.vue +84 -69
  10. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/components/DepartmentSection.vue +164 -152
  11. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/components/EmployeeSection.vue +193 -181
  12. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/stores/companyStore.js +126 -35
  13. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/App.vue +191 -167
  14. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/DepartmentForm.vue +98 -98
  15. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/DepartmentList.vue +92 -91
  16. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/EmployeeForm.vue +128 -128
  17. package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/EmployeeList.vue +95 -94
  18. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/App.vue +90 -90
  19. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/AddEmployeeView.vue +247 -247
  20. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/DepartmentView.vue +296 -273
  21. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/EmployeeView.vue +219 -196
  22. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/HomeDashboardView.vue +263 -263
  23. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/DepartmentListView.vue +250 -231
  24. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeDetailView.vue +181 -159
  25. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeListView.vue +315 -295
  26. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/stores/companyStore.js +137 -70
  27. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DepartmentView.vue +229 -209
  28. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/EmployeeView.vue +257 -237
  29. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/components/EntityTable.vue +106 -92
  30. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/stores/companyStore.js +139 -84
  31. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/ManageDepartmentsView.vue +73 -64
  32. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/ManageEmployeesView.vue +76 -67
  33. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/App.vue +59 -59
  34. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/components/DataCard.vue +72 -53
  35. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/views/DepartmentPage.vue +89 -77
  36. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/views/EmployeePage.vue +128 -116
  37. package/templates/springboot-2model-1controller-api/src/main/java/com/example/company/controller/CompanyController.java +88 -74
  38. package/templates/springboot-2model-1controller-api/src/main/java/com/example/company/model/Employee.java +73 -73
  39. package/templates/springboot-2model-1controller-api/src/main/java/com/example/company/service/CompanyService.java +90 -60
  40. package/templates/springboot-course-registration/src/main/java/com/example/coursereg/controller/CourseController.java +46 -42
  41. package/templates/springboot-course-registration/src/main/java/com/example/coursereg/service/CourseService.java +70 -60
  42. package/templates/springboot-hospital-api/src/main/java/com/example/hospital/controller/HospitalController.java +54 -50
  43. package/templates/springboot-hospital-api/src/main/java/com/example/hospital/service/HospitalService.java +65 -54
  44. package/templates/springboot-library-api/src/main/java/com/example/library/controller/LibraryController.java +57 -51
  45. package/templates/springboot-library-api/src/main/java/com/example/library/service/LibraryService.java +70 -60
  46. package/templates/springboot-mockmvc/src/main/java/com/example/mockmvc/controller/ItemController.java +45 -41
  47. package/templates/springboot-mockmvc/src/main/java/com/example/mockmvc/service/ItemService.java +48 -38
  48. package/templates/springboot-mongo-aggregation/src/main/java/com/example/aggregation/controller/ItemController.java +45 -41
  49. package/templates/springboot-mongo-aggregation/src/main/java/com/example/aggregation/service/ItemService.java +48 -38
  50. package/templates/springboot-mongo-aggregation-mockmvc/src/main/java/com/example/aggmockmvc/controller/ItemController.java +45 -41
  51. package/templates/springboot-mongo-aggregation-mockmvc/src/main/java/com/example/aggmockmvc/service/ItemService.java +48 -38
  52. package/templates/springboot-mongo-crud/src/main/java/com/example/crud/controller/ItemController.java +45 -41
  53. package/templates/springboot-mongo-crud/src/main/java/com/example/crud/service/ItemService.java +48 -38
  54. package/templates/vue-axios/src/App.vue +264 -243
  55. package/templates/vue-axios/src/services/ItemService.js +27 -21
  56. package/templates/vue-axios-basic/src/App.vue +24 -0
  57. package/templates/vue-axios-interceptor/src/App.vue +177 -159
  58. package/templates/vue-axios-pinia/src/App.vue +14 -0
  59. package/templates/vue-axios-pinia/src/stores/companyStore.js +126 -96
  60. package/templates/vue-axios-pinia-props/src/App.vue +84 -69
  61. package/templates/vue-axios-pinia-props/src/components/DepartmentSection.vue +164 -152
  62. package/templates/vue-axios-pinia-props/src/components/EmployeeSection.vue +193 -181
  63. package/templates/vue-axios-pinia-props/src/stores/companyStore.js +126 -35
  64. package/templates/vue-axios-props-emits/src/App.vue +24 -0
  65. package/templates/vue-axios-props-emits/src/components/DepartmentList.vue +2 -1
  66. package/templates/vue-axios-props-emits/src/components/EmployeeList.vue +2 -1
  67. package/templates/vue-axios-router/src/views/DepartmentView.vue +23 -0
  68. package/templates/vue-axios-router/src/views/EmployeeView.vue +23 -0
  69. package/templates/vue-axios-router-children/src/views/DepartmentListView.vue +250 -231
  70. package/templates/vue-axios-router-children/src/views/EmployeeDetailView.vue +181 -159
  71. package/templates/vue-axios-router-children/src/views/EmployeeListView.vue +315 -295
  72. package/templates/vue-axios-router-pinia/src/stores/companyStore.js +137 -70
  73. package/templates/vue-axios-router-pinia/src/views/DepartmentView.vue +229 -209
  74. package/templates/vue-axios-router-pinia/src/views/EmployeeView.vue +257 -237
  75. package/templates/vue-axios-router-pinia-props/src/components/EntityTable.vue +106 -92
  76. package/templates/vue-axios-router-pinia-props/src/stores/companyStore.js +139 -84
  77. package/templates/vue-axios-router-pinia-props/src/views/ManageDepartmentsView.vue +73 -64
  78. package/templates/vue-axios-router-pinia-props/src/views/ManageEmployeesView.vue +76 -67
  79. package/templates/vue-axios-router-props/src/components/DataCard.vue +72 -53
  80. package/templates/vue-axios-router-props/src/views/DepartmentPage.vue +89 -77
  81. package/templates/vue-axios-router-props/src/views/EmployeePage.vue +128 -116
  82. package/templates/vue-fetch/src/App.vue +285 -259
  83. package/templates/vue-router-pinia-springboot/backend/src/main/java/com/example/crud/controller/ItemController.java +45 -41
  84. package/templates/vue-router-pinia-springboot/backend/src/main/java/com/example/crud/service/ItemService.java +45 -35
  85. package/templates/vue-router-pinia-springboot/frontend/src/services/ItemService.js +24 -21
  86. package/templates/vue-router-pinia-springboot/frontend/src/stores/itemStore.js +42 -37
  87. package/templates/vue-router-pinia-springboot/frontend/src/views/ListView.vue +76 -67
  88. package/templates/vue-springboot-mongo-aggregation/backend/src/main/java/com/example/aggregation/controller/ItemController.java +45 -41
  89. package/templates/vue-springboot-mongo-aggregation/backend/src/main/java/com/example/aggregation/service/ItemService.java +45 -35
  90. package/templates/vue-springboot-mongo-crud/backend/src/main/java/com/example/crud/controller/ItemController.java +45 -41
  91. package/templates/vue-springboot-mongo-crud/backend/src/main/java/com/example/crud/service/ItemService.java +45 -35
  92. package/templates/vue-springboot-mongo-crud/frontend/src/App.vue +158 -149
  93. package/templates/vue-springboot-mongo-crud/frontend/src/services/ItemService.js +24 -21
@@ -1,159 +1,177 @@
1
- <script setup>
2
- import { ref, reactive } from 'vue'
3
- import api from './services/api'
4
- import ToastNotification from './components/ToastNotification.vue'
5
-
6
- const departments = ref([
7
- { id: 1, name: 'Engineering', location: 'Floor 3' },
8
- { id: 2, name: 'Marketing', location: 'Floor 2' }
9
- ])
10
-
11
- const newDept = reactive({
12
- name: '',
13
- location: ''
14
- })
15
-
16
- async function fetchDepartments() {
17
- try {
18
- const res = await api.get('/departments')
19
- departments.value = res.data
20
- } catch (err) {
21
- }
22
- }
23
-
24
- async function addDepartment() {
25
- if (!newDept.name) return
26
- try {
27
- const res = await api.post('/departments', {
28
- name: newDept.name,
29
- location: newDept.location
30
- })
31
- departments.value.push(res.data || { id: Date.now(), name: newDept.name, location: newDept.location })
32
- newDept.name = ''
33
- newDept.location = ''
34
- } catch (err) {
35
- }
36
- }
37
-
38
- async function triggerError() {
39
- try {
40
- await api.get('/departments/invalid-id')
41
- } catch (err) {
42
- }
43
- }
44
- </script>
45
-
46
- <template>
47
- <div class="container">
48
- <ToastNotification />
49
- <h1>Department Management</h1>
50
-
51
- <div class="actions">
52
- <button @click="fetchDepartments">Fetch Departments (GET)</button>
53
- <button class="btn-error" @click="triggerError">Trigger 404 Error (GET)</button>
54
- </div>
55
-
56
- <form class="form" @submit.prevent="addDepartment">
57
- <input v-model="newDept.name" placeholder="Department Name" required />
58
- <input v-model="newDept.location" placeholder="Location" required />
59
- <button type="submit">Add Department (POST)</button>
60
- </form>
61
-
62
- <table class="table">
63
- <thead>
64
- <tr>
65
- <th>ID</th>
66
- <th>Name</th>
67
- <th>Location</th>
68
- </tr>
69
- </thead>
70
- <tbody>
71
- <tr v-for="dept in departments" :key="dept.id">
72
- <td>{{ dept.id }}</td>
73
- <td>{{ dept.name }}</td>
74
- <td>{{ dept.location }}</td>
75
- </tr>
76
- </tbody>
77
- </table>
78
- </div>
79
- </template>
80
-
81
- <style>
82
- body {
83
- margin: 0;
84
- font-family: sans-serif;
85
- background-color: #f7f9fa;
86
- color: #333;
87
- }
88
-
89
- .container {
90
- max-width: 800px;
91
- margin: 40px auto;
92
- padding: 20px;
93
- background: #fff;
94
- border: 1px solid #ddd;
95
- border-radius: 6px;
96
- }
97
-
98
- h1 {
99
- margin-top: 0;
100
- font-size: 22px;
101
- }
102
-
103
- .actions {
104
- display: flex;
105
- gap: 10px;
106
- margin-bottom: 20px;
107
- }
108
-
109
- button {
110
- padding: 8px 14px;
111
- border: 1px solid #1976d2;
112
- background-color: #1976d2;
113
- color: #fff;
114
- border-radius: 4px;
115
- cursor: pointer;
116
- }
117
-
118
- button:hover {
119
- background-color: #1565c0;
120
- }
121
-
122
- button.btn-error {
123
- border-color: #d32f2f;
124
- background-color: #d32f2f;
125
- }
126
-
127
- button.btn-error:hover {
128
- background-color: #b71c1c;
129
- }
130
-
131
- .form {
132
- display: flex;
133
- gap: 10px;
134
- margin-bottom: 20px;
135
- }
136
-
137
- input {
138
- padding: 8px;
139
- border: 1px solid #ccc;
140
- border-radius: 4px;
141
- flex: 1;
142
- }
143
-
144
- .table {
145
- width: 100%;
146
- border-collapse: collapse;
147
- }
148
-
149
- .table th,
150
- .table td {
151
- border: 1px solid #ddd;
152
- padding: 10px;
153
- text-align: left;
154
- }
155
-
156
- .table th {
157
- background-color: #f0f0f0;
158
- }
159
- </style>
1
+ <script setup>
2
+ import { ref, reactive } from 'vue'
3
+ import api from './services/api'
4
+ import ToastNotification from './components/ToastNotification.vue'
5
+
6
+ const departments = ref([
7
+ { id: 1, name: 'Engineering', location: 'Floor 3' },
8
+ { id: 2, name: 'Marketing', location: 'Floor 2' }
9
+ ])
10
+
11
+ const newDept = reactive({
12
+ name: '',
13
+ location: ''
14
+ })
15
+
16
+ async function fetchDepartments() {
17
+ try {
18
+ const res = await api.get('/departments')
19
+ departments.value = res.data
20
+ } catch (err) {
21
+ }
22
+ }
23
+
24
+ async function addDepartment() {
25
+ if (!newDept.name) return
26
+ try {
27
+ const res = await api.post('/departments', {
28
+ name: newDept.name,
29
+ location: newDept.location
30
+ })
31
+ departments.value.push(res.data || { id: Date.now(), name: newDept.name, location: newDept.location })
32
+ newDept.name = ''
33
+ newDept.location = ''
34
+ } catch (err) {
35
+ }
36
+ }
37
+
38
+ async function testPatchEmployeeSalary() {
39
+ const empId = 1
40
+ try {
41
+ await api.patch(`/employees/${empId}`, { salary: 88000 })
42
+ } catch (err) {
43
+ }
44
+ }
45
+
46
+ async function triggerError() {
47
+ try {
48
+ await api.get('/departments/invalid-id')
49
+ } catch (err) {
50
+ }
51
+ }
52
+ </script>
53
+
54
+ <template>
55
+ <div class="container">
56
+ <ToastNotification />
57
+ <h1>Department Management</h1>
58
+
59
+ <div class="actions">
60
+ <button @click="fetchDepartments">Fetch Departments (GET)</button>
61
+ <button class="btn-patch" @click="testPatchEmployeeSalary">Test PATCH Employee Salary</button>
62
+ <button class="btn-error" @click="triggerError">Trigger 404 Error (GET)</button>
63
+ </div>
64
+
65
+ <form class="form" @submit.prevent="addDepartment">
66
+ <input v-model="newDept.name" placeholder="Department Name" required />
67
+ <input v-model="newDept.location" placeholder="Location" required />
68
+ <button type="submit">Add Department (POST)</button>
69
+ </form>
70
+
71
+ <table class="table">
72
+ <thead>
73
+ <tr>
74
+ <th>ID</th>
75
+ <th>Name</th>
76
+ <th>Location</th>
77
+ </tr>
78
+ </thead>
79
+ <tbody>
80
+ <tr v-for="dept in departments" :key="dept.id">
81
+ <td>{{ dept.id }}</td>
82
+ <td>{{ dept.name }}</td>
83
+ <td>{{ dept.location }}</td>
84
+ </tr>
85
+ </tbody>
86
+ </table>
87
+ </div>
88
+ </template>
89
+
90
+ <style>
91
+ body {
92
+ margin: 0;
93
+ font-family: sans-serif;
94
+ background-color: #f7f9fa;
95
+ color: #333;
96
+ }
97
+
98
+ .container {
99
+ max-width: 800px;
100
+ margin: 40px auto;
101
+ padding: 20px;
102
+ background: #fff;
103
+ border: 1px solid #ddd;
104
+ border-radius: 6px;
105
+ }
106
+
107
+ h1 {
108
+ margin-top: 0;
109
+ font-size: 22px;
110
+ }
111
+
112
+ .actions {
113
+ display: flex;
114
+ gap: 10px;
115
+ margin-bottom: 20px;
116
+ }
117
+
118
+ button {
119
+ padding: 8px 14px;
120
+ border: 1px solid #1976d2;
121
+ background-color: #1976d2;
122
+ color: #fff;
123
+ border-radius: 4px;
124
+ cursor: pointer;
125
+ }
126
+
127
+ button:hover {
128
+ background-color: #1565c0;
129
+ }
130
+
131
+ button.btn-patch {
132
+ border-color: #f57c00;
133
+ background-color: #f57c00;
134
+ }
135
+
136
+ button.btn-patch:hover {
137
+ background-color: #e65100;
138
+ }
139
+
140
+ button.btn-error {
141
+ border-color: #d32f2f;
142
+ background-color: #d32f2f;
143
+ }
144
+
145
+ button.btn-error:hover {
146
+ background-color: #b71c1c;
147
+ }
148
+
149
+ .form {
150
+ display: flex;
151
+ gap: 10px;
152
+ margin-bottom: 20px;
153
+ }
154
+
155
+ input {
156
+ padding: 8px;
157
+ border: 1px solid #ccc;
158
+ border-radius: 4px;
159
+ flex: 1;
160
+ }
161
+
162
+ .table {
163
+ width: 100%;
164
+ border-collapse: collapse;
165
+ }
166
+
167
+ .table th,
168
+ .table td {
169
+ border: 1px solid #ddd;
170
+ padding: 10px;
171
+ text-align: left;
172
+ }
173
+
174
+ .table th {
175
+ background-color: #f0f0f0;
176
+ }
177
+ </style>