|
|
@@ -6,9 +6,11 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
|
+import shop.alien.entity.store.StoreBookingCategory;
|
|
|
import shop.alien.entity.store.StoreBookingTable;
|
|
|
import shop.alien.entity.store.dto.StoreBookingTableBatchDTO;
|
|
|
import shop.alien.entity.store.dto.StoreBookingTableDTO;
|
|
|
+import shop.alien.store.service.StoreBookingCategoryService;
|
|
|
import shop.alien.store.service.StoreBookingTableService;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -29,6 +31,7 @@ import java.util.List;
|
|
|
public class StoreBookingTableController {
|
|
|
|
|
|
private final StoreBookingTableService storeBookingTableService;
|
|
|
+ private final StoreBookingCategoryService storeBookingCategoryService;
|
|
|
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation("查询预订服务桌号列表")
|
|
|
@@ -189,4 +192,29 @@ public class StoreBookingTableController {
|
|
|
return R.fail("删除失败:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation("根据分类ID查询分类详细信息")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "categoryId", value = "分类ID", dataType = "Integer", paramType = "query", required = true)
|
|
|
+ })
|
|
|
+ @GetMapping("/category/detail")
|
|
|
+ public R<StoreBookingCategory> getCategoryDetailByCategoryId(@RequestParam Integer categoryId) {
|
|
|
+ log.info("StoreBookingTableController.getCategoryDetailByCategoryId?categoryId={}", categoryId);
|
|
|
+
|
|
|
+ if (categoryId == null) {
|
|
|
+ return R.fail("分类ID不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ StoreBookingCategory category = storeBookingCategoryService.getById(categoryId);
|
|
|
+ if (category == null) {
|
|
|
+ return R.fail("分类不存在");
|
|
|
+ }
|
|
|
+ return R.data(category);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("根据分类ID查询分类详情失败", e);
|
|
|
+ return R.fail("查询失败:" + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|