| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.community.excel.CommunityExcel; |
| | | import org.springblade.modules.community.excel.CommunityImporter; |
| | | import org.springblade.modules.grid.excel.GridExcel; |
| | | import org.springblade.modules.grid.excel.GridImporter; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | |
| | | import org.springblade.modules.community.wrapper.CommunityWrapper; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 社区表 控制器 |
| | |
| | | CommunityEntity detail = communityService.getOne(Condition.getQueryWrapper(community)); |
| | | return R.data(CommunityWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 自定义详情 |
| | | */ |
| | | @GetMapping("/getDetail") |
| | | public R<CommunityVO> getDetail(CommunityEntity community) { |
| | | return R.data(communityService.getDetail(community)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 分页 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 社区表 自定义新增或修改 |
| | | */ |
| | | @PostMapping("/saveOrUpdate") |
| | | public R saveOrUpdate(@Valid @RequestBody CommunityEntity community) { |
| | | return R.status(communityService.saveOrUpdateCommunityEntity(community)); |
| | | } |
| | | |
| | | /** |
| | | * 社区表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | |
| | | return R.status(communityService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 导入社区数据 |
| | | */ |
| | | @PostMapping("/import-community") |
| | | public R importCommunity(MultipartFile file, Integer isCovered) { |
| | | CommunityImporter communityImporter = new CommunityImporter(communityService, isCovered == 1); |
| | | ExcelUtil.save(file, communityImporter, CommunityExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | |
| | | } |