|
|
@@ -0,0 +1,43 @@
|
|
|
+package org.dromara.mall.controller.mini;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.web.core.BaseController;
|
|
|
+import org.dromara.mall.domain.NsDiyPage;
|
|
|
+import org.dromara.mall.service.INsDiyPageService;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * mini装修页面
|
|
|
+ * 前端访问路由地址为:/mall/miniDiyPcPage
|
|
|
+ *
|
|
|
+ * @author LionLi
|
|
|
+ * @date 2026-04-21
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/miniDiyPcPage")
|
|
|
+public class MiniDiyPageController extends BaseController {
|
|
|
+
|
|
|
+ private final INsDiyPageService nsDiyPageService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取diy装修页面
|
|
|
+ */
|
|
|
+ @GetMapping("/getMiniDiyPage")
|
|
|
+ public R<NsDiyPage> getMiniDiyPage(@RequestParam(value = "type", required = false) String type) {
|
|
|
+ NsDiyPage one = nsDiyPageService.getOne(
|
|
|
+ Wrappers.lambdaQuery(NsDiyPage.class)
|
|
|
+ .eq(NsDiyPage::getIsDefault, 1)
|
|
|
+ .eq(NsDiyPage::getType, type)
|
|
|
+ .last("limit 1")
|
|
|
+ );
|
|
|
+ return R.ok(one);
|
|
|
+ }
|
|
|
+}
|