From 97cae5e6b64600eba0de9a6f5297f4471990fa17 Mon Sep 17 00:00:00 2001 From: tangzh Date: Wed, 5 Mar 2025 22:32:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zbkj/common/model/home/Home.java | 2 +- .../common/response/SetMealFloorResponse.java | 6 +- .../main/java/com/zbkj/common/vo/HomeVo.java | 2 +- .../front/controller/ArticleController.java | 224 +++++----- .../zbkj/front/controller/CartController.java | 2 +- .../front/controller/IndexController.java | 66 ++- .../front/controller/LoginController.java | 172 +++---- .../front/controller/SecKillController.java | 130 +++--- .../front/controller/StoreController.java | 5 +- .../controller/StoreOrderController.java | 45 +- .../zbkj/front/controller/UserController.java | 423 +++++++++--------- .../controller/UserRechargeController.java | 186 ++++---- .../front/controller/UserSignController.java | 194 ++++---- .../service/impl/EbHomeServiceImpl.java | 13 +- 14 files changed, 733 insertions(+), 737 deletions(-) diff --git a/food-common/src/main/java/com/zbkj/common/model/home/Home.java b/food-common/src/main/java/com/zbkj/common/model/home/Home.java index 26dbfaa..749d6c5 100644 --- a/food-common/src/main/java/com/zbkj/common/model/home/Home.java +++ b/food-common/src/main/java/com/zbkj/common/model/home/Home.java @@ -71,6 +71,6 @@ public class Home implements Serializable { @Transient @TableField(exist = false) - private List hpList; + private List products; } diff --git a/food-common/src/main/java/com/zbkj/common/response/SetMealFloorResponse.java b/food-common/src/main/java/com/zbkj/common/response/SetMealFloorResponse.java index f3eecdf..3c59e67 100644 --- a/food-common/src/main/java/com/zbkj/common/response/SetMealFloorResponse.java +++ b/food-common/src/main/java/com/zbkj/common/response/SetMealFloorResponse.java @@ -16,8 +16,8 @@ public class SetMealFloorResponse implements Serializable { private static final long serialVersionUID=1L; - @ApiModelProperty(value = "id") - private Integer id; + @ApiModelProperty(value = "homeId") + private Integer homeId; @ApiModelProperty(value = "名称") private String name; @@ -37,6 +37,6 @@ public class SetMealFloorResponse implements Serializable { @ApiModelProperty(value = "跳转类型") private String jumpType; - private Object obj; + private Object homeProducts; } diff --git a/food-common/src/main/java/com/zbkj/common/vo/HomeVo.java b/food-common/src/main/java/com/zbkj/common/vo/HomeVo.java index 4c72279..bb92f08 100644 --- a/food-common/src/main/java/com/zbkj/common/vo/HomeVo.java +++ b/food-common/src/main/java/com/zbkj/common/vo/HomeVo.java @@ -59,6 +59,6 @@ public class HomeVo implements Serializable { @Transient @TableField(exist = false) - private List hpList; + private List products; } diff --git a/food-front/src/main/java/com/zbkj/front/controller/ArticleController.java b/food-front/src/main/java/com/zbkj/front/controller/ArticleController.java index 8a887e6..0f89ee4 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/ArticleController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/ArticleController.java @@ -1,112 +1,112 @@ -package com.zbkj.front.controller; - -import com.zbkj.common.page.CommonPage; -import com.zbkj.common.request.ActivityListRequest; -import com.zbkj.common.response.ArticleResponse; -import com.zbkj.common.response.CommonResult; -import com.zbkj.common.request.PageParamRequest; -import com.zbkj.common.model.article.Article; -import com.zbkj.common.model.category.Category; -import com.zbkj.service.service.ArticleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - - -/** - * 文章 - - */ -@Slf4j -@RestController("ArticleFrontController") -@RequestMapping("api/front/article") -@Api(tags = "文章") -public class ArticleController { - - @Autowired - private ArticleService articleService; - - - - /** - * 分页列表 原来文章接口 - */ - @ApiOperation(value = "分页列表") - @RequestMapping(value = "/list/{cid}", method = RequestMethod.GET) - public CommonResult> getListArticle(@PathVariable(name="cid") String cid, - @Validated PageParamRequest pageParamRequest) { - return CommonResult.success(CommonPage.restPage(articleService.getListArticle(cid, pageParamRequest))); - } - - - - /** - * 分页列表 - */ - @ApiOperation(value = "分页列表") - @RequestMapping(value = "/list", method = RequestMethod.GET) - public CommonResult> getList(@Validated ActivityListRequest request, - @Validated PageParamRequest pageParamRequest) { - return CommonResult.success(CommonPage.restPage(articleService.getList(request, pageParamRequest))); - } - - /** - * 热门列表 - */ - @ApiOperation(value = "热门列表") - @RequestMapping(value = "/hot/list", method = RequestMethod.GET) - public CommonResult> getHotList() { - return CommonResult.success(CommonPage.restPage(articleService.getHotList())); - } - - /** - * 轮播列表 - */ - @ApiOperation(value = "轮播列表") - @RequestMapping(value = "/banner/list", method = RequestMethod.GET) - public CommonResult> getList() { - return CommonResult.success(CommonPage.restPage(articleService.getBannerList())); - } - - /** - * 文章分类列表 - */ - @ApiOperation(value = "文章分类列表") - @RequestMapping(value = "/category/list", method = RequestMethod.GET) - public CommonResult> categoryList() { - return CommonResult.success(CommonPage.restPage(articleService.getCategoryList())); - } - - /** - * 查询文章详情 - * @param id Integer - */ - @ApiOperation(value = "详情") - @RequestMapping(value = "/info", method = RequestMethod.GET) - @ApiImplicitParam(name="id", value="文章ID") - public CommonResult info(@RequestParam(value = "id") Integer id) { - return CommonResult.success(articleService.getVoByFront(id)); - } - - /** - * 文章点赞 - * @param id Integer - */ - @ApiOperation(value = "点赞/取消点赞") - @RequestMapping(value = "/praise", method = RequestMethod.GET) - @ApiImplicitParam(name="id", value="文章ID") - public CommonResult praise(@RequestParam(value = "id") Integer id) { - if (articleService.praise(id)) { - return CommonResult.success(); - } else { - return CommonResult.failed(); - } - } -} - - - +//package com.zbkj.front.controller; +// +//import com.zbkj.common.page.CommonPage; +//import com.zbkj.common.request.ActivityListRequest; +//import com.zbkj.common.response.ArticleResponse; +//import com.zbkj.common.response.CommonResult; +//import com.zbkj.common.request.PageParamRequest; +//import com.zbkj.common.model.article.Article; +//import com.zbkj.common.model.category.Category; +//import com.zbkj.service.service.ArticleService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiImplicitParam; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +// +///** +// * 文章 +// +// */ +//@Slf4j +//@RestController("ArticleFrontController") +//@RequestMapping("api/front/article") +//@Api(tags = "文章") +//public class ArticleController { +// +// @Autowired +// private ArticleService articleService; +// +// +// +// /** +// * 分页列表 原来文章接口 +// */ +// @ApiOperation(value = "分页列表") +// @RequestMapping(value = "/list/{cid}", method = RequestMethod.GET) +// public CommonResult> getListArticle(@PathVariable(name="cid") String cid, +// @Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(CommonPage.restPage(articleService.getListArticle(cid, pageParamRequest))); +// } +// +// +// +// /** +// * 分页列表 +// */ +// @ApiOperation(value = "分页列表") +// @RequestMapping(value = "/list", method = RequestMethod.GET) +// public CommonResult> getList(@Validated ActivityListRequest request, +// @Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(CommonPage.restPage(articleService.getList(request, pageParamRequest))); +// } +// +// /** +// * 热门列表 +// */ +// @ApiOperation(value = "热门列表") +// @RequestMapping(value = "/hot/list", method = RequestMethod.GET) +// public CommonResult> getHotList() { +// return CommonResult.success(CommonPage.restPage(articleService.getHotList())); +// } +// +// /** +// * 轮播列表 +// */ +// @ApiOperation(value = "轮播列表") +// @RequestMapping(value = "/banner/list", method = RequestMethod.GET) +// public CommonResult> getList() { +// return CommonResult.success(CommonPage.restPage(articleService.getBannerList())); +// } +// +// /** +// * 文章分类列表 +// */ +// @ApiOperation(value = "文章分类列表") +// @RequestMapping(value = "/category/list", method = RequestMethod.GET) +// public CommonResult> categoryList() { +// return CommonResult.success(CommonPage.restPage(articleService.getCategoryList())); +// } +// +// /** +// * 查询文章详情 +// * @param id Integer +// */ +// @ApiOperation(value = "详情") +// @RequestMapping(value = "/info", method = RequestMethod.GET) +// @ApiImplicitParam(name="id", value="文章ID") +// public CommonResult info(@RequestParam(value = "id") Integer id) { +// return CommonResult.success(articleService.getVoByFront(id)); +// } +// +// /** +// * 文章点赞 +// * @param id Integer +// */ +// @ApiOperation(value = "点赞/取消点赞") +// @RequestMapping(value = "/praise", method = RequestMethod.GET) +// @ApiImplicitParam(name="id", value="文章ID") +// public CommonResult praise(@RequestParam(value = "id") Integer id) { +// if (articleService.praise(id)) { +// return CommonResult.success(); +// } else { +// return CommonResult.failed(); +// } +// } +//} +// +// +// diff --git a/food-front/src/main/java/com/zbkj/front/controller/CartController.java b/food-front/src/main/java/com/zbkj/front/controller/CartController.java index dab0c8a..85df2eb 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/CartController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/CartController.java @@ -30,7 +30,7 @@ import java.util.Map; @Slf4j @RestController @RequestMapping("api/front/cart") -@Api(tags = "商品 -- 购物车") //配合swagger使用 +@Api(tags = "购物车") //配合swagger使用 public class CartController { @Autowired diff --git a/food-front/src/main/java/com/zbkj/front/controller/IndexController.java b/food-front/src/main/java/com/zbkj/front/controller/IndexController.java index 07ab2f4..4670c0d 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/IndexController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/IndexController.java @@ -36,31 +36,26 @@ public class IndexController { private IndexService indexService; /** - * 首页数据c + * 首页数据 */ @RequestMapping(value = "/index", method = RequestMethod.GET) @ApiOperation(value="首页数据", notes="首页数据" + " \n \n" + "响应参数:" + " \n" - + "homeList:首页顶部滚动图" + " \n" + + "homeList:楼层" + " \n" + + " --> name:名称" + " \n" + + " --> title:标题" + " \n" + + " --> directUrl:列表路径\"" + " \n" + " --> image:图片" + " \n" - + " --> jump_url:跳转路径" + " \n" - + "navigation:导航栏" + " \n" - + " --> image:图片" + " \n" - + " --> jump_url:跳转路径" + " \n" - + "shardingTitle1:诗韵嘉木【标题】,shardingTitle2:优选/活动/视频【标题】,shardingTitle3:热门推荐【标题】" + " \n" - + " --> image:图片" + " \n" - + " --> jump_url:【更多>】跳转链接" + " \n" - + " --> data_type:数据类型(1静态数据,2动态数据)" + " \n" - + " --> static_api:静态数据api" + " \n" - + " --> dynamic_api:动态数据api" + " \n" - + "menus:菜单栏" + " \n" - + " --> image:图片" + " \n" - + " --> jump_url:跳转路径" + " \n" - + "gamePrizeDrawId:抽奖游戏(若存在有效返回id【抽奖接口需要用】,否则null)" + " \n" - + "gameTreeId:农场游戏(若存在有效返回id【抽奖接口需要用】,否则null)" + " \n" - + "longitude:场地预约-经度" + " \n" - + "latitude:场地预约-纬度" + " \n" + + " --> jumpIds:跳转id(list_ids/product_id)" + " \n" + + " --> jumpType:跳转类型1,列表0,详情" + " \n" + + " -->--> products:商品" + " \n" + + " -->-->--> productId:产品id" + " \n" + + " -->-->--> imgUrl:图片" + " \n" + + " -->-->--> directUrl:跳转地址" + " \n" + + "logoUrl:企业logo" + " \n" + + "consumerHotline:客服电话" + " \n" + + "telephoneServiceSwitch:客服电话服务开关" + " \n" ) public CommonResult getIndexInfo() { return CommonResult.success(indexService.getIndexInfo()); @@ -73,7 +68,6 @@ public class IndexController { @RequestMapping(value = "/index/product/{type}", method = RequestMethod.GET) @ApiImplicitParam(name = "type", value = "类型 【1 精品推荐 2 热门榜单 3首发新品 4促销单品】", dataType = "int", required = true) public CommonResult> getProductList(@PathVariable(value = "type") Integer type, PageParamRequest pageParamRequest) { - return CommonResult.success(indexService.findIndexProductList(type, pageParamRequest)); } @@ -95,23 +89,23 @@ public class IndexController { return CommonResult.success(indexService.getShareConfig()); } - /** - * 颜色配置 - */ - @ApiOperation(value = "颜色配置") - @RequestMapping(value = "/index/color/config", method = RequestMethod.GET) - public CommonResult getColorConfig() { - return CommonResult.success(indexService.getColorConfig()); - } +// /** +// * 颜色配置 +// */ +// @ApiOperation(value = "颜色配置") +// @RequestMapping(value = "/index/color/config", method = RequestMethod.GET) +// public CommonResult getColorConfig() { +// return CommonResult.success(indexService.getColorConfig()); +// } - /** - * 版本信息 - */ - @ApiOperation(value = "获取版本信息") - @RequestMapping(value = "/index/get/version", method = RequestMethod.GET) - public CommonResult> getVersion() { - return CommonResult.success(indexService.getVersion()); - } +// /** +// * 版本信息 +// */ +// @ApiOperation(value = "获取版本信息") +// @RequestMapping(value = "/index/get/version", method = RequestMethod.GET) +// public CommonResult> getVersion() { +// return CommonResult.success(indexService.getVersion()); +// } /** * 全局本地图片域名 diff --git a/food-front/src/main/java/com/zbkj/front/controller/LoginController.java b/food-front/src/main/java/com/zbkj/front/controller/LoginController.java index 069e9bf..bdaa6e5 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/LoginController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/LoginController.java @@ -1,86 +1,86 @@ -package com.zbkj.front.controller; - - -import com.zbkj.common.request.LoginMobileRequest; -import com.zbkj.common.request.LoginRequest; -import com.zbkj.common.response.CommonResult; -import com.zbkj.common.response.LoginResponse; -import com.zbkj.front.service.LoginService; -import com.zbkj.service.service.SmsService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; - -/** - * 用户登陆 前端控制器 - - */ -@Slf4j -@RestController("FrontLoginController") -@RequestMapping("api/front") -@Api(tags = "用户 -- 登录注册") -public class LoginController { - - @Autowired - private SmsService smsService; - - @Autowired - private LoginService loginService; - - /** - * 手机号登录接口 - */ - @ApiOperation(value = "手机号登录接口") - @RequestMapping(value = "/login/mobile", method = RequestMethod.POST) - public CommonResult phoneLogin(@RequestBody @Validated LoginMobileRequest loginRequest) { - return CommonResult.success(loginService.phoneLogin(loginRequest)); - } - - /** - * 账号密码登录 - */ - @ApiOperation(value = "账号密码登录") - @RequestMapping(value = "/login", method = RequestMethod.POST) - public CommonResult login(@RequestBody @Validated LoginRequest loginRequest) { - return CommonResult.success(loginService.login(loginRequest)); - } - - - /** - * 退出登录 - */ - @ApiOperation(value = "退出") - @RequestMapping(value = "/logout", method = RequestMethod.GET) - public CommonResult loginOut(HttpServletRequest request){ - loginService.loginOut(request); - return CommonResult.success(); - } - - /** - * 发送短信登录验证码 - * @param phone 手机号码 - * @return 发送是否成功 - */ - @ApiOperation(value = "发送短信登录验证码") - @RequestMapping(value = "/sendCode", method = RequestMethod.POST) - @ApiImplicitParams({ - @ApiImplicitParam(name="phone", value="手机号码", required = true) - }) - public CommonResult sendCode(@RequestParam String phone){ - if(smsService.sendCommonCode(phone)){ - return CommonResult.success("发送成功"); - }else{ - return CommonResult.failed("发送失败"); - } - } -} - - - +//package com.zbkj.front.controller; +// +// +//import com.zbkj.common.request.LoginMobileRequest; +//import com.zbkj.common.request.LoginRequest; +//import com.zbkj.common.response.CommonResult; +//import com.zbkj.common.response.LoginResponse; +//import com.zbkj.front.service.LoginService; +//import com.zbkj.service.service.SmsService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiImplicitParam; +//import io.swagger.annotations.ApiImplicitParams; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +//import javax.servlet.http.HttpServletRequest; +// +///** +// * 用户登陆 前端控制器 +// +// */ +//@Slf4j +//@RestController("FrontLoginController") +//@RequestMapping("api/front") +//@Api(tags = "用户 -- 登录注册") +//public class LoginController { +// +// @Autowired +// private SmsService smsService; +// +// @Autowired +// private LoginService loginService; +// +// /** +// * 手机号登录接口 +// */ +// @ApiOperation(value = "手机号登录接口") +// @RequestMapping(value = "/login/mobile", method = RequestMethod.POST) +// public CommonResult phoneLogin(@RequestBody @Validated LoginMobileRequest loginRequest) { +// return CommonResult.success(loginService.phoneLogin(loginRequest)); +// } +// +// /** +// * 账号密码登录 +// */ +// @ApiOperation(value = "账号密码登录") +// @RequestMapping(value = "/login", method = RequestMethod.POST) +// public CommonResult login(@RequestBody @Validated LoginRequest loginRequest) { +// return CommonResult.success(loginService.login(loginRequest)); +// } +// +// +// /** +// * 退出登录 +// */ +// @ApiOperation(value = "退出") +// @RequestMapping(value = "/logout", method = RequestMethod.GET) +// public CommonResult loginOut(HttpServletRequest request){ +// loginService.loginOut(request); +// return CommonResult.success(); +// } +// +// /** +// * 发送短信登录验证码 +// * @param phone 手机号码 +// * @return 发送是否成功 +// */ +// @ApiOperation(value = "发送短信登录验证码") +// @RequestMapping(value = "/sendCode", method = RequestMethod.POST) +// @ApiImplicitParams({ +// @ApiImplicitParam(name="phone", value="手机号码", required = true) +// }) +// public CommonResult sendCode(@RequestParam String phone){ +// if(smsService.sendCommonCode(phone)){ +// return CommonResult.success("发送成功"); +// }else{ +// return CommonResult.failed("发送失败"); +// } +// } +//} +// +// +// diff --git a/food-front/src/main/java/com/zbkj/front/controller/SecKillController.java b/food-front/src/main/java/com/zbkj/front/controller/SecKillController.java index 67a8a91..3eb7ba2 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/SecKillController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/SecKillController.java @@ -1,65 +1,65 @@ -package com.zbkj.front.controller; - -import com.zbkj.common.page.CommonPage; -import com.zbkj.common.request.PageParamRequest; -import com.zbkj.common.response.*; -import com.zbkj.service.service.StoreSeckillService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * SecKillController - - */ -@Slf4j -@RestController -@RequestMapping("api/front/seckill") -@Api(tags = "秒杀商品") -public class SecKillController { - - @Autowired - StoreSeckillService storeSeckillService; - - /** - * 秒杀首页数据 - * @return 可秒杀配置 - */ - @ApiOperation(value = "秒杀首页数据") - @RequestMapping(value = "/index", method = RequestMethod.GET) - public CommonResult index() { - return CommonResult.success(storeSeckillService.getIndexInfo()); - } - - /** - * 秒杀Index - * @return 可秒杀配置 - */ - @ApiOperation(value = "秒杀Header") - @RequestMapping(value = "/header", method = RequestMethod.GET) - public CommonResult> header() { - return CommonResult.success(storeSeckillService.getForH5Index()); - } - - /** - * 根据时间段查询秒杀信息 - * @return 查询时间内的秒杀商品列表 - */ - @ApiOperation(value = "秒杀列表") - @RequestMapping(value = "/list/{timeId}", method = RequestMethod.GET) - public CommonResult> list(@PathVariable("timeId") String timeId, @ModelAttribute PageParamRequest pageParamRequest) { - return CommonResult.success(CommonPage.restPage(storeSeckillService.getKillListByTimeId(timeId, pageParamRequest))); - } - - - @ApiOperation(value = "详情") - @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET) - public CommonResult info(@PathVariable(value = "id") Integer id) { - StoreSeckillDetailResponse storeSeckill = storeSeckillService.getDetailH5(id); - return CommonResult.success(storeSeckill); - } -} +//package com.zbkj.front.controller; +// +//import com.zbkj.common.page.CommonPage; +//import com.zbkj.common.request.PageParamRequest; +//import com.zbkj.common.response.*; +//import com.zbkj.service.service.StoreSeckillService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.*; +// +//import java.util.List; +// +///** +// * SecKillController +// +// */ +//@Slf4j +//@RestController +//@RequestMapping("api/front/seckill") +//@Api(tags = "秒杀商品") +//public class SecKillController { +// +// @Autowired +// StoreSeckillService storeSeckillService; +// +// /** +// * 秒杀首页数据 +// * @return 可秒杀配置 +// */ +// @ApiOperation(value = "秒杀首页数据") +// @RequestMapping(value = "/index", method = RequestMethod.GET) +// public CommonResult index() { +// return CommonResult.success(storeSeckillService.getIndexInfo()); +// } +// +// /** +// * 秒杀Index +// * @return 可秒杀配置 +// */ +// @ApiOperation(value = "秒杀Header") +// @RequestMapping(value = "/header", method = RequestMethod.GET) +// public CommonResult> header() { +// return CommonResult.success(storeSeckillService.getForH5Index()); +// } +// +// /** +// * 根据时间段查询秒杀信息 +// * @return 查询时间内的秒杀商品列表 +// */ +// @ApiOperation(value = "秒杀列表") +// @RequestMapping(value = "/list/{timeId}", method = RequestMethod.GET) +// public CommonResult> list(@PathVariable("timeId") String timeId, @ModelAttribute PageParamRequest pageParamRequest) { +// return CommonResult.success(CommonPage.restPage(storeSeckillService.getKillListByTimeId(timeId, pageParamRequest))); +// } +// +// +// @ApiOperation(value = "详情") +// @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET) +// public CommonResult info(@PathVariable(value = "id") Integer id) { +// StoreSeckillDetailResponse storeSeckill = storeSeckillService.getDetailH5(id); +// return CommonResult.success(storeSeckill); +// } +//} diff --git a/food-front/src/main/java/com/zbkj/front/controller/StoreController.java b/food-front/src/main/java/com/zbkj/front/controller/StoreController.java index 8379e1f..41d56ef 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/StoreController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/StoreController.java @@ -22,15 +22,16 @@ import org.springframework.web.bind.annotation.RestController; @Slf4j @RestController("StoreController") @RequestMapping("api/front/store") -@Api(tags = "提货点") +@Api(tags = "门店") public class StoreController { + @Autowired private SystemStoreService systemStoreService; /** * 附近的提货点 */ - @ApiOperation(value = "附近的提货点") + @ApiOperation(value = "附近的门店") @RequestMapping(value = "/list", method = RequestMethod.POST) public CommonResult register(@Validated StoreNearRequest request, @Validated PageParamRequest pageParamRequest){ return CommonResult.success(systemStoreService.getNearList(request, pageParamRequest)); diff --git a/food-front/src/main/java/com/zbkj/front/controller/StoreOrderController.java b/food-front/src/main/java/com/zbkj/front/controller/StoreOrderController.java index 7b1e7dc..229fdd7 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/StoreOrderController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/StoreOrderController.java @@ -34,29 +34,28 @@ public class StoreOrderController { @Autowired private StoreOrderVerification storeOrderVerification; - /** - * 核销员核销订单 - * @param vCode 核销码 - * @return - */ - @ApiOperation(value = "核销员核销订单") - @RequestMapping(value = "/writeUpdate/{vCode}", method = RequestMethod.GET) - public CommonResult verificationOrder(@PathVariable String vCode) { - return CommonResult.success(storeOrderVerification.prosecutorVerificationOrderByCode(vCode)); - } - - /** - * 核销码查询待核销订单 - * @param vCode 核销码 - * @return - */ - @PreAuthorize("hasAuthority('admin:order:write:confirm')") - @ApiOperation(value = "核销码查询待核销订单") - @RequestMapping(value = "/writeConfirm/{vCode}", method = RequestMethod.GET) - public CommonResult verificationConfirmOrder( - @PathVariable String vCode) { - return CommonResult.success(storeOrderVerification.getVerificationOrderByCode(vCode)); - } +// /** +// * 核销员核销订单 +// * @param vCode 核销码 +// * @return +// */ +// @ApiOperation(value = "核销员核销订单") +// @RequestMapping(value = "/writeUpdate/{vCode}", method = RequestMethod.GET) +// public CommonResult verificationOrder(@PathVariable String vCode) { +// return CommonResult.success(storeOrderVerification.prosecutorVerificationOrderByCode(vCode)); +// } +// +// /** +// * 核销码查询待核销订单 +// * @param vCode 核销码 +// * @return +// */ +// @ApiOperation(value = "核销码查询待核销订单") +// @RequestMapping(value = "/writeConfirm/{vCode}", method = RequestMethod.GET) +// public CommonResult verificationConfirmOrder( +// @PathVariable String vCode) { +// return CommonResult.success(storeOrderVerification.getVerificationOrderByCode(vCode)); +// } /** * 预下单 diff --git a/food-front/src/main/java/com/zbkj/front/controller/UserController.java b/food-front/src/main/java/com/zbkj/front/controller/UserController.java index 7067cf1..5f76050 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/UserController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/UserController.java @@ -43,14 +43,15 @@ public class UserController { @Autowired private UserCenterService userCenterService; - /** - * 修改密码 - */ - @ApiOperation(value = "手机号修改密码") - @RequestMapping(value = "/register/reset", method = RequestMethod.POST) - public CommonResult password(@RequestBody @Validated PasswordRequest request) { - return CommonResult.success(userService.password(request)); - } + +// /** +// * 修改密码 +// */ +// @ApiOperation(value = "手机号修改密码") +// @RequestMapping(value = "/register/reset", method = RequestMethod.POST) +// public CommonResult password(@RequestBody @Validated PasswordRequest request) { +// return CommonResult.success(userService.password(request)); +// } /** * 修改个人资料 @@ -73,23 +74,23 @@ public class UserController { return CommonResult.success(userService.getUserCenter()); } - /** - * 换绑手机号校验 - */ - @ApiOperation(value = "换绑手机号校验") - @RequestMapping(value = "update/binding/verify", method = RequestMethod.POST) - public CommonResult updatePhoneVerify(@RequestBody @Validated UserBindingPhoneUpdateRequest request) { - return CommonResult.success(userService.updatePhoneVerify(request)); - } +// /** +// * 换绑手机号校验 +// */ +// @ApiOperation(value = "换绑手机号校验") +// @RequestMapping(value = "update/binding/verify", method = RequestMethod.POST) +// public CommonResult updatePhoneVerify(@RequestBody @Validated UserBindingPhoneUpdateRequest request) { +// return CommonResult.success(userService.updatePhoneVerify(request)); +// } - /** - * 绑定手机号 - */ - @ApiOperation(value = "换绑手机号") - @RequestMapping(value = "update/binding", method = RequestMethod.POST) - public CommonResult updatePhone(@RequestBody @Validated UserBindingPhoneUpdateRequest request) { - return CommonResult.success(userService.updatePhone(request)); - } +// /** +// * 绑定手机号 +// */ +// @ApiOperation(value = "换绑手机号") +// @RequestMapping(value = "update/binding", method = RequestMethod.POST) +// public CommonResult updatePhone(@RequestBody @Validated UserBindingPhoneUpdateRequest request) { +// return CommonResult.success(userService.updatePhone(request)); +// } /** * 用户中心菜单 @@ -100,196 +101,196 @@ public class UserController { return CommonResult.success(systemGroupDataService.getMenuUser()); } - /** - * 推广数据接口(昨天的佣金 累计提现金额 当前佣金) - */ - @ApiOperation(value = "推广数据接口(昨天的佣金 累计提现金额 当前佣金)") - @RequestMapping(value = "/commission", method = RequestMethod.GET) - public CommonResult getCommission() { - return CommonResult.success(userCenterService.getCommission()); - } +// /** +// * 推广数据接口(昨天的佣金 累计提现金额 当前佣金) +// */ +// @ApiOperation(value = "推广数据接口(昨天的佣金 累计提现金额 当前佣金)") +// @RequestMapping(value = "/commission", method = RequestMethod.GET) +// public CommonResult getCommission() { +// return CommonResult.success(userCenterService.getCommission()); +// } - /** - * 推广佣金明细 - */ - @ApiOperation(value = "推广佣金明细") - @RequestMapping(value = "/spread/commission/detail", method = RequestMethod.GET) - public CommonResult> getSpreadCommissionDetail(@Validated PageParamRequest pageParamRequest) { - PageInfo commissionDetail = userCenterService.getSpreadCommissionDetail(pageParamRequest); - return CommonResult.success(CommonPage.restPage(commissionDetail)); - } +// /** +// * 推广佣金明细 +// */ +// @ApiOperation(value = "推广佣金明细") +// @RequestMapping(value = "/spread/commission/detail", method = RequestMethod.GET) +// public CommonResult> getSpreadCommissionDetail(@Validated PageParamRequest pageParamRequest) { +// PageInfo commissionDetail = userCenterService.getSpreadCommissionDetail(pageParamRequest); +// return CommonResult.success(CommonPage.restPage(commissionDetail)); +// } - /** - * 推广佣金/提现总和 - */ - @ApiOperation(value = "推广佣金/提现总和") - @RequestMapping(value = "/spread/count/{type}", method = RequestMethod.GET) - @ApiImplicitParam(name = "type", value = "类型 佣金类型3=佣金,4=提现", allowableValues = "range[3,4]", dataType = "int") - public CommonResult> getSpreadCountByType(@PathVariable Integer type) { - Map map = new HashMap<>(); - map.put("count", userCenterService.getSpreadCountByType(type)); - return CommonResult.success(map); - } +// /** +// * 推广佣金/提现总和 +// */ +// @ApiOperation(value = "推广佣金/提现总和") +// @RequestMapping(value = "/spread/count/{type}", method = RequestMethod.GET) +// @ApiImplicitParam(name = "type", value = "类型 佣金类型3=佣金,4=提现", allowableValues = "range[3,4]", dataType = "int") +// public CommonResult> getSpreadCountByType(@PathVariable Integer type) { +// Map map = new HashMap<>(); +// map.put("count", userCenterService.getSpreadCountByType(type)); +// return CommonResult.success(map); +// } - /** - * 提现申请 - */ - @ApiOperation(value = "提现申请") - @RequestMapping(value = "/extract/cash", method = RequestMethod.POST) - public CommonResult extractCash(@RequestBody @Validated UserExtractRequest request) { - return CommonResult.success(userCenterService.extractCash(request)); - } - - /** - * 提现记录 - */ - @ApiOperation(value = "提现记录") - @RequestMapping(value = "/extract/record", method = RequestMethod.GET) - public CommonResult> getExtractRecord(@Validated PageParamRequest pageParamRequest) { - return CommonResult.success(CommonPage.restPage(userCenterService.getExtractRecord(pageParamRequest))); - } - - /** - * 提现用户信息 - */ - @ApiOperation(value = "提现用户信息") - @RequestMapping(value = "/extract/user", method = RequestMethod.GET) - public CommonResult getExtractUser() { - return CommonResult.success(userCenterService.getExtractUser()); - } - - /** - * 提现银行 - */ - @ApiOperation(value = "提现银行/提现最低金额") - @RequestMapping(value = "/extract/bank", method = RequestMethod.GET) - public CommonResult> getExtractBank() { - return CommonResult.success(userCenterService.getExtractBank()); - } - - /** - * 会员等级列表 - */ - @ApiOperation(value = "会员等级列表") - @RequestMapping(value = "/user/level/grade", method = RequestMethod.GET) - public CommonResult> getUserLevelList() { - return CommonResult.success(userCenterService.getUserLevelList()); - } - - /** - * 推广人统计 - */ - @ApiOperation(value = "推广人统计") - @RequestMapping(value = "/spread/people/count", method = RequestMethod.GET) - public CommonResult getSpreadPeopleCount() { - return CommonResult.success(userCenterService.getSpreadPeopleCount()); - } - - /** - * 推广人列表 - */ - @ApiOperation(value = "推广人列表") - @RequestMapping(value = "/spread/people", method = RequestMethod.GET) - public CommonResult> getSpreadPeopleList(@Validated UserSpreadPeopleRequest request, @Validated PageParamRequest pageParamRequest) { - List spreadPeopleList = userCenterService.getSpreadPeopleList(request, pageParamRequest); - CommonPage commonPage = CommonPage.restPage(spreadPeopleList); - return CommonResult.success(commonPage); - } - - /** - * 用户积分信息 - */ - @ApiOperation(value = "用户积分信息") - @RequestMapping(value = "/integral/user", method = RequestMethod.GET) - public CommonResult getIntegralUser() { - return CommonResult.success(userCenterService.getIntegralUser()); - } - - /** - * 积分记录 - */ - @ApiOperation(value = "积分记录") - @RequestMapping(value = "/integral/list", method = RequestMethod.GET) - public CommonResult> getIntegralList(@Validated PageParamRequest pageParamRequest) { - return CommonResult.success(CommonPage.restPage(userCenterService.getUserIntegralRecordList(pageParamRequest))); - } - - /** - * 经验记录 - */ - @ApiOperation(value = "经验记录") - @RequestMapping(value = "/user/expList", method = RequestMethod.GET) - public CommonResult> getExperienceList(@Validated PageParamRequest pageParamRequest) { - return CommonResult.success(CommonPage.restPage(userCenterService.getUserExperienceList(pageParamRequest))); - } - - /** - * 用户资金统计 - */ - @ApiOperation(value = "用户资金统计") - @RequestMapping(value = "/user/balance", method = RequestMethod.GET) - public CommonResult getUserBalance() { - return CommonResult.success(userCenterService.getUserBalance()); - } - - /** - * 推广订单 - */ - @ApiOperation(value = "推广订单") - @RequestMapping(value = "/spread/order", method = RequestMethod.GET) - public CommonResult getSpreadOrder(@Validated PageParamRequest pageParamRequest) { - return CommonResult.success(userCenterService.getSpreadOrder(pageParamRequest)); - } - - /** - * 推广人排行 - * @return List - */ - @ApiOperation(value = "推广人排行") - @RequestMapping(value = "/rank", method = RequestMethod.GET) - public CommonResult> getTopSpreadPeopleListByDate(@RequestParam(required = false) String type, @Validated PageParamRequest pageParamRequest) { - return CommonResult.success(userCenterService.getTopSpreadPeopleListByDate(type, pageParamRequest)); - } - - /** - * 佣金排行 - * @return 优惠券集合 - */ - @ApiOperation(value = "佣金排行") - @RequestMapping(value = "/brokerage_rank", method = RequestMethod.GET) - public CommonResult> getTopBrokerageListByDate(@RequestParam String type, @Validated PageParamRequest pageParamRequest) { - return CommonResult.success(userCenterService.getTopBrokerageListByDate(type, pageParamRequest)); - } - - /** - * 当前用户在佣金排行第几名 - */ - @ApiOperation(value = "当前用户在佣金排行第几名") - @RequestMapping(value = "/user/brokerageRankNumber", method = RequestMethod.GET) - public CommonResult getNumberByTop(@RequestParam String type) { - return CommonResult.success(userCenterService.getNumberByTop(type)); - } - - /** - * 海报背景图 - */ - @ApiOperation(value = "推广海报图") - @RequestMapping(value = "/user/spread/banner", method = RequestMethod.GET) - public CommonResult> getSpreadBannerList() { - return CommonResult.success(userCenterService.getSpreadBannerList()); - } - - /** - * 绑定推广关系(登录状态) - * @param spreadPid 推广id - * @return 绑定结果 - */ - @ApiOperation(value = "绑定推广关系(登录状态)") - @RequestMapping(value = "/user/bindSpread", method = RequestMethod.GET) - public CommonResult bindsSpread(Integer spreadPid) { - userService.bindSpread(spreadPid); - return CommonResult.success(); - } +// /** +// * 提现申请 +// */ +// @ApiOperation(value = "提现申请") +// @RequestMapping(value = "/extract/cash", method = RequestMethod.POST) +// public CommonResult extractCash(@RequestBody @Validated UserExtractRequest request) { +// return CommonResult.success(userCenterService.extractCash(request)); +// } +// +// /** +// * 提现记录 +// */ +// @ApiOperation(value = "提现记录") +// @RequestMapping(value = "/extract/record", method = RequestMethod.GET) +// public CommonResult> getExtractRecord(@Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(CommonPage.restPage(userCenterService.getExtractRecord(pageParamRequest))); +// } +// +// /** +// * 提现用户信息 +// */ +// @ApiOperation(value = "提现用户信息") +// @RequestMapping(value = "/extract/user", method = RequestMethod.GET) +// public CommonResult getExtractUser() { +// return CommonResult.success(userCenterService.getExtractUser()); +// } +// +// /** +// * 提现银行 +// */ +// @ApiOperation(value = "提现银行/提现最低金额") +// @RequestMapping(value = "/extract/bank", method = RequestMethod.GET) +// public CommonResult> getExtractBank() { +// return CommonResult.success(userCenterService.getExtractBank()); +// } +// +// /** +// * 会员等级列表 +// */ +// @ApiOperation(value = "会员等级列表") +// @RequestMapping(value = "/user/level/grade", method = RequestMethod.GET) +// public CommonResult> getUserLevelList() { +// return CommonResult.success(userCenterService.getUserLevelList()); +// } +// +// /** +// * 推广人统计 +// */ +// @ApiOperation(value = "推广人统计") +// @RequestMapping(value = "/spread/people/count", method = RequestMethod.GET) +// public CommonResult getSpreadPeopleCount() { +// return CommonResult.success(userCenterService.getSpreadPeopleCount()); +// } +// +// /** +// * 推广人列表 +// */ +// @ApiOperation(value = "推广人列表") +// @RequestMapping(value = "/spread/people", method = RequestMethod.GET) +// public CommonResult> getSpreadPeopleList(@Validated UserSpreadPeopleRequest request, @Validated PageParamRequest pageParamRequest) { +// List spreadPeopleList = userCenterService.getSpreadPeopleList(request, pageParamRequest); +// CommonPage commonPage = CommonPage.restPage(spreadPeopleList); +// return CommonResult.success(commonPage); +// } +// +// /** +// * 用户积分信息 +// */ +// @ApiOperation(value = "用户积分信息") +// @RequestMapping(value = "/integral/user", method = RequestMethod.GET) +// public CommonResult getIntegralUser() { +// return CommonResult.success(userCenterService.getIntegralUser()); +// } +// +// /** +// * 积分记录 +// */ +// @ApiOperation(value = "积分记录") +// @RequestMapping(value = "/integral/list", method = RequestMethod.GET) +// public CommonResult> getIntegralList(@Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(CommonPage.restPage(userCenterService.getUserIntegralRecordList(pageParamRequest))); +// } +// +// /** +// * 经验记录 +// */ +// @ApiOperation(value = "经验记录") +// @RequestMapping(value = "/user/expList", method = RequestMethod.GET) +// public CommonResult> getExperienceList(@Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(CommonPage.restPage(userCenterService.getUserExperienceList(pageParamRequest))); +// } +// +// /** +// * 用户资金统计 +// */ +// @ApiOperation(value = "用户资金统计") +// @RequestMapping(value = "/user/balance", method = RequestMethod.GET) +// public CommonResult getUserBalance() { +// return CommonResult.success(userCenterService.getUserBalance()); +// } +// +// /** +// * 推广订单 +// */ +// @ApiOperation(value = "推广订单") +// @RequestMapping(value = "/spread/order", method = RequestMethod.GET) +// public CommonResult getSpreadOrder(@Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(userCenterService.getSpreadOrder(pageParamRequest)); +// } +// +// /** +// * 推广人排行 +// * @return List +// */ +// @ApiOperation(value = "推广人排行") +// @RequestMapping(value = "/rank", method = RequestMethod.GET) +// public CommonResult> getTopSpreadPeopleListByDate(@RequestParam(required = false) String type, @Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(userCenterService.getTopSpreadPeopleListByDate(type, pageParamRequest)); +// } +// +// /** +// * 佣金排行 +// * @return 优惠券集合 +// */ +// @ApiOperation(value = "佣金排行") +// @RequestMapping(value = "/brokerage_rank", method = RequestMethod.GET) +// public CommonResult> getTopBrokerageListByDate(@RequestParam String type, @Validated PageParamRequest pageParamRequest) { +// return CommonResult.success(userCenterService.getTopBrokerageListByDate(type, pageParamRequest)); +// } +// +// /** +// * 当前用户在佣金排行第几名 +// */ +// @ApiOperation(value = "当前用户在佣金排行第几名") +// @RequestMapping(value = "/user/brokerageRankNumber", method = RequestMethod.GET) +// public CommonResult getNumberByTop(@RequestParam String type) { +// return CommonResult.success(userCenterService.getNumberByTop(type)); +// } +// +// /** +// * 海报背景图 +// */ +// @ApiOperation(value = "推广海报图") +// @RequestMapping(value = "/user/spread/banner", method = RequestMethod.GET) +// public CommonResult> getSpreadBannerList() { +// return CommonResult.success(userCenterService.getSpreadBannerList()); +// } +// +// /** +// * 绑定推广关系(登录状态) +// * @param spreadPid 推广id +// * @return 绑定结果 +// */ +// @ApiOperation(value = "绑定推广关系(登录状态)") +// @RequestMapping(value = "/user/bindSpread", method = RequestMethod.GET) +// public CommonResult bindsSpread(Integer spreadPid) { +// userService.bindSpread(spreadPid); +// return CommonResult.success(); +// } } diff --git a/food-front/src/main/java/com/zbkj/front/controller/UserRechargeController.java b/food-front/src/main/java/com/zbkj/front/controller/UserRechargeController.java index f14ab00..e0333ca 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/UserRechargeController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/UserRechargeController.java @@ -1,93 +1,93 @@ -package com.zbkj.front.controller; - -import com.zbkj.common.constants.Constants; -import com.zbkj.common.page.CommonPage; -import com.zbkj.common.request.PageParamRequest; -import com.zbkj.common.request.UserRechargeRequest; -import com.zbkj.common.response.CommonResult; -import com.zbkj.common.response.OrderPayResultResponse; -import com.zbkj.common.response.UserRechargeBillRecordResponse; -import com.zbkj.common.response.UserRechargeFrontResponse; -import com.zbkj.common.utils.CrmebUtil; -import com.zbkj.front.service.UserCenterService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; - -/** - * 用户 -- 充值 - - */ -@Slf4j -@RestController("UserRechargeController") -@RequestMapping("api/front/recharge") -@Api(tags = "用户 -- 充值") -public class UserRechargeController { - @Autowired - private UserCenterService userCenterService; - - /** - * 充值额度选择 - */ - @ApiOperation(value = "充值额度选择") - @RequestMapping(value = "/index", method = RequestMethod.GET) - public CommonResult getRechargeConfig() { - return CommonResult.success(userCenterService.getRechargeConfig()); - } - - /** - * 小程序充值 - */ - @ApiOperation(value = "小程序充值") - @RequestMapping(value = "/routine", method = RequestMethod.POST) - public CommonResult> routineRecharge(HttpServletRequest httpServletRequest, @RequestBody @Validated UserRechargeRequest request) { - request.setFromType(Constants.PAY_TYPE_WE_CHAT_FROM_PROGRAM); - request.setClientIp(CrmebUtil.getClientIp(httpServletRequest)); - OrderPayResultResponse recharge = userCenterService.recharge(request); - Map map = new HashMap<>(); - map.put("data", recharge); - map.put("type", request.getFromType()); - return CommonResult.success(map); - } - - /** - * 公众号充值 - */ - @ApiOperation(value = "公众号充值") - @RequestMapping(value = "/wechat", method = RequestMethod.POST) - public CommonResult weChatRecharge(HttpServletRequest httpServletRequest, @RequestBody @Validated UserRechargeRequest request) { - request.setClientIp(CrmebUtil.getClientIp(httpServletRequest)); - return CommonResult.success(userCenterService.recharge(request)); - } - - /** - * 佣金转入余额 - */ - @ApiOperation(value = "佣金转入余额") - @RequestMapping(value = "/transferIn", method = RequestMethod.POST) - public CommonResult transferIn(@RequestParam(name = "price") BigDecimal price) { - return CommonResult.success(userCenterService.transferIn(price)); - } - - /** - * 用户账单记录 - */ - @ApiOperation(value = "用户账单记录") - @RequestMapping(value = "/bill/record", method = RequestMethod.GET) - @ApiImplicitParam(name = "type", value = "记录类型:all-全部,expenditure-支出,income-收入", required = true) - public CommonResult> billRecord(@RequestParam(name = "type") String type, @ModelAttribute PageParamRequest pageRequest) { - return CommonResult.success(userCenterService.nowMoneyBillRecord(type, pageRequest)); - } -} - - - +//package com.zbkj.front.controller; +// +//import com.zbkj.common.constants.Constants; +//import com.zbkj.common.page.CommonPage; +//import com.zbkj.common.request.PageParamRequest; +//import com.zbkj.common.request.UserRechargeRequest; +//import com.zbkj.common.response.CommonResult; +//import com.zbkj.common.response.OrderPayResultResponse; +//import com.zbkj.common.response.UserRechargeBillRecordResponse; +//import com.zbkj.common.response.UserRechargeFrontResponse; +//import com.zbkj.common.utils.CrmebUtil; +//import com.zbkj.front.service.UserCenterService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiImplicitParam; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +//import javax.servlet.http.HttpServletRequest; +//import java.math.BigDecimal; +//import java.util.HashMap; +//import java.util.Map; +// +///** +// * 用户 -- 充值 +// +// */ +//@Slf4j +//@RestController("UserRechargeController") +//@RequestMapping("api/front/recharge") +//@Api(tags = "用户 -- 充值") +//public class UserRechargeController { +// @Autowired +// private UserCenterService userCenterService; +// +// /** +// * 充值额度选择 +// */ +// @ApiOperation(value = "充值额度选择") +// @RequestMapping(value = "/index", method = RequestMethod.GET) +// public CommonResult getRechargeConfig() { +// return CommonResult.success(userCenterService.getRechargeConfig()); +// } +// +// /** +// * 小程序充值 +// */ +// @ApiOperation(value = "小程序充值") +// @RequestMapping(value = "/routine", method = RequestMethod.POST) +// public CommonResult> routineRecharge(HttpServletRequest httpServletRequest, @RequestBody @Validated UserRechargeRequest request) { +// request.setFromType(Constants.PAY_TYPE_WE_CHAT_FROM_PROGRAM); +// request.setClientIp(CrmebUtil.getClientIp(httpServletRequest)); +// OrderPayResultResponse recharge = userCenterService.recharge(request); +// Map map = new HashMap<>(); +// map.put("data", recharge); +// map.put("type", request.getFromType()); +// return CommonResult.success(map); +// } +// +// /** +// * 公众号充值 +// */ +// @ApiOperation(value = "公众号充值") +// @RequestMapping(value = "/wechat", method = RequestMethod.POST) +// public CommonResult weChatRecharge(HttpServletRequest httpServletRequest, @RequestBody @Validated UserRechargeRequest request) { +// request.setClientIp(CrmebUtil.getClientIp(httpServletRequest)); +// return CommonResult.success(userCenterService.recharge(request)); +// } +// +// /** +// * 佣金转入余额 +// */ +// @ApiOperation(value = "佣金转入余额") +// @RequestMapping(value = "/transferIn", method = RequestMethod.POST) +// public CommonResult transferIn(@RequestParam(name = "price") BigDecimal price) { +// return CommonResult.success(userCenterService.transferIn(price)); +// } +// +// /** +// * 用户账单记录 +// */ +// @ApiOperation(value = "用户账单记录") +// @RequestMapping(value = "/bill/record", method = RequestMethod.GET) +// @ApiImplicitParam(name = "type", value = "记录类型:all-全部,expenditure-支出,income-收入", required = true) +// public CommonResult> billRecord(@RequestParam(name = "type") String type, @ModelAttribute PageParamRequest pageRequest) { +// return CommonResult.success(userCenterService.nowMoneyBillRecord(type, pageRequest)); +// } +//} +// +// +// diff --git a/food-front/src/main/java/com/zbkj/front/controller/UserSignController.java b/food-front/src/main/java/com/zbkj/front/controller/UserSignController.java index 9476d1f..9ebc49d 100644 --- a/food-front/src/main/java/com/zbkj/front/controller/UserSignController.java +++ b/food-front/src/main/java/com/zbkj/front/controller/UserSignController.java @@ -1,97 +1,97 @@ -package com.zbkj.front.controller; - -import com.zbkj.common.page.CommonPage; -import com.zbkj.common.response.CommonResult; -import com.zbkj.common.request.PageParamRequest; -import com.zbkj.common.response.UserSignInfoResponse; -import com.zbkj.common.vo.SystemGroupDataSignConfigVo; -import com.zbkj.common.vo.UserSignMonthVo; -import com.zbkj.common.vo.UserSignVo; -import com.zbkj.service.service.UserSignService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import java.util.HashMap; -import java.util.List; - - -/** - * 签到记录表 前端控制器 - - */ -@Slf4j -@RestController -@RequestMapping("api/front/user/sign") -@Api(tags = "用户 -- 签到") -public class UserSignController { - - @Autowired - private UserSignService userSignService; - - /** - * 签到列表 - * @param pageParamRequest 分页参数 - */ - @ApiOperation(value = "分页列表") - @RequestMapping(value = "/list", method = RequestMethod.GET) - public CommonResult> getList(@Validated PageParamRequest pageParamRequest) { - CommonPage userSignCommonPage = CommonPage.restPage(userSignService.getList(pageParamRequest)); - return CommonResult.success(userSignCommonPage); - } - - /** - * 签到列表,年月纬度 - * @param pageParamRequest 分页参数 - */ - @ApiOperation(value = "分页列表") - @RequestMapping(value = "/month", method = RequestMethod.GET) - public CommonResult> getListGroupMonth(@Validated PageParamRequest pageParamRequest) { - CommonPage userSignCommonPage = CommonPage.restPage(userSignService.getListGroupMonth(pageParamRequest)); - return CommonResult.success(userSignCommonPage); - } - - /** - * 配置 - */ - @ApiOperation(value = "配置") - @RequestMapping(value = "/config", method = RequestMethod.GET) - public CommonResult> config() { - return CommonResult.success(userSignService.getSignConfig()); - } - - /** - * 签到 - */ - @ApiOperation(value = "签到") - @RequestMapping(value = "/integral", method = RequestMethod.GET) - public CommonResult info() { - return CommonResult.success(userSignService.sign()); - } - - /** - * 今日记录详情 - */ - @ApiOperation(value = "今日记录详情") - @RequestMapping(value = "/get", method = RequestMethod.GET) - public CommonResult> get() { - return CommonResult.success(userSignService.get()); - } - - /** - * 签到用户信息 - */ - @ApiOperation(value = "签到用户信息") - @RequestMapping(value = "/user", method = RequestMethod.POST) - public CommonResult getUserInfo() { - return CommonResult.success(userSignService.getUserSignInfo()); - } -} - - - +//package com.zbkj.front.controller; +// +//import com.zbkj.common.page.CommonPage; +//import com.zbkj.common.response.CommonResult; +//import com.zbkj.common.request.PageParamRequest; +//import com.zbkj.common.response.UserSignInfoResponse; +//import com.zbkj.common.vo.SystemGroupDataSignConfigVo; +//import com.zbkj.common.vo.UserSignMonthVo; +//import com.zbkj.common.vo.UserSignVo; +//import com.zbkj.service.service.UserSignService; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RequestMethod; +//import org.springframework.web.bind.annotation.RestController; +// +//import java.util.HashMap; +//import java.util.List; +// +// +///** +// * 签到记录表 前端控制器 +// +// */ +//@Slf4j +//@RestController +//@RequestMapping("api/front/user/sign") +//@Api(tags = "用户 -- 签到") +//public class UserSignController { +// +// @Autowired +// private UserSignService userSignService; +// +// /** +// * 签到列表 +// * @param pageParamRequest 分页参数 +// */ +// @ApiOperation(value = "分页列表") +// @RequestMapping(value = "/list", method = RequestMethod.GET) +// public CommonResult> getList(@Validated PageParamRequest pageParamRequest) { +// CommonPage userSignCommonPage = CommonPage.restPage(userSignService.getList(pageParamRequest)); +// return CommonResult.success(userSignCommonPage); +// } +// +// /** +// * 签到列表,年月纬度 +// * @param pageParamRequest 分页参数 +// */ +// @ApiOperation(value = "分页列表") +// @RequestMapping(value = "/month", method = RequestMethod.GET) +// public CommonResult> getListGroupMonth(@Validated PageParamRequest pageParamRequest) { +// CommonPage userSignCommonPage = CommonPage.restPage(userSignService.getListGroupMonth(pageParamRequest)); +// return CommonResult.success(userSignCommonPage); +// } +// +// /** +// * 配置 +// */ +// @ApiOperation(value = "配置") +// @RequestMapping(value = "/config", method = RequestMethod.GET) +// public CommonResult> config() { +// return CommonResult.success(userSignService.getSignConfig()); +// } +// +// /** +// * 签到 +// */ +// @ApiOperation(value = "签到") +// @RequestMapping(value = "/integral", method = RequestMethod.GET) +// public CommonResult info() { +// return CommonResult.success(userSignService.sign()); +// } +// +// /** +// * 今日记录详情 +// */ +// @ApiOperation(value = "今日记录详情") +// @RequestMapping(value = "/get", method = RequestMethod.GET) +// public CommonResult> get() { +// return CommonResult.success(userSignService.get()); +// } +// +// /** +// * 签到用户信息 +// */ +// @ApiOperation(value = "签到用户信息") +// @RequestMapping(value = "/user", method = RequestMethod.POST) +// public CommonResult getUserInfo() { +// return CommonResult.success(userSignService.getUserSignInfo()); +// } +//} +// +// +// diff --git a/food-service/src/main/java/com/zbkj/service/service/impl/EbHomeServiceImpl.java b/food-service/src/main/java/com/zbkj/service/service/impl/EbHomeServiceImpl.java index 5dcc78e..fabdc58 100644 --- a/food-service/src/main/java/com/zbkj/service/service/impl/EbHomeServiceImpl.java +++ b/food-service/src/main/java/com/zbkj/service/service/impl/EbHomeServiceImpl.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.zbkj.common.model.article.Article; import com.zbkj.common.model.cat.StoreCart; import com.zbkj.common.model.home.Home; @@ -50,8 +52,8 @@ public class EbHomeServiceImpl extends ServiceImpl implements EbH qHomePro.eq(HomeProducts::getHomeId, home.getId()); qHomePro.eq(HomeProducts::getDelFlag, 1); qHomePro.orderByDesc(HomeProducts::getOrderNo); - List hpList = homeProductsDao.selectList(qHomePro); - home.setHpList(hpList); + List products = homeProductsDao.selectList(qHomePro); + home.setProducts(products); } value = JSONObject.toJSONString(hList); redisUtil.set(key, value); @@ -69,15 +71,14 @@ public class EbHomeServiceImpl extends ServiceImpl implements EbH public CommonPage selectPageSetMealFloor(SetMealFloorRequest entity, PageParamRequest page) { List list = dao.selectPageSetMealFloor(entity, page); for (SetMealFloorResponse res : list) { - Integer hId = res.getId(); + // 默认展示6个 PageParamRequest pPage = new PageParamRequest(); pPage.setPage(1); pPage.setLimit(6); - HomeProducts qHp = new HomeProducts(); - qHp.setHomeId(hId); + qHp.setHomeId(res.getHomeId()); List pList = homeProductsDao.selectPageFloorProduct(qHp, pPage); - res.setObj(CommonPage.restPage(pList)); + res.setHomeProducts(CommonPage.restPage(pList)); } return CommonPage.restPage(list); }