feat: refactor batch delete endpoint to use request parameters and update SQL schema for firearm table

This commit is contained in:
2026-04-22 16:35:39 +08:00
parent 5ce8a994a4
commit 353c05339e
2 changed files with 7 additions and 6 deletions
@@ -1,6 +1,5 @@
package com.onixbyte.deltaforceguide.controller; package com.onixbyte.deltaforceguide.controller;
import com.onixbyte.deltaforceguide.domain.dto.ModificationBatchDeleteRequest;
import com.onixbyte.deltaforceguide.domain.dto.ModificationBatchCreateRequest; import com.onixbyte.deltaforceguide.domain.dto.ModificationBatchCreateRequest;
import com.onixbyte.deltaforceguide.domain.dto.ModificationRequest; import com.onixbyte.deltaforceguide.domain.dto.ModificationRequest;
import com.onixbyte.deltaforceguide.domain.dto.ModificationResponse; import com.onixbyte.deltaforceguide.domain.dto.ModificationResponse;
@@ -84,7 +83,8 @@ public class ModificationController {
@Operation(description = "批量删除改装") @Operation(description = "批量删除改装")
@DeleteMapping("/batch-delete") @DeleteMapping("/batch-delete")
public void batchDelete(@Valid @RequestBody ModificationBatchDeleteRequest request) { @Validated
modificationService.batchDelete(request.ids()); public void batchDelete(@RequestParam List<@Positive Long> ids) {
modificationService.batchDelete(ids);
} }
} }
@@ -1,4 +1,5 @@
-- 创建新表 -- 创建新表
DROP TABLE IF EXISTS firearm_new;
CREATE TABLE firearm_new CREATE TABLE firearm_new
( (
id BIGSERIAL NOT NULL, id BIGSERIAL NOT NULL,
@@ -20,10 +21,10 @@ SELECT id,
name, name,
type, type,
level, level,
calibre, '',
0,
0,
0, 0,
armour_damage,
body_damage,
review review
FROM firearm; FROM firearm;