|
@@ -1,12 +1,11 @@
|
|
|
package com.gis.web.controller;
|
|
|
|
|
|
+import com.gis.common.constant.MsgCode;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.dto.*;
|
|
|
-import com.gis.domain.po.CommentEntity;
|
|
|
-import com.gis.domain.po.ProfileEntity;
|
|
|
-import com.gis.domain.po.SlideshowEntity;
|
|
|
-import com.gis.domain.po.VisitEntity;
|
|
|
+import com.gis.domain.po.*;
|
|
|
import com.gis.service.*;
|
|
|
+import com.gis.service.aop.WebControllerLog;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -16,13 +15,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Created by owen on 2021/6/18 0018 14:50
|
|
|
*/
|
|
|
@Slf4j
|
|
|
-@Api(tags = "门户网站")
|
|
|
+@Api(tags = "w-门户网站")
|
|
|
@RestController
|
|
|
@RequestMapping("api/web")
|
|
|
public class WebController {
|
|
@@ -62,6 +62,17 @@ public class WebController {
|
|
|
@Autowired
|
|
|
ProfileService profileService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ BookService bookService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ QuestionGroupService questionGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ GuideService guideService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ CountAnswerService countAnswerService;
|
|
|
|
|
|
@ApiOperation("轮播图")
|
|
|
@PostMapping("slideshow/list")
|
|
@@ -84,19 +95,12 @@ public class WebController {
|
|
|
return newsService.addVisit(id);
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
-// @ApiOperation("列表")
|
|
|
-// @PostMapping("profile/list")
|
|
|
-// public Result<ProfileEntity> profileList() {
|
|
|
-// return profileService.findAll();
|
|
|
-// }
|
|
|
-
|
|
|
|
|
|
-// @ApiOperation(value = "博物馆信息")
|
|
|
-// @GetMapping("museum/info")
|
|
|
-// public Result museumInfo(){
|
|
|
-// return Result.success(museumInfoService.findById(1L));
|
|
|
-// }
|
|
|
+ @ApiOperation("概况-列表")
|
|
|
+ @PostMapping("profile/list")
|
|
|
+ public Result<ProfileEntity> profileList() {
|
|
|
+ return Result.success(profileService.findAll());
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// @ApiOperation(value = "博物馆访问量")
|
|
@@ -106,40 +110,64 @@ public class WebController {
|
|
|
// }
|
|
|
|
|
|
|
|
|
- @ApiOperation(value = "本馆资讯", notes = "type, news:新闻, info:信息, activity:活动")
|
|
|
+ @ApiOperation(value = "资讯-列表", notes = "type, news:新闻, info:信息, activity:活动")
|
|
|
@PostMapping("news/list")
|
|
|
public Result newsList(@RequestBody TypePageDto param){
|
|
|
return newsService.search(param);
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value = "展览资讯", notes = "type, 状态, unstart:未开始, start:开始, end:结束")
|
|
|
+ @ApiOperation(value = "资讯-出版书籍")
|
|
|
+ @PostMapping("book/list")
|
|
|
+ public Result bookList(@RequestBody PageDto param){
|
|
|
+ return bookService.search(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "展览-列表", notes = "type, 状态, unstart:未开始, start:开始, end:结束")
|
|
|
@PostMapping("exhibition/list")
|
|
|
public Result exhibitionList(@RequestBody TypePageDto param){
|
|
|
return exhibitionService.search(param);
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value = "典藏")
|
|
|
+ @ApiOperation(value = "典藏-列表", notes = "类型: 图片:img, 模型:model")
|
|
|
@PostMapping("goods/list")
|
|
|
public Result goodsList(@RequestBody GoodsPageDto param){
|
|
|
return goodsService.search(param);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "活动列表", notes = "type: 类型, online:线上, volunteer:志愿者")
|
|
|
+ @ApiOperation(value = "活动-列表", notes = "type: 类型, online:线上, volunteer:志愿者")
|
|
|
@PostMapping("activity/list")
|
|
|
public Result activityList(@RequestBody TypePageDto param){
|
|
|
return activityService.search(param);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "活动-问卷调查")
|
|
|
+ @PostMapping("questionGroup/detail/{id}")
|
|
|
+ public Result questionGroupDetail(@PathVariable Long id){
|
|
|
+ return questionGroupService.detail(id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @WebControllerLog(description = "活动-问卷提交", addDb = true)
|
|
|
+ @ApiOperation("活动-问卷提交")
|
|
|
+ @PostMapping("questionGroup/save")
|
|
|
+ public Result<CountAnswerEntity> questionGroupSave(@Valid @RequestBody List<CountAnswerDto> param) {
|
|
|
+ return countAnswerService.saveEntity(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@ApiOperation(value = "服务-留言列表")
|
|
|
@PostMapping("comment/list")
|
|
|
public Result commentList(@RequestBody PageDateDto param){
|
|
|
return commentService.search(param, 1);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "服务-留言")
|
|
|
+ @ApiOperation(value = "服务-旅客留言")
|
|
|
@PostMapping("comment/save")
|
|
|
public Result commentSave(@Valid @RequestBody CommentDto param){
|
|
|
CommentEntity entity = new CommentEntity();
|
|
@@ -150,20 +178,14 @@ public class WebController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "搜索")
|
|
|
-// @PostMapping("search")
|
|
|
-// public Result search(@RequestBody SearchDto param){
|
|
|
-// return webService.search(param);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// @ApiOperation(value = "搜索详情")
|
|
|
-// @PostMapping("search/detail")
|
|
|
-// public Result searchDetail(@RequestBody ModuleDto param){
|
|
|
-// return webService.searchDetail(param);
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
+ @ApiOperation(value = "服务-参观指南", notes = "默认id为1")
|
|
|
+ @GetMapping("detail/{id}")
|
|
|
+ public Result detail(@PathVariable Long id) {
|
|
|
+ GuideEntity entity = guideService.findById(id);
|
|
|
+ if (entity == null) {
|
|
|
+ return Result.failure(MsgCode.e3001,"对象不存在,id: " + id);
|
|
|
+ }
|
|
|
+ return Result.success(entity);
|
|
|
+ }
|
|
|
}
|