|
@@ -1,48 +1,94 @@
|
|
|
package io.platform.app.web.controller;
|
|
|
|
|
|
-import io.platform.app.web.query.CommonQuery;
|
|
|
import io.platform.app.web.remote.HomePageRemote;
|
|
|
+import io.platform.base.common.exception.RRException;
|
|
|
import io.platform.base.common.utils.R;
|
|
|
+import io.platform.base.dto.ArticleDTO;
|
|
|
+import io.platform.base.dto.NoticeDTO;
|
|
|
+import io.platform.base.dto.StoreBannerDTO;
|
|
|
+import io.platform.config.annotation.FuncLogAnno;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+/**
|
|
|
+ * TODO
|
|
|
+ *
|
|
|
+ * 首页模块
|
|
|
+ * 1.轮播图
|
|
|
+ * 2.系统公告
|
|
|
+ * 3.门店政策
|
|
|
+ *
|
|
|
+ * @author shanxin
|
|
|
+ * @version 1.0
|
|
|
+ * @date 2020/11/6 9:03
|
|
|
+ */
|
|
|
@RestController
|
|
|
-@Api(tags = "首页模块相关")
|
|
|
-@RequestMapping("/app/homePage")
|
|
|
+@RequestMapping("/homepage/")
|
|
|
+@Api(tags = "APP首页相关内容")
|
|
|
public class HomePageController {
|
|
|
|
|
|
@Autowired
|
|
|
private HomePageRemote homePageRemote;
|
|
|
|
|
|
/**
|
|
|
- * 获取banner图列表
|
|
|
+ * 用户获取banner图列表
|
|
|
+ * @param storeBannerDTO
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/bannerList")
|
|
|
- @ApiOperation("banner图列表")
|
|
|
- public R bannerList(@RequestBody CommonQuery bannerQuery){
|
|
|
- return R.ok().put("list",homePageRemote.getBannerList(bannerQuery));
|
|
|
+ @PostMapping("/getBanners")
|
|
|
+ @ApiOperation("用户获取Banner图列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "门店id",required = true),
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "用户获取Banner图列表接口")
|
|
|
+ public R getStoreBannerList(@RequestBody StoreBannerDTO storeBannerDTO){
|
|
|
+ if(storeBannerDTO.getStoreId()==null){
|
|
|
+ throw new RRException("门店ID不能为空");
|
|
|
+ }
|
|
|
+ return R.ok().put("list",homePageRemote.getStoreBannerList(storeBannerDTO));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 首页公告消息
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation("首页公告消息")
|
|
|
@PostMapping("/noticeList")
|
|
|
- public R noticeList(){
|
|
|
- return R.ok().put("list",homePageRemote.getNoticeList());
|
|
|
+ @ApiOperation("首页公告消息")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "contentType", value = "展示位置",required = true),
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "首页公告消息接口")
|
|
|
+ public R noticeList(@RequestBody NoticeDTO noticeDTO){
|
|
|
+ if (null == noticeDTO.getContentType()) {
|
|
|
+ throw new RRException("展示位置不能为空");
|
|
|
+ }
|
|
|
+ return R.ok().put("list",homePageRemote.getNoticeList(noticeDTO));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 系统政策
|
|
|
+ * 系统政策接口
|
|
|
+ * @param articleDTO
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation("系统政策")
|
|
|
@PostMapping("/articleList")
|
|
|
- public R articleList(){
|
|
|
- return R.ok().put("list",homePageRemote.getArticleList());
|
|
|
+ @ApiOperation("系统政策")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "displayType", value = "展示位置",required = true),
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "系统政策接口")
|
|
|
+ public R articleList(@RequestBody ArticleDTO articleDTO){
|
|
|
+ if (null == articleDTO.getDisplayType()) {
|
|
|
+ throw new RRException("显示位置不能为空");
|
|
|
+ }
|
|
|
+ return R.ok().put("list",homePageRemote.getArticle(articleDTO));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|