|
|
@@ -0,0 +1,41 @@
|
|
|
+package com.txz.mall.controller.appcontroller;
|
|
|
+
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.txz.mall.core.Result;
|
|
|
+import com.txz.mall.model.Diy;
|
|
|
+import com.txz.mall.service.DiyService;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * app diy
|
|
|
+ *
|
|
|
+ * @author: MTD®️
|
|
|
+ * @date: 2026/2/4
|
|
|
+ */
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RequestMapping("/app/diy")
|
|
|
+public class DiyController {
|
|
|
+
|
|
|
+ private final DiyService diyService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 详情
|
|
|
+ */
|
|
|
+ @GetMapping("info/{id:^\\d+$}")
|
|
|
+ public Result info(@PathVariable("id") Long id) {
|
|
|
+ Diy info = diyService.getById(id);
|
|
|
+ if (ObjectUtil.isEmpty(info)) {
|
|
|
+ return Result.fail("数据不存在");
|
|
|
+ }
|
|
|
+ if (!info.getStatus()) {
|
|
|
+ return Result.fail("数据不存在");
|
|
|
+ }
|
|
|
+ return Result.success(info);
|
|
|
+ }
|
|
|
+}
|