iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/FileGroupController.java
@@ -1,6 +1,7 @@ package com.iailab.module.model.mpk.controller.admin; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.model.mpk.dto.FileGroupDTO; import com.iailab.module.model.mpk.entity.FileGroupEntity; import com.iailab.module.model.mpk.service.FileGroupService; @@ -33,6 +34,13 @@ return success(list); } @GetMapping("/get") @Operation(summary = "获取详情") public CommonResult<FileGroupDTO> get(@RequestParam("id") String id) { FileGroupDTO data = ConvertUtils.sourceToTarget(fileGroupService.get(id), FileGroupDTO.class); return success(data); } @PostMapping("/create") public CommonResult<Boolean> create(@Valid @RequestBody FileGroupEntity entity) { fileGroupService.create(entity); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/FileMenuController.java
@@ -1,6 +1,7 @@ package com.iailab.module.model.mpk.controller.admin; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.model.mpk.dto.FileMenuDTO; import com.iailab.module.model.mpk.entity.FileMenuEntity; import com.iailab.module.model.mpk.service.FileMenuService; @@ -34,6 +35,13 @@ return success(list); } @GetMapping("/get") @Operation(summary = "获取详情") public CommonResult<FileMenuDTO> get(@RequestParam("id") String id) { FileMenuEntity data = fileMenuService.get(id); return success(ConvertUtils.sourceToTarget(data, FileMenuDTO.class)); } @PostMapping("/create") public CommonResult<Boolean> create(@Valid @RequestBody FileMenuEntity entity) { fileMenuService.create(entity); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/FileGroupDTO.java
@@ -13,6 +13,8 @@ public class FileGroupDTO implements Serializable { private static final long serialVersionUID = 1L; private String id; private String menuId; private String name; iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/FileGroupServiceImpl.java
@@ -11,6 +11,7 @@ import javax.annotation.Resource; import java.util.List; import java.util.UUID; /** * @author PanZhibao @@ -38,13 +39,14 @@ } @Override public void create(FileGroupEntity fileMenuEntity) { fileGroupDao.insert(fileMenuEntity); public void create(FileGroupEntity entity) { entity.setId(UUID.randomUUID().toString()); fileGroupDao.insert(entity); } @Override public void update(FileGroupEntity fileMenuEntity) { fileGroupDao.updateById(fileMenuEntity); public void update(FileGroupEntity entity) { fileGroupDao.updateById(entity); } @Override iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/FileMenuServiceImpl.java
@@ -12,6 +12,7 @@ import javax.annotation.Resource; import java.util.List; import java.util.UUID; /** * @author PanZhibao @@ -34,7 +35,7 @@ wrapper.orderByAsc("sort"); List<FileMenuDTO> list = ConvertUtils.sourceToTarget(fileMenuDao.selectList(wrapper), FileMenuDTO.class); list.forEach(item -> { fileGroupService.list(item.getId()); item.setGroups(fileGroupService.list(item.getId())); }); return list; } @@ -45,13 +46,14 @@ } @Override public void create(FileMenuEntity fileMenuEntity) { fileMenuDao.insert(fileMenuEntity); public void create(FileMenuEntity entity) { entity.setId(UUID.randomUUID().toString()); fileMenuDao.insert(entity); } @Override public void update(FileMenuEntity fileMenuEntity) { fileMenuDao.updateById(fileMenuEntity); public void update(FileMenuEntity entity) { fileMenuDao.updateById(entity); } @Override