| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.LoginShopRequired; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.dto.ShopApplyDTO; |
| | | import com.doumee.dao.dto.ShopDetailQueryDTO; |
| | | import com.doumee.dao.dto.ShopInfoMaintainDTO; |
| | | import com.doumee.dao.dto.ShopNearbyDTO; |
| | | import com.doumee.dao.vo.ShopDetailVO; |
| | | import com.doumee.dao.vo.ShopCenterVO; |
| | | import com.doumee.dao.vo.ShopNearbyVO; |
| | | import com.doumee.dao.vo.ShopWebDetailVO; |
| | | import com.doumee.dao.vo.PayResponse; |
| | | import com.doumee.service.business.OrdersService; |
| | | import com.doumee.service.business.ShopInfoService; |
| | | 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.validation.annotation.Validated; |
| | |
| | | @Autowired |
| | | private ShopInfoService shopInfoService; |
| | | |
| | | @Autowired |
| | | private OrdersService ordersService; |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("门店入驻申请/修改") |
| | | @PostMapping("/apply") |
| | |
| | | return ApiResponse.success(shopInfoService.getMyShop(this.getMemberId())); |
| | | } |
| | | |
| | | @ApiOperation("附近门店分页列表") |
| | | @PostMapping("/nearby") |
| | | public ApiResponse<PageData<ShopNearbyVO>> nearby(@RequestBody @Validated PageWrap<ShopNearbyDTO> pageWrap) { |
| | | return ApiResponse.success(shopInfoService.findNearbyShops(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("门店详情") |
| | | @PostMapping("/detail") |
| | | public ApiResponse<ShopWebDetailVO> detail(@RequestBody @Validated ShopDetailQueryDTO dto) { |
| | | return ApiResponse.success(shopInfoService.getShopWebDetail(dto)); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("获取门店登录后信息") |
| | | @GetMapping("/getShopInfo") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "门店token值", required = true) |
| | | }) |
| | | public ApiResponse<ShopCenterVO> getShopInfo() { |
| | | return ApiResponse.success("查询成功", shopInfoService.getShopCenterInfo(getShopId())); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("维护门店信息(支付押金后)") |
| | | @PostMapping("/maintain") |
| | | public ApiResponse maintain(@RequestBody ShopInfoMaintainDTO dto) { |
| | | shopInfoService.maintainShopInfo(this.getMemberId(), dto); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("查询门店维护信息") |
| | | @PostMapping("/maintainInfo") |
| | | public ApiResponse<ShopInfoMaintainDTO> maintainInfo() { |
| | | return ApiResponse.success(shopInfoService.getShopMaintainInfo(this.getMemberId())); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("门店支付押金") |
| | | @PostMapping("/payDeposit") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "门店token值", required = true) |
| | | }) |
| | | public ApiResponse<PayResponse> payDeposit() { |
| | | return ApiResponse.success("操作成功", ordersService.payShopDeposit(getShopId())); |
| | | } |
| | | |
| | | } |