fix: use BizException instead of ResponseStatusException for firearmId validation

This commit is contained in:
2026-06-01 17:01:50 +08:00
parent 5b5062aae9
commit 9594efe716
@@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.server.ResponseStatusException; import com.onixbyte.deltaforceguide.exeption.BizException;
import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.Yaml;
import java.time.Duration; import java.time.Duration;
@@ -112,7 +112,7 @@ public class WebhookService {
toLong(data.get("firearmId")), toLong(data.get("firearmId")),
(String) data.get("firearmName")); (String) data.get("firearmName"));
if (firearmId == null) { if (firearmId == null) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, throw new BizException(HttpStatus.BAD_REQUEST,
"YAML must contain firearmId or firearmName"); "YAML must contain firearmId or firearmName");
} }
String name = (String) data.get("name"); String name = (String) data.get("name");