HotelDishSpecService.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import httpRequest from "@/utils/httpRequest";
  2. import { HOTEL_ORDER_PATH as prefix } from "../AppPath";
  3. /**
  4. * 菜品规格管理API服务
  5. */
  6. export default class HotelDishSpecService {
  7. /** 分页查询规格组列表 */
  8. groupPage(params) {
  9. return httpRequest({
  10. url: prefix + "/dishSpecGroup/page",
  11. method: "get",
  12. params,
  13. });
  14. }
  15. /** 根据菜品ID查询所有规格组(含选项) */
  16. findByDishId(dishId) {
  17. return httpRequest({
  18. url: prefix + "/dishSpecGroup/findByDishId",
  19. method: "get",
  20. params: { dishId },
  21. });
  22. }
  23. /** 查询规格组详情 */
  24. queryGroupById(id) {
  25. return httpRequest({
  26. url: prefix + "/dishSpecGroup/queryById",
  27. method: "get",
  28. params: { id },
  29. });
  30. }
  31. /** 新增/编辑规格组 */
  32. saveGroup(data) {
  33. return httpRequest({
  34. url: prefix + "/dishSpecGroup/save",
  35. method: "post",
  36. data,
  37. });
  38. }
  39. /** 删除规格组 */
  40. deleteGroup(id) {
  41. return httpRequest({
  42. url: prefix + "/dishSpecGroup/delete/" + id,
  43. method: "post",
  44. });
  45. }
  46. // ==================== 规格选项 ====================
  47. /** 根据规格组ID查询所有选项 */
  48. findOptionsByGroupId(groupId) {
  49. return httpRequest({
  50. url: prefix + "/dishSpecOption/findByGroupId",
  51. method: "get",
  52. params: { groupId },
  53. });
  54. }
  55. /** 查询规格选项详情 */
  56. queryOptionById(id) {
  57. return httpRequest({
  58. url: prefix + "/dishSpecOption/queryById",
  59. method: "get",
  60. params: { id },
  61. });
  62. }
  63. /** 新增/编辑规格选项 */
  64. saveOption(data) {
  65. return httpRequest({
  66. url: prefix + "/dishSpecOption/save",
  67. method: "post",
  68. data,
  69. });
  70. }
  71. /** 删除规格选项 */
  72. deleteOption(id) {
  73. return httpRequest({
  74. url: prefix + "/dishSpecOption/delete/" + id,
  75. method: "post",
  76. });
  77. }
  78. }