|
|
@@ -1,5 +1,8 @@
|
|
|
package cn.iocoder.yudao.module.guide.controller.admin.sights;
|
|
|
|
|
|
+import cn.iocoder.yudao.module.guide.controller.admin.sightscategory.vo.SightsCategoryListReqVO;
|
|
|
+import cn.iocoder.yudao.module.guide.controller.admin.sightscategory.vo.SightsCategoryRespVO;
|
|
|
+import cn.iocoder.yudao.module.guide.dal.dataobject.sightscategory.SightsCategoryDO;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -27,10 +30,11 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
|
|
|
import cn.iocoder.yudao.module.guide.controller.admin.sights.vo.*;
|
|
|
import cn.iocoder.yudao.module.guide.dal.dataobject.sights.SightsDO;
|
|
|
+import cn.iocoder.yudao.module.guide.dal.dataobject.sights.SightsCommentDO;
|
|
|
import cn.iocoder.yudao.module.guide.dal.dataobject.sights.SightsI18nExtensionDO;
|
|
|
import cn.iocoder.yudao.module.guide.service.sights.SightsService;
|
|
|
|
|
|
-@Tag(name = "管理后台 - 观光景点基本信息")
|
|
|
+@Tag(name = "管理后台 - 观光景点")
|
|
|
@RestController
|
|
|
@RequestMapping("/guide/sights")
|
|
|
@Validated
|
|
|
@@ -40,14 +44,14 @@ public class SightsController {
|
|
|
private SightsService sightsService;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
- @Operation(summary = "创建观光景点基本信息")
|
|
|
+ @Operation(summary = "创建观光景点")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:create')")
|
|
|
public CommonResult<Long> createSights(@Valid @RequestBody SightsSaveReqVO createReqVO) {
|
|
|
return success(sightsService.createSights(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
- @Operation(summary = "更新观光景点基本信息")
|
|
|
+ @Operation(summary = "更新观光景点")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:update')")
|
|
|
public CommonResult<Boolean> updateSights(@Valid @RequestBody SightsSaveReqVO updateReqVO) {
|
|
|
sightsService.updateSights(updateReqVO);
|
|
|
@@ -55,7 +59,7 @@ public class SightsController {
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
- @Operation(summary = "删除观光景点基本信息")
|
|
|
+ @Operation(summary = "删除观光景点")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:delete')")
|
|
|
public CommonResult<Boolean> deleteSights(@RequestParam("id") Long id) {
|
|
|
@@ -64,7 +68,7 @@ public class SightsController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
- @Operation(summary = "获得观光景点基本信息")
|
|
|
+ @Operation(summary = "获得观光景点")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
public CommonResult<SightsRespVO> getSights(@RequestParam("id") Long id) {
|
|
|
@@ -72,8 +76,15 @@ public class SightsController {
|
|
|
return success(BeanUtils.toBean(sights, SightsRespVO.class));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/list")
|
|
|
+ @Operation(summary = "获得观光景点列表(不包含在trip-sights中的列表)")
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
+ public CommonResult<List<SightsRespVO>> getSightsCategoryList(@Valid SightsPageReqVO listReqVO) {
|
|
|
+ List<SightsDO> list = sightsService.getSightsList(listReqVO);
|
|
|
+ return success(BeanUtils.toBean(list, SightsRespVO.class));
|
|
|
+ }
|
|
|
@GetMapping("/page")
|
|
|
- @Operation(summary = "获得观光景点基本信息分页")
|
|
|
+ @Operation(summary = "获得观光景点分页")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
public CommonResult<PageResult<SightsRespVO>> getSightsPage(@Valid SightsPageReqVO pageReqVO) {
|
|
|
PageResult<SightsDO> pageResult = sightsService.getSightsPage(pageReqVO);
|
|
|
@@ -81,7 +92,7 @@ public class SightsController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
- @Operation(summary = "导出观光景点基本信息 Excel")
|
|
|
+ @Operation(summary = "导出观光景点 Excel")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
public void exportSightsExcel(@Valid SightsPageReqVO pageReqVO,
|
|
|
@@ -89,30 +100,80 @@ public class SightsController {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
List<SightsDO> list = sightsService.getSightsPage(pageReqVO).getList();
|
|
|
// 导出 Excel
|
|
|
- ExcelUtils.write(response, "观光景点基本信息.xls", "数据", SightsRespVO.class,
|
|
|
+ ExcelUtils.write(response, "观光景点.xls", "数据", SightsRespVO.class,
|
|
|
BeanUtils.toBean(list, SightsRespVO.class));
|
|
|
}
|
|
|
+ @GetMapping("/get-count")
|
|
|
+ @Operation(summary = "获得景点 count")
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
+ public CommonResult<Long> getSightCount() {
|
|
|
+ return success(sightsService.getCount());
|
|
|
+ }
|
|
|
+ // ==================== 子表(观光景点评论) ====================
|
|
|
+
|
|
|
+ @GetMapping("/sights-comment/page")
|
|
|
+ @Operation(summary = "获得观光景点评论分页")
|
|
|
+ @Parameter(name = "sightsId", description = "观光景点编号,关联 SightDO 的 id")
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
+ public CommonResult<PageResult<SightsCommentDO>> getSightsCommentPage(PageParam pageReqVO,
|
|
|
+ @RequestParam("sightsId") Long sightsId) {
|
|
|
+ return success(sightsService.getSightsCommentPage(pageReqVO, sightsId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/sights-comment/create")
|
|
|
+ @Operation(summary = "创建观光景点评论")
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:create')")
|
|
|
+ public CommonResult<Long> createSightsComment(@Valid @RequestBody SightsCommentDO sightsComment) {
|
|
|
+ return success(sightsService.createSightsComment(sightsComment));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/sights-comment/update")
|
|
|
+ @Operation(summary = "更新观光景点评论")
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:update')")
|
|
|
+ public CommonResult<Boolean> updateSightsComment(@Valid @RequestBody SightsCommentDO sightsComment) {
|
|
|
+ sightsService.updateSightsComment(sightsComment);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/sights-comment/delete")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @Operation(summary = "删除观光景点评论")
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:delete')")
|
|
|
+ public CommonResult<Boolean> deleteSightsComment(@RequestParam("id") Long id) {
|
|
|
+ sightsService.deleteSightsComment(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/sights-comment/get")
|
|
|
+ @Operation(summary = "获得观光景点评论")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
+ public CommonResult<SightsCommentDO> getSightsComment(@RequestParam("id") Long id) {
|
|
|
+ return success(sightsService.getSightsComment(id));
|
|
|
+ }
|
|
|
|
|
|
- // ==================== 子表(观光景点对语言扩充信息) ====================
|
|
|
+ // ==================== 子表(观光景点多语言扩充信息) ====================
|
|
|
|
|
|
@GetMapping("/sights-i18n-extension/page")
|
|
|
- @Operation(summary = "获得观光景点对语言扩充信息分页")
|
|
|
- @Parameter(name = "sightsId", description = "景点")
|
|
|
+ @Operation(summary = "获得观光景点多语言扩充信息分页")
|
|
|
+ @Parameter(name = "sightsId", description = "景点编号 关联 sightDO 的 id 编号")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
public CommonResult<PageResult<SightsI18nExtensionDO>> getSightsI18nExtensionPage(PageParam pageReqVO,
|
|
|
@RequestParam("sightsId") Long sightsId) {
|
|
|
- return success(sightsService.getSightsI18nExtensionPage(pageReqVO, sightsId));
|
|
|
+ PageResult<SightsI18nExtensionDO> test= sightsService.getSightsI18nExtensionPage(pageReqVO, sightsId);
|
|
|
+ return success(test);
|
|
|
+// return success(sightsService.getSightsI18nExtensionPage(pageReqVO, sightsId));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/sights-i18n-extension/create")
|
|
|
- @Operation(summary = "创建观光景点对语言扩充信息")
|
|
|
+ @Operation(summary = "创建观光景点多语言扩充信息")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:create')")
|
|
|
public CommonResult<Long> createSightsI18nExtension(@Valid @RequestBody SightsI18nExtensionDO sightsI18nExtension) {
|
|
|
return success(sightsService.createSightsI18nExtension(sightsI18nExtension));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/sights-i18n-extension/update")
|
|
|
- @Operation(summary = "更新观光景点对语言扩充信息")
|
|
|
+ @Operation(summary = "更新观光景点多语言扩充信息")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:update')")
|
|
|
public CommonResult<Boolean> updateSightsI18nExtension(@Valid @RequestBody SightsI18nExtensionDO sightsI18nExtension) {
|
|
|
sightsService.updateSightsI18nExtension(sightsI18nExtension);
|
|
|
@@ -121,7 +182,7 @@ public class SightsController {
|
|
|
|
|
|
@DeleteMapping("/sights-i18n-extension/delete")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
- @Operation(summary = "删除观光景点对语言扩充信息")
|
|
|
+ @Operation(summary = "删除观光景点多语言扩充信息")
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:delete')")
|
|
|
public CommonResult<Boolean> deleteSightsI18nExtension(@RequestParam("id") Long id) {
|
|
|
sightsService.deleteSightsI18nExtension(id);
|
|
|
@@ -129,7 +190,7 @@ public class SightsController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/sights-i18n-extension/get")
|
|
|
- @Operation(summary = "获得观光景点对语言扩充信息")
|
|
|
+ @Operation(summary = "获得观光景点多语言扩充信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('guide:sights:query')")
|
|
|
public CommonResult<SightsI18nExtensionDO> getSightsI18nExtension(@RequestParam("id") Long id) {
|