|
|
|
|
|
|
|
|
package com.tuoheng.controller; |
|
|
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.dto.LoginUser; |
|
|
import com.tuoheng.model.entity.Area; |
|
|
import com.tuoheng.model.entity.Area; |
|
|
import com.tuoheng.model.query.AreaQuery; |
|
|
import com.tuoheng.model.query.AreaQuery; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查询区域信息 |
|
|
* 查询区域信息 |
|
|
|
|
|
* |
|
|
* @param query |
|
|
* @param query |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@GetMapping("/index") |
|
|
@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 |
|
|
* @param entity |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("/add") |
|
|
@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 |
|
|
* @param entity |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@PutMapping("/edit") |
|
|
@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 |
|
|
* @param ids |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |