@@ -160,13 +160,41 @@ public HttpResponse<ItemModelResponseDTO> remove(@PathVariable UUID id) {
160160 )
161161 )
162162 )
163- @ Get ("/enchantments/{id}" )
163+ @ Get (uris = {
164+ "/enchantments/{id}" ,
165+ "/{id}/enchantments"
166+ })
164167 @ Produces (MediaType .APPLICATION_JSON )
165168 public HttpResponse <Page <ItemModelEnchantmentResponseDTO >> getEnchantmentsById (@ PathVariable UUID id , Pageable pageable ) {
166169 Map <String , Short > enchantments = itemService .findEnchantmentsById (id , pageable );
167170 return HttpResponse .ok (Page .of (enchantments .entrySet ().stream ().map (ItemModelResponseDTO .ItemModelEnchantmentResponseDTO ::createDTO ).toList (), pageable , (long ) enchantments .size ()));
168171 }
169172
173+ @ Operation (
174+ summary = "Update enchantments of an item" ,
175+ description = "Updates the enchantments of an item by its ID." ,
176+ tags = {"Item" }
177+ )
178+ @ ApiResponse (
179+ responseCode = "200" ,
180+ description = "The enchantments of the item were successfully updated." ,
181+ content = @ Content (
182+ mediaType = MediaType .APPLICATION_JSON ,
183+ array = @ ArraySchema (
184+ schema = @ Schema (implementation = ItemModelEnchantmentResponseDTO .class ),
185+ arraySchema = @ Schema (implementation = List .class )
186+ )
187+ )
188+ )
189+ @ Post (uris = {
190+ "/enchantments/{id}" ,
191+ "/{id}/enchantments"
192+ })
193+ public HttpResponse <List <ItemModelEnchantmentResponseDTO >> updateEnchantments (@ PathVariable UUID id , @ Body Map <String , Short > enchantments ) {
194+ var enchantmentResult = itemService .updateEnchantmentsById (id , enchantments );
195+ return HttpResponse .ok (enchantmentResult .entrySet ().stream ().map (ItemModelResponseDTO .ItemModelEnchantmentResponseDTO ::createDTO ).toList ());
196+ }
197+
170198 @ Operation (
171199 summary = "Get all flags of an item" ,
172200 description = "Retrieves all flags of an item by its ID." ,
@@ -183,13 +211,41 @@ public HttpResponse<Page<ItemModelEnchantmentResponseDTO>> getEnchantmentsById(@
183211 )
184212 )
185213 )
186- @ Get ("/flags/{id}" )
214+ @ Get (uris = {
215+ "/flags/{id}" ,
216+ "/{id}/flags"
217+ })
187218 @ Produces (MediaType .APPLICATION_JSON )
188219 public HttpResponse <Page <String >> getFlagsById (@ PathVariable UUID id , Pageable pageable ) {
189220 List <String > flags = itemService .findFlagsById (id , pageable );
190221 return HttpResponse .ok (Page .of (flags , pageable , (long ) flags .size ()));
191222 }
192223
224+ @ Operation (
225+ summary = "Update flags of an item" ,
226+ description = "Updates the flags of an item by its ID." ,
227+ tags = {"Item" }
228+ )
229+ @ ApiResponse (
230+ responseCode = "200" ,
231+ description = "The flags of the item were successfully updated." ,
232+ content = @ Content (
233+ mediaType = MediaType .APPLICATION_JSON ,
234+ array = @ ArraySchema (
235+ schema = @ Schema (implementation = String .class ),
236+ arraySchema = @ Schema (implementation = List .class )
237+ )
238+ )
239+ )
240+ @ Post (uris = {
241+ "/flags/{id}" ,
242+ "/{id}/flags"
243+ })
244+ public HttpResponse <List <String >> updateFlags (@ PathVariable UUID id ,@ Body List <String > flags ) {
245+ List <String > result = itemService .updateFlagsById (id , flags );
246+ return HttpResponse .ok (result );
247+ }
248+
193249 @ Operation (
194250 summary = "Get all lore of an item" ,
195251 description = "Retrieves all lore of an item by its ID." ,
@@ -206,13 +262,41 @@ public HttpResponse<Page<String>> getFlagsById(@PathVariable UUID id, Pageable p
206262 )
207263 )
208264 )
209- @ Get ("/lore/{id}" )
265+ @ Get (uris = {
266+ "/lore/{id}" ,
267+ "/{id}/lore"
268+ })
210269 @ Produces (MediaType .APPLICATION_JSON )
211270 public HttpResponse <Page <String >> getLoreById (@ PathVariable UUID id , Pageable pageable ) {
212271 List <String > lore = itemService .findLoreById (id , pageable );
213272 return HttpResponse .ok (Page .of (lore , pageable , (long ) lore .size ()));
214273 }
215274
275+ @ Operation (
276+ summary = "Update lore of an item" ,
277+ description = "Updates the lore of an item by its ID." ,
278+ tags = {"Item" }
279+ )
280+ @ ApiResponse (
281+ responseCode = "200" ,
282+ description = "The lore of the item was successfully updated." ,
283+ content = @ Content (
284+ mediaType = MediaType .APPLICATION_JSON ,
285+ array = @ ArraySchema (
286+ schema = @ Schema (implementation = String .class ),
287+ arraySchema = @ Schema (implementation = List .class )
288+ )
289+ )
290+ )
291+ @ Post (uris = {
292+ "/lore/{id}" ,
293+ "/{id}/lore"
294+ })
295+ public HttpResponse <List <String >> updateLore (@ PathVariable UUID id ,@ Body List <String > lore ) {
296+ List <String > result = itemService .updateLoreById (id , lore );
297+ return HttpResponse .ok (result );
298+ }
299+
216300
217301 @ Operation (
218302 summary = "Get all items" ,
0 commit comments