2 Commity 55b6526024 ... bd4ecfc3e6

Autor SHA1 Wiadomość Data
  shuhao bd4ecfc3e6 shuhao 5 miesięcy temu
  shuhao 939d2c87ff 111 5 miesięcy temu

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

@@ -2,8 +2,10 @@ package com.flyer.foster.controller.app;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.flyer.foster.dto.app.AppFosterRecordAddDTO;
+import com.flyer.foster.dto.TreeUpdateDTO;
 import com.flyer.foster.dto.app.AppFosterRecordQueryDTO;
 import com.flyer.foster.entity.FosterRecord;
+import com.flyer.foster.entity.Tree;
 import com.flyer.foster.pojo.StpAppUtil;
 import com.flyer.foster.service.IFosterRecordService;
 import com.flyer.util.R;
@@ -42,6 +44,7 @@ public class AppFosterRecordController {
     }
 
     /**
+
      * 领养记录-分页
      * @param current
      * @param size
@@ -54,8 +57,7 @@ public class AppFosterRecordController {
     }
 
     /**
-     * 确认领养
-     *
+* 确认领养     *
      * @return
      */
     @PostMapping("")

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

@@ -10,6 +10,7 @@ import com.flyer.foster.pojo.StpAppUtil;
 import com.flyer.foster.service.IFosterRecordService;
 import com.flyer.foster.service.ITreeService;
 import com.flyer.util.R;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -42,6 +43,29 @@ public class AppTreeController {
     }
 
     /**
+     * 修改树
+     */
+    @PutMapping("")
+    public R update(@RequestBody TreeUpdateDTO updateDTO) {
+        return R.ok().result(
+                iTreeService.lambdaUpdate()
+                        .set(Tree::getName, updateDTO.getGardenId())
+                        .eq(Tree::getId, updateDTO.getId())
+                        .update());
+    }
+
+    /**
+     * get tree
+     */
+    @GetMapping("/{treeId}")
+    public R get(@PathVariable Integer treeId) {
+        Tree tree = iTreeService.lambdaQuery().eq(Tree::getName ,treeId).one();
+        TreeRespDTO dto = new TreeRespDTO();
+        BeanUtils.copyProperties(tree, dto);
+        return R.ok().result(dto);
+    }
+
+    /**
      * 返回区域随机的一棵树
      *
      * @return

+ 5 - 0
admin/src/main/java/com/flyer/foster/dto/TreeRespDTO.java

@@ -19,6 +19,11 @@ public class TreeRespDTO {
     private Integer id;
 
     /**
+     * name
+     */
+    private String name;
+
+    /**
      * 果园id
      */
     private Integer gardenId;

+ 6 - 0
admin/src/main/java/com/flyer/foster/dto/TreeUpdateDTO.java

@@ -22,6 +22,12 @@ public class TreeUpdateDTO {
     @NotNull(message = "果园id不能为空")
     private Integer gardenId;
 
+
+    /**
+     * 果shu name
+     */
+    private String name;
+
     /**
      * 区域id
      */

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

@@ -36,6 +36,11 @@ public class FosterRecord implements Serializable {
     private Integer id;
 
     /**
+     * name
+     */
+    private String name;
+
+    /**
      * 小程序用户id
      */
     private Integer appUserId;

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

@@ -34,6 +34,11 @@ public class Tree implements Serializable {
     private Integer id;
 
     /**
+     * name
+     */
+    private String name;
+
+    /**
      * 果园id
      */
     private Integer gardenId;