|
@@ -10,6 +10,7 @@ import shop.alien.entity.store.SportsFacilityArea;
|
|
|
import shop.alien.entity.store.vo.BatchDeleteAreaRequestVo;
|
|
import shop.alien.entity.store.vo.BatchDeleteAreaRequestVo;
|
|
|
import shop.alien.entity.store.vo.CreateAreaRequestVo;
|
|
import shop.alien.entity.store.vo.CreateAreaRequestVo;
|
|
|
import shop.alien.entity.store.vo.DeleteAreaRequestVo;
|
|
import shop.alien.entity.store.vo.DeleteAreaRequestVo;
|
|
|
|
|
+import shop.alien.entity.store.vo.UpdateAreaHeadUrlRequestVo;
|
|
|
import shop.alien.store.service.SportsFacilityAreaService;
|
|
import shop.alien.store.service.SportsFacilityAreaService;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -22,7 +23,7 @@ import java.util.List;
|
|
|
*/
|
|
*/
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Api(tags = {"商户端-运动设施区域管理"})
|
|
@Api(tags = {"商户端-运动设施区域管理"})
|
|
|
-@ApiSort(2)
|
|
|
|
|
|
|
+@ApiSort(1)
|
|
|
@CrossOrigin
|
|
@CrossOrigin
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/sports/facility/area")
|
|
@RequestMapping("/sports/facility/area")
|
|
@@ -41,7 +42,7 @@ public class SportsFacilityAreaController {
|
|
|
*/
|
|
*/
|
|
|
private static final String INVALID_STORE_ID_MSG = "门店ID不能为空且必须大于0";
|
|
private static final String INVALID_STORE_ID_MSG = "门店ID不能为空且必须大于0";
|
|
|
|
|
|
|
|
- @ApiOperation("新建区域(创建新的设施区域)")
|
|
|
|
|
|
|
+ @ApiOperation("新建区域")
|
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "request", value = "新建区域请求参数", dataType = "CreateAreaRequestVo", paramType = "body", required = true)
|
|
@ApiImplicitParam(name = "request", value = "新建区域请求参数", dataType = "CreateAreaRequestVo", paramType = "body", required = true)
|
|
@@ -142,9 +143,49 @@ public class SportsFacilityAreaController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @ApiOperation("删除区域(逻辑删除,同时删除该区域下的所有设施)")
|
|
|
|
|
|
|
+ @ApiOperation("更新区域头图")
|
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "request", value = "更新区域头图请求参数", dataType = "UpdateAreaHeadUrlRequestVo", paramType = "body", required = true)
|
|
|
|
|
+ })
|
|
|
|
|
+ @PostMapping("/updateHeadUrl")
|
|
|
|
|
+ public R<Boolean> updateAreaHeadUrl(@RequestBody UpdateAreaHeadUrlRequestVo request) {
|
|
|
|
|
+ log.info("更新区域头图,request={}", request);
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 参数验证
|
|
|
|
|
+ if (request == null) {
|
|
|
|
|
+ log.warn("更新区域头图失败,请求参数为空");
|
|
|
|
|
+ return R.fail("请求参数不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (request.getAreaId() == null || request.getAreaId() < MIN_VALID_VALUE) {
|
|
|
|
|
+ log.warn("更新区域头图失败,区域ID无效:{}", request.getAreaId());
|
|
|
|
|
+ return R.fail("区域ID不能为空且必须大于0");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (request.getAreaHeadUrl() == null) {
|
|
|
|
|
+ log.warn("更新区域头图失败,区域头图URL为空");
|
|
|
|
|
+ return R.fail("区域头图URL不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ boolean result = areaService.updateAreaHeadUrl(request.getAreaId(), request.getAreaHeadUrl());
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ log.info("更新区域头图成功,areaId={}", request.getAreaId());
|
|
|
|
|
+ return R.success("更新区域头图成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ return R.fail("更新区域头图失败");
|
|
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
|
|
+ log.warn("更新区域头图失败,参数验证失败:{}", e.getMessage());
|
|
|
|
|
+ return R.fail(e.getMessage());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("更新区域头图异常,request={},异常信息:{}", request, e.getMessage(), e);
|
|
|
|
|
+ return R.fail("更新区域头图失败:" + e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("删除区域")
|
|
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "request", value = "删除区域请求参数", dataType = "DeleteAreaRequestVo", paramType = "body", required = true)
|
|
@ApiImplicitParam(name = "request", value = "删除区域请求参数", dataType = "DeleteAreaRequestVo", paramType = "body", required = true)
|
|
|
})
|
|
})
|
|
|
@PostMapping("/delete")
|
|
@PostMapping("/delete")
|
|
@@ -177,8 +218,8 @@ public class SportsFacilityAreaController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @ApiOperation("批量删除区域(逻辑删除,同时删除这些区域下的所有设施)")
|
|
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
|
|
|
|
+ @ApiOperation("批量删除区域")
|
|
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "request", value = "批量删除区域请求参数", dataType = "BatchDeleteAreaRequestVo", paramType = "body", required = true)
|
|
@ApiImplicitParam(name = "request", value = "批量删除区域请求参数", dataType = "BatchDeleteAreaRequestVo", paramType = "body", required = true)
|
|
|
})
|
|
})
|