|
|
@@ -1,4 +1,7 @@ |
|
|
|
package com.tuoheng.controller; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.enums.MarkTypeEnum; |
|
|
|
import com.tuoheng.model.dto.LoginUser; |
|
|
|
import com.tuoheng.model.entity.Area; |
|
|
|
import com.tuoheng.model.query.AreaQuery; |
|
|
@@ -28,35 +31,50 @@ public class AreaController { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询区域信息 |
|
|
|
* |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/index") |
|
|
|
public JsonResult index(AreaQuery query){ |
|
|
|
return areaService.index(query); |
|
|
|
public JsonResult index(AreaQuery query) { |
|
|
|
return areaService.index(query); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询存在的区域信息 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/list") |
|
|
|
public JsonResult list() { |
|
|
|
return JsonResult.success(areaService.list(Wrappers.<Area>lambdaQuery().eq(Area::getMark, MarkTypeEnum.VALID.getCode()))); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增区域信息 |
|
|
|
* |
|
|
|
* @param entity |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/add") |
|
|
|
public JsonResult add(@RequestBody @Validated Area entity,@CurrentUser LoginUser loginUser){ |
|
|
|
return areaService.edit(entity,loginUser); |
|
|
|
public JsonResult add(@RequestBody @Validated Area entity, @CurrentUser LoginUser loginUser) { |
|
|
|
return areaService.edit(entity, loginUser); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增区域信息 |
|
|
|
* |
|
|
|
* @param entity |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PutMapping("/edit") |
|
|
|
public JsonResult edit(@RequestBody @Validated Area entity, @CurrentUser LoginUser loginUser){ |
|
|
|
return areaService.edit(entity,loginUser); |
|
|
|
public JsonResult edit(@RequestBody @Validated Area entity, @CurrentUser LoginUser loginUser) { |
|
|
|
return areaService.edit(entity, loginUser); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 逻辑删除/批量 |
|
|
|
* |
|
|
|
* @param ids |
|
|
|
* @return |
|
|
|
*/ |