| File was renamed from src/main/java/org/springblade/modules/house/controller/HouseLabelController.java |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | 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.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | 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.service.IHouseLabelService; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-houseLabel/houseLabel") |
| | | @Api(value = "房屋-标签", tags = "房屋-标签接口") |
| | | public class HouseLabelController extends BladeController { |
| | | @RequestMapping("blade-houseLabel/userHouseLabel") |
| | | @Api(value = "用户房屋-标签", tags = "用户房屋-标签接口") |
| | | public class UserHouseLabelController extends BladeController { |
| | | |
| | | private final IHouseLabelService houseLabelService; |
| | | private final IUserHouseLabelService userHouseLabelService; |
| | | |
| | | /** |
| | | * 房屋-标签 详情 |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入houseLabel") |
| | | public R<HouseLabelVO> detail(HouseLabelEntity houseLabel) { |
| | | HouseLabelEntity detail = houseLabelService.getOne(Condition.getQueryWrapper(houseLabel)); |
| | | public R<HouseLabelVO> detail(UserHouseLabelEntity houseLabel) { |
| | | UserHouseLabelEntity detail = userHouseLabelService.getOne(Condition.getQueryWrapper(houseLabel)); |
| | | return R.data(HouseLabelWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入houseLabel") |
| | | public R<IPage<HouseLabelVO>> list(HouseLabelEntity houseLabel, Query query) { |
| | | IPage<HouseLabelEntity> pages = houseLabelService.page(Condition.getPage(query), Condition.getQueryWrapper(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)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入houseLabel") |
| | | public R<IPage<HouseLabelVO>> page(HouseLabelVO houseLabel, Query query) { |
| | | IPage<HouseLabelVO> pages = houseLabelService.selectHouseLabelPage(Condition.getPage(query), houseLabel); |
| | | IPage<HouseLabelVO> pages = userHouseLabelService.selectHouseLabelPage(Condition.getPage(query), houseLabel); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入houseLabel") |
| | | public R save(@Valid @RequestBody HouseLabelEntity houseLabel) { |
| | | return R.status(houseLabelService.save(houseLabel)); |
| | | public R save(@Valid @RequestBody UserHouseLabelEntity houseLabel) { |
| | | return R.status(userHouseLabelService.save(houseLabel)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入houseLabel") |
| | | public R update(@Valid @RequestBody HouseLabelEntity houseLabel) { |
| | | return R.status(houseLabelService.updateById(houseLabel)); |
| | | public R update(@Valid @RequestBody UserHouseLabelEntity houseLabel) { |
| | | return R.status(userHouseLabelService.updateById(houseLabel)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入houseLabel") |
| | | public R submit(@Valid @RequestBody HouseLabelEntity houseLabel) { |
| | | return R.status(houseLabelService.saveOrUpdate(houseLabel)); |
| | | public R submit(@Valid @RequestBody UserHouseLabelEntity houseLabel) { |
| | | return R.status(userHouseLabelService.saveOrUpdate(houseLabel)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/saveOrUpdateHouseLabel") |
| | | @ApiOperation(value = "自定义新增或修改", notes = "传入houseLabel") |
| | | public R saveOrUpdateHouseLabel(@Valid @RequestBody HouseLabelEntity houseLabel) { |
| | | return R.status(houseLabelService.saveOrUpdateHouseLabel(houseLabel)); |
| | | public R saveOrUpdateHouseLabel(@Valid @RequestBody UserHouseLabelEntity houseLabel) { |
| | | return R.status(userHouseLabelService.saveOrUpdateHouseLabel(houseLabel)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(houseLabelService.removeByIds(Func.toLongList(ids))); |
| | | return R.status(userHouseLabelService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/removeHouseLabel") |
| | | @ApiOperationSupport(order = 7) |
| | | public R removeHouseLabel(@RequestBody HouseLabelEntity houseLabel) { |
| | | QueryWrapper<HouseLabelEntity> wrapper = new QueryWrapper<>(); |
| | | public R removeHouseLabel(@RequestBody UserHouseLabelEntity houseLabel) { |
| | | QueryWrapper<UserHouseLabelEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("label_id",houseLabel.getLabelId()) |
| | | .eq("house_code",houseLabel.getHouseCode()); |
| | | // 返回 |
| | | return R.status(houseLabelService.remove(wrapper)); |
| | | return R.status(userHouseLabelService .remove(wrapper)); |
| | | } |
| | | |
| | | |