diff --git a/.gitignore b/.gitignore index 8f85c67..8c8923d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ target/ uploads/ +# 本地密钥,勿提交;用 application-example.yml 复制 +src/main/resources/application.yml diff --git a/src/main/java/com/petstore/controller/StoreController.java b/src/main/java/com/petstore/controller/StoreController.java index 87a3cca..739e315 100644 --- a/src/main/java/com/petstore/controller/StoreController.java +++ b/src/main/java/com/petstore/controller/StoreController.java @@ -42,12 +42,6 @@ public class StoreController { m.put("longitude", s.getLongitude()); m.put("phone", s.getPhone()); m.put("logo", s.getLogo()); - if (s.getBookingDayStart() != null) { - m.put("bookingDayStart", s.getBookingDayStart().toString()); - } - if (s.getBookingLastSlotStart() != null) { - m.put("bookingLastSlotStart", s.getBookingLastSlotStart().toString()); - } return m; }).collect(Collectors.toList()); return Map.of("code", 200, "data", rows); @@ -69,19 +63,15 @@ public class StoreController { @PutMapping("/update") public Map update(@RequestBody Store store) { - try { - Store updated = storeService.update(store); - if (updated == null) { - return Map.of("code", 404, "message", "店铺不存在"); - } - Map result = new HashMap<>(); - result.put("code", 200); - result.put("message", "更新成功"); - result.put("data", updated); - return result; - } catch (IllegalArgumentException e) { - return Map.of("code", 400, "message", e.getMessage() != null ? e.getMessage() : "参数错误"); + Store updated = storeService.update(store); + if (updated == null) { + return Map.of("code", 404, "message", "店铺不存在"); } + Map result = new HashMap<>(); + result.put("code", 200); + result.put("message", "更新成功"); + result.put("data", updated); + return result; } @DeleteMapping("/delete")