From b3162ed4712c2c85a9c18116a7547440edc41c93 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 17 Nov 2023 15:15:05 +0800
Subject: [PATCH] 住户管理代码
---
src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java | 110 +++++++++++++++++++++++-------------------------------
1 files changed, 47 insertions(+), 63 deletions(-)
diff --git a/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java b/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
index d122a9b..8a9e906 100644
--- a/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
+++ b/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
@@ -26,140 +26,124 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
-import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.AesUtil;
import org.springblade.core.tool.utils.Func;
-import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
-import org.springblade.modules.house.vo.HouseLabelVO;
-import org.springblade.modules.house.wrapper.HouseLabelWrapper;
+import org.springblade.modules.house.vo.HouseholdLabelVO;
+import org.springblade.modules.house.wrapper.HouseholdLabelWrapper;
import org.springblade.modules.house.service.IUserHouseLabelService;
import org.springblade.core.boot.ctrl.BladeController;
-import java.util.List;
-
/**
- * 房屋-标签 控制器
+ * 住户-标签 控制器
*
* @author BladeX
* @since 2023-10-28
*/
@RestController
@AllArgsConstructor
-@RequestMapping("blade-houseLabel/userHouseLabel")
-@Api(value = "用户房屋-标签", tags = "用户房屋-标签接口")
+@RequestMapping("blade-householdLabel/householdLabel")
+@Api(value = "住户-标签", tags = "住户-标签接口")
public class UserHouseLabelController extends BladeController {
- private final IUserHouseLabelService userHouseLabelService;
+ private final IUserHouseLabelService householdLabelService;
/**
- * 房屋-标签 详情
+ * 住户-标签 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
- @ApiOperation(value = "详情", notes = "传入houseLabel")
- public R<HouseLabelVO> detail(UserHouseLabelEntity houseLabel) {
- UserHouseLabelEntity detail = userHouseLabelService.getOne(Condition.getQueryWrapper(houseLabel));
- return R.data(HouseLabelWrapper.build().entityVO(detail));
+ @ApiOperation(value = "详情", notes = "传入householdLabel")
+ public R<HouseholdLabelVO> detail(UserHouseLabelEntity householdLabel) {
+ UserHouseLabelEntity detail = householdLabelService.getOne(Condition.getQueryWrapper(householdLabel));
+ return R.data(HouseholdLabelWrapper.build().entityVO(detail));
}
/**
- * 房屋-标签 分页
+ * 住户-标签 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
- @ApiOperation(value = "分页", notes = "传入houseLabel")
- public R<IPage<HouseLabelVO>> list(UserHouseLabelEntity houseLabel, Query query) {
- IPage<UserHouseLabelEntity> pages = userHouseLabelService.page(Condition.getPage(query), Condition.getQueryWrapper(houseLabel));
- return R.data(HouseLabelWrapper.build().pageVO(pages));
+ @ApiOperation(value = "分页", notes = "传入householdLabel")
+ public R<IPage<HouseholdLabelVO>> list(UserHouseLabelEntity householdLabel, Query query) {
+ IPage<UserHouseLabelEntity> pages = householdLabelService.page(Condition.getPage(query), Condition.getQueryWrapper(householdLabel));
+ return R.data(HouseholdLabelWrapper.build().pageVO(pages));
}
/**
- * 房屋-标签 自定义分页
+ * 住户-标签 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
- @ApiOperation(value = "分页", notes = "传入houseLabel")
- public R<IPage<HouseLabelVO>> page(HouseLabelVO houseLabel, Query query) {
- IPage<HouseLabelVO> pages = userHouseLabelService.selectHouseLabelPage(Condition.getPage(query), houseLabel);
+ @ApiOperation(value = "分页", notes = "传入householdLabel")
+ public R<IPage<HouseholdLabelVO>> page(HouseholdLabelVO householdLabel, Query query) {
+ IPage<HouseholdLabelVO> pages = householdLabelService.selectHouseholdLabelPage(Condition.getPage(query), householdLabel);
return R.data(pages);
}
/**
- * 房屋-标签 自定义分页
- */
- @GetMapping("/userLabelList")
- @ApiOperationSupport(order = 3)
- @ApiOperation(value = "查询用户的标签", notes = "传入houseLabel")
- public R<List<Integer>> userLabelList() {
- List<Integer> pages = userHouseLabelService.selectUserLabelList(new UserHouseLabelDTO());
- return R.data(pages);
- }
-
- /**
- * 房屋-标签 新增
+ * 住户-标签 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
- @ApiOperation(value = "新增", notes = "传入houseLabel")
- public R save(@Valid @RequestBody UserHouseLabelEntity houseLabel) {
- return R.status(userHouseLabelService.save(houseLabel));
+ @ApiOperation(value = "新增", notes = "传入householdLabel")
+ public R save(@Valid @RequestBody UserHouseLabelEntity householdLabel) {
+ return R.status(householdLabelService.save(householdLabel));
}
/**
- * 房屋-标签 修改
+ * 住户-标签 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
- @ApiOperation(value = "修改", notes = "传入houseLabel")
- public R update(@Valid @RequestBody UserHouseLabelEntity houseLabel) {
- return R.status(userHouseLabelService.updateById(houseLabel));
+ @ApiOperation(value = "修改", notes = "传入householdLabel")
+ public R update(@Valid @RequestBody UserHouseLabelEntity householdLabel) {
+ return R.status(householdLabelService.updateById(householdLabel));
}
/**
- * 房屋-标签 新增或修改
+ * 住户-标签 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
- @ApiOperation(value = "新增或修改", notes = "传入houseLabel")
- public R submit(@Valid @RequestBody UserHouseLabelEntity houseLabel) {
- return R.status(userHouseLabelService.saveOrUpdate(houseLabel));
+ @ApiOperation(value = "新增或修改", notes = "传入householdLabel")
+ public R submit(@Valid @RequestBody UserHouseLabelEntity householdLabel) {
+ return R.status(householdLabelService.saveOrUpdate(householdLabel));
}
/**
- * 房屋-标签 自定义新增或修改
- * @param houseLabel
+ * 住户-标签 自定义新增或修改
+ * @param householdLabel
* @return
*/
- @PostMapping("/saveOrUpdateHouseLabel")
- @ApiOperation(value = "自定义新增或修改", notes = "传入houseLabel")
- public R saveOrUpdateHouseLabel(@Valid @RequestBody UserHouseLabelEntity houseLabel) {
- return R.status(userHouseLabelService.saveOrUpdateHouseLabel(houseLabel));
+ @PostMapping("/saveOrUpdateHouseholdLabel")
+ @ApiOperation(value = "自定义新增或修改", notes = "传入householdLabel")
+ public R saveOrUpdateHouseholdLabel(@Valid @RequestBody UserHouseLabelEntity householdLabel) {
+ return R.status(householdLabelService.saveOrUpdateHouseholdLabel(householdLabel));
}
/**
- * 房屋-标签 删除
+ * 住户-标签 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(userHouseLabelService.removeByIds(Func.toLongList(ids)));
+ return R.status(householdLabelService.removeByIds(Func.toLongList(ids)));
}
+
/**
- * 房屋-标签 自定义删除
+ * 住户-标签 自定义删除
*/
- @PostMapping("/removeHouseLabel")
- @ApiOperationSupport(order = 7)
- public R removeHouseLabel(@RequestBody UserHouseLabelEntity houseLabel) {
+ @PostMapping("/removeHouseholdLabel")
+ public R removeHouseholdLabel(@RequestBody UserHouseLabelEntity householdLabel) {
QueryWrapper<UserHouseLabelEntity> wrapper = new QueryWrapper<>();
- wrapper.eq("label_id",houseLabel.getLabelId())
- .eq("house_code",houseLabel.getHouseCode());
+ wrapper.eq("household_id",householdLabel.getHouseholdId())
+ .eq("label_id",householdLabel.getLabelId());
// 返回
- return R.status(userHouseLabelService .remove(wrapper));
+ return R.status(householdLabelService.remove(wrapper));
}
--
Gitblit v1.9.3