2 Achegas ee38a3b8e8 ... 6a317b26a3

Autor SHA1 Mensaxe Data
  shuhao 6a317b26a3 Merge remote-tracking branch 'origin/master' hai 6 meses
  shuhao 19604e31e4 shuhao hai 6 meses

+ 11 - 4
admin/src/main/java/com/flyer/foster/controller/app/AppFosterRecordController.java

@@ -1,7 +1,10 @@
 package com.flyer.foster.controller.app;
 
+import cn.dev33.satoken.annotation.SaIgnore;
+import cn.dev33.satoken.stp.StpUtil;
 import com.flyer.foster.entity.FosterRecord;
 import com.flyer.foster.entity.Garden;
+import com.flyer.foster.pojo.StpAppUtil;
 import com.flyer.foster.service.IFosterRecordService;
 import com.flyer.util.R;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,13 +26,17 @@ public class AppFosterRecordController {
     IFosterRecordService service;
 
     /**
-     * 果园列表
+     * 领养记录列表
      * @return
      */
-    @GetMapping("/list/{appUserId}")
-    public R list(@PathVariable Integer appUserId) {
+    @GetMapping("/list/{gardenId}/")
+    public R list(@PathVariable Integer gardenId) {
+//        Integer appUserId = (Integer)StpAppUtil.getLoginId();
+        Integer appUserId = 4;
         List<FosterRecord> res = service.lambdaQuery().
-                eq(FosterRecord::getAppUserId, appUserId).list();
+                eq(FosterRecord::getAppUserId, appUserId)
+                .eq(FosterRecord::getGardenId, gardenId)
+                .list();
         return R.ok().result(res);
     }
 

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

@@ -32,4 +32,13 @@ public class AppTreeController {
     public R getTreeByGardenId(@PathVariable Integer gardenId) {
         return R.ok().result(iTreeService.getTreeById(gardenId));
     }
+
+    /**
+     * 返回区域随机的一棵树
+     * @return
+     */
+    @GetMapping("/getRandomTree/{areaId}")
+    public R getRandomTree(@PathVariable Integer areaId){
+        return R.ok().result(iTreeService.lambdaQuery().eq(Tree::getAreaId, areaId).list());
+    }
 }

+ 5 - 0
admin/src/main/java/com/flyer/foster/entity/FosterRecord.java

@@ -39,6 +39,11 @@ public class FosterRecord implements Serializable {
     private Integer appUserId;
 
     /**
+     * gardenId
+     */
+    private Integer gardenId;
+
+    /**
      * 树id
      */
     private Integer treeId;