shuhao 6 months ago
parent
commit
d72a59b7c5

+ 40 - 0
admin/src/main/java/com/flyer/foster/controller/app/AppAreaController.java

@@ -0,0 +1,40 @@
+package com.flyer.foster.controller.app;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.flyer.foster.dto.AreaAddDTO;
+import com.flyer.foster.dto.AreaQueryDTO;
+import com.flyer.foster.dto.AreaRespDTO;
+import com.flyer.foster.dto.AreaUpdateDTO;
+import com.flyer.foster.entity.Area;
+import com.flyer.foster.service.IAreaService;
+import com.flyer.util.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 区域
+ *
+ * @author flyer
+ * @since 2024-05-09
+ */
+@RestController
+@RequestMapping("/app/area")
+public class AppAreaController {
+    @Autowired
+    private IAreaService iAreaService;
+
+    /**
+     * 区域列表
+     * @param areaQueryDTO 查询对象
+     * @return
+     */
+    @GetMapping("/list")
+    public R getByGardenId(@Valid AreaQueryDTO areaQueryDTO) {
+        return R.ok().result(iAreaService.lambdaQuery().eq(Area::getGardenId, areaQueryDTO.getGardenId()).list());
+    }
+
+}

+ 36 - 0
admin/src/main/java/com/flyer/foster/controller/app/AppFosterRecordController.java

@@ -0,0 +1,36 @@
+package com.flyer.foster.controller.app;
+
+import com.flyer.foster.entity.FosterRecord;
+import com.flyer.foster.entity.Garden;
+import com.flyer.foster.service.IFosterRecordService;
+import com.flyer.util.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 领养记录
+ *
+ * @author flyer
+ * @since 2024-05-09
+ */
+@RestController
+@RequestMapping("/app/foster-record")
+public class AppFosterRecordController {
+
+    @Autowired
+    IFosterRecordService service;
+
+    /**
+     * 果园列表
+     * @return
+     */
+    @GetMapping("/list/{appUserId}")
+    public R list(@PathVariable Integer appUserId) {
+        List<FosterRecord> res = service.lambdaQuery().
+                eq(FosterRecord::getAppUserId, appUserId).list();
+        return R.ok().result(res);
+    }
+
+}

+ 40 - 0
admin/src/main/java/com/flyer/foster/controller/app/AppGardenController.java

@@ -0,0 +1,40 @@
+package com.flyer.foster.controller.app;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.flyer.foster.dto.GardenAddDTO;
+import com.flyer.foster.dto.GardenQueryDTO;
+import com.flyer.foster.dto.GardenRespDTO;
+import com.flyer.foster.dto.GardenUpdateDTO;
+import com.flyer.foster.entity.Garden;
+import com.flyer.foster.service.IGardenService;
+import com.flyer.util.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 果园
+ *
+ * @author flyer
+ * @since 2024-05-09
+ */
+@RestController
+@RequestMapping("/app/garden")
+public class AppGardenController {
+    @Autowired
+    private IGardenService iGardenService;
+
+    /**
+     * 果园列表
+     * @return
+     */
+    @GetMapping("/get")
+    public R get(@RequestParam Integer id) {
+        Garden bean = iGardenService.getById(id);
+        return R.ok().result(bean);
+    }
+
+}

+ 35 - 0
admin/src/main/java/com/flyer/foster/controller/app/AppTreeController.java

@@ -0,0 +1,35 @@
+package com.flyer.foster.controller.app;
+
+import com.flyer.foster.dto.TreeAddDTO;
+import com.flyer.foster.dto.TreeUpdateDTO;
+import com.flyer.foster.entity.Tree;
+import com.flyer.foster.service.ITreeService;
+import com.flyer.util.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 树
+ *
+ * @author flyer
+ * @since 2024-05-09
+ */
+@RestController
+@RequestMapping("/app/tree")
+public class AppTreeController {
+    @Autowired
+    private ITreeService iTreeService;
+
+    /**
+     * 根据gardenId获取详情
+     * @param gardenId
+     * @return
+     */
+    @GetMapping("/list/{gardenId}")
+    public R getTreeByGardenId(@PathVariable Integer gardenId) {
+        return R.ok().result(iTreeService.getTreeById(gardenId));
+    }
+}

+ 1 - 1
admin/src/main/java/com/flyer/foster/service/impl/GardenServiceImpl.java

@@ -87,7 +87,7 @@ public class GardenServiceImpl extends ServiceImpl<IGardenMapper, Garden> implem
         sb2.append("https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=");
         sb2.append(wxAccessToken.getAccess_token());
         Map<String, String> params = new HashMap<>();
-        params.put("path", "/pages/subPages/task_executor/index?recordAllotId=" + gardenId);
+        params.put("path", "/pages/subPages/login/index?gardenId=" + gardenId);
         params.put("width", "180");
         Response response = HttpUtils.getResponse(sb2.toString(), params);
         if (response.isSuccessful()) {