1.完善swagger配置配置信息
2.shop实体类添加字段:1.封面图 2.详情图
3.添加购物车实体类、mapper、service、controller
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主键") |
| | | @TableId(type = IdType.AUTO) |
| | | @TableId |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | |
| | | @TableField("end_time") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "封面图片") |
| | | @TableField("home_picture") |
| | | private String homePicture; |
| | | |
| | | @ApiModelProperty(value = "详情图,多个逗号分隔") |
| | | @TableField("details_picture") |
| | | private String detailsPicture; |
| | | |
| | | @ApiModelProperty(value = "店长姓名") |
| | | @TableField("shop_manager") |
| | | private String shopManager; |
New file |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_shopping_cart") |
| | | @ApiModel(value = "购物车对象", description = "") |
| | | public class ShoppingCart implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty("主键") |
| | | @TableId |
| | | private Long id; |
| | | @ApiModelProperty("用户id") |
| | | private Long appUserId; |
| | | @ApiModelProperty("商品id") |
| | | private Long goodsId; |
| | | @ApiModelProperty("数量") |
| | | private Integer number; |
| | | } |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Api("钱包") |
| | | @RestController |
| | |
| | | * 钱包详情 |
| | | */ |
| | | @GetMapping("detail") |
| | | @ApiOperation(value = "钱包详情", notes = "钱包详情") |
| | | @ApiOperation(value = "钱包详情", notes = "钱包详情", tags = {"小程序-个人中心-我的钱包-钱包详情"}) |
| | | public AjaxResult detail() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | // TODO 查询钱包详情 |
| | |
| | | /** |
| | | * 变更明细 |
| | | */ |
| | | @ApiOperation(value = "变更明细", notes = "变更明细") |
| | | @ApiOperation(value = "变更明细", notes = "变更明细", tags = {"小程序-个人中心-我的钱包-变更记录"}) |
| | | @GetMapping("change") |
| | | public AjaxResult change() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | import com.ruoyi.account.service.WithdrawalRequestsService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/withdrawal-requests") |
| | | @Api(tags = "提现申请") |
| | | public class WithdrawalRequestsController { |
| | | |
| | | @Resource |
| | |
| | | * 提现申请 |
| | | */ |
| | | @PostMapping("/withdrawalApply") |
| | | @ApiOperation(value = "提现申请", tags = {"提现申请-小程序"}) |
| | | public AjaxResult withdrawalApply(@RequestBody WithdrawalRequestsDTO params){ |
| | | withdrawalRequestsService.withdrawalApply(params); |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | |
| | | public interface BalanceChangeRecordService extends IService<BalanceChangeRecord> { |
| | | } |
| | |
| | | /** |
| | | * 扫码校验 |
| | | */ |
| | | @ApiOperation(value = "扫码校验", tags = {"订单核销"}) |
| | | @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理-扫码核销校验"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/check/{orderId}/{shopId}") |
| | | public AjaxResult check(@PathVariable("orderId") Integer orderId, @PathVariable("shopId") Integer shopId){ |
| | | return AjaxResult.success(orderService.check(orderId, shopId)); |
| | | return AjaxResult.ok(orderService.check(orderId, shopId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | private GoodsCategoryService goodsCategoryService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "商品分类列表") |
| | | @ApiOperation(value = "商品分类列表", tags = {"小程序-商城-商城-首页-筛选"}) |
| | | public AjaxResult list(){ |
| | | return AjaxResult.success(goodsCategoryService.list()); |
| | | } |
| | |
| | | * 商品列表 |
| | | */ |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "商品列表") |
| | | @ApiOperation(value = "商品列表", tags = {"小程序-商城-首页-热门商品列表"}) |
| | | public TableDataInfo goodsList(Goods goods){ |
| | | startPage(); |
| | | return getDataTable(goodsService.goodsList(goods)); |
| | |
| | | * 商品详情 |
| | | */ |
| | | @GetMapping("/goodsDetail/{goodsId}") |
| | | public AjaxResult goodsDetail(@PathVariable("goodsId") Integer goodsId){ |
| | | return success(goodsService.getById(goodsId)); |
| | | @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页-商品详情"}) |
| | | public AjaxResult goodsDetail(@PathVariable("goodsId") Long goodsId){ |
| | | return success(goodsService.goodsDetail(goodsId)); |
| | | } |
| | | |
| | | |
| | |
| | | * 秒杀活动列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "秒杀活动列表") |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页-秒杀活动列表"}) |
| | | public AjaxResult list(Goods goods) |
| | | { |
| | | startPage(); |
| | |
| | | * 秒杀活动详情 |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation(value = "秒杀活动详情") |
| | | @ApiOperation(value = "秒杀活动详情", tags = {"小程序-商城-首页-秒杀活动列表-秒杀活动详情"}) |
| | | public AjaxResult detail(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(seckillActivityInfoService.detail(id)); |
| | |
| | | /** |
| | | * 分享列表 |
| | | */ |
| | | @ApiOperation(value = "分享列表", tags = {"分享"}) |
| | | @ApiOperation(value = "分享列表", tags = {"小程序-个人中心-门店管理-分享列表"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "对象id(addType=1:平台添加,addType=2:推广人添加,addType=3:门店添加)", name = "objectId", required = true, dataType = "int"), |
| | | }) |
| | |
| | | /** |
| | | * 分享添加 |
| | | */ |
| | | @ApiOperation(value = "分享添加", tags = {"分享"}) |
| | | @ApiOperation(value = "小程序-个人中心-门店管理-分享添加", tags = {"分享添加-小程序"}) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody Share share){ |
| | | share.setAddType(ShareAddType.STORE.getCode()); |
| | |
| | | /** |
| | | * 分享删除 |
| | | */ |
| | | @ApiOperation(value = "分享删除", tags = {"分享"}) |
| | | @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理-分享删除-小程序"}) |
| | | @DeleteMapping |
| | | public AjaxResult delete(@RequestBody Share share){ |
| | | return toAjax(shareService.removeById(share)); |
| | |
| | | /** |
| | | * 分享编辑 |
| | | */ |
| | | @ApiOperation(value = "分享编辑", tags = {"分享"}) |
| | | @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理-分享编辑-小程序"}) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody Share share){ |
| | | share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | |
| | | /** |
| | | * 分享详情 |
| | | */ |
| | | @ApiOperation(value = "分享详情", tags = {"分享"}) |
| | | @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理-分享详情-小程序"}) |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable("id") Integer id){ |
| | | return AjaxResult.success(shareService.getById(id)); |
| | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | /** |
| | | * 附近门店列表 |
| | | */ |
| | | @GetMapping("/nearbyShopList") |
| | | @ApiOperation(value = "附近门店列表", tags = {"小程序-首页-附近门店列表"}) |
| | | public AjaxResult nearbyShopList(@ApiParam("经度") @RequestParam String longitude, |
| | | @ApiParam("纬度") @RequestParam String latitude){ |
| | | return success(shopService.nearbyShopList(longitude,latitude)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 指定门店技师列表 |
| | | */ |
| | | @GetMapping("/technicianList") |
| | | @ApiOperation(value = "技师列表", tags = {"技师"}) |
| | | @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) |
| | | public AjaxResult technicianList(@ApiParam("门店id") @RequestParam String shopId){ |
| | | return success(technicianService.list(new LambdaQueryWrapper<Technician>() |
| | | .eq(Technician::getShopId,shopId) |
| | |
| | | * 查询当前店长所属门店 |
| | | */ |
| | | @GetMapping("/shopByUser") |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"门店"}) |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页-关联门店列表"}) |
| | | public AjaxResult shopByUser(){ |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() |
| | | .eq(Shop::getAppUserId, SecurityUtils.getUserId()) |
| | |
| | | * 绑定门店 |
| | | */ |
| | | @GetMapping("/bindShop") |
| | | @ApiOperation(value = "绑定门店", tags = {"门店"}) |
| | | @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心-绑定门店"}) |
| | | public AjaxResult bindShop(@ApiParam("门店id") @RequestParam Long shopId){ |
| | | AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); |
| | | appUser.setShopId(shopId); |
New file |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @RequestMapping("/shopping-cart") |
| | | @Api(tags = "购物车") |
| | | public class ShoppingCartController { |
| | | } |
| | |
| | | * 预约列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "预约列表", notes = "预约列表") |
| | | @ApiOperation(value = "预约列表", notes = "预约列表", tags = {"小程序-个人中心-门店管理-预约列表"}) |
| | | public TableDataInfo list(@ApiParam(value = "状态") @RequestParam Integer status, |
| | | @ApiParam(value = "门店id") @RequestParam Long shopId){ |
| | | startPage(); |
| | |
| | | * 取消服务 |
| | | */ |
| | | @GetMapping("/cancel") |
| | | @ApiOperation(value = "取消服务", notes = "取消服务") |
| | | @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理-预约列表-取消服务"}) |
| | | public AjaxResult cancel(@ApiParam(value = "预约id") @RequestParam Long id){ |
| | | |
| | | TechnicianSubscribe subscribe = technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>() |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ShopMapper extends BaseMapper<Shop> { |
| | | |
| | | List<NearbyShopVO> selectNearbyShopList(String longitude, String latitude); |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.ShoppingCart; |
| | | |
| | | public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> { |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ShopService extends IService<Shop> { |
| | | |
| | | List<NearbyShopVO> nearbyShopList(String longitude, String latitude); |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.ShoppingCart; |
| | | |
| | | public interface ShoppingCartService extends IService<ShoppingCart> { |
| | | } |
| | |
| | | |
| | | @Override |
| | | public GoodsVO goodsDetail(Long goodsId) { |
| | | // TODO 根据会员等级展示价格 |
| | | Goods goods = this.getById(goodsId); |
| | | if (Objects.nonNull(goods)){ |
| | | GoodsVO goodsVO = new GoodsVO(); |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | return goodsVO; |
| | | } |
| | | return new GoodsVO(); |
| | | } |
| | |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService { |
| | | @Resource |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Override |
| | | public List<NearbyShopVO> nearbyShopList(String longitude, String latitude) { |
| | | return shopMapper.selectNearbyShopList(longitude,latitude); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.ShoppingCart; |
| | | import com.ruoyi.other.mapper.ShoppingCartMapper; |
| | | import com.ruoyi.other.service.ShoppingCartService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService { |
| | | } |
| | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "限购数量(-1不限购)") |
| | | private Integer purchaseLimit; |
| | | |
| | | @ApiModelProperty(value = "类型(1=服务商品,2=单品商品)") |
| | | private Integer type; |
| | | |
| | |
| | | @ApiModelProperty(value = "详情图,多个逗号分隔") |
| | | private String detailPicture; |
| | | |
| | | @ApiModelProperty(value = "积分支付(0=否,1=是)") |
| | | private Integer pointPayment; |
| | | |
| | | @ApiModelProperty(value = "基础积分") |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | |
| | | @ApiModelProperty(value = "划线价") |
| | | private BigDecimal originalPrice; |
| | | |
New file |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class NearbyShopVO { |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "封面图片") |
| | | private String homePicture; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "距离") |
| | | private String distance; |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.other.mapper.ShopMapper"> |
| | | |
| | | <select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO"> |
| | | |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.other.mapper.ShoppingCartMapper"> |
| | | |
| | | <select id="selectNearbyShopList" resultType="com.ruoyi.other.vo.NearbyShopVO"> |
| | | |
| | | </select> |
| | | </mapper> |