rk
2 天以前 79aebca90280ae4d4b25ed6ba6267128cdb61d3a
server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
@@ -2,6 +2,8 @@
import com.doumee.core.annotation.LoginRequired;
import com.doumee.core.annotation.LoginShopRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.config.jwt.JwtTokenUtil;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
@@ -31,7 +33,7 @@
 * @author rk
 * @date 2026/04/10
 */
@Api(tags = "门店入驻")
@Api(tags = "门店业务接口")
@RestController
@RequestMapping("/web/shopInfo")
public class ShopInfoApi extends ApiController {
@@ -58,6 +60,7 @@
        return ApiResponse.success(shopInfoService.getMyShop(this.getMemberId()));
    }
    @ApiOperation("附近门店分页列表")
    @PostMapping("/nearby")
    public ApiResponse<PageData<ShopNearbyVO>> nearby(@RequestBody @Validated PageWrap<ShopNearbyDTO> pageWrap) {
@@ -81,6 +84,16 @@
    }
    @LoginShopRequired
    @ApiOperation("门店端查询门店详情")
    @GetMapping("/shopDetail")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "门店token值", required = true)
    })
    public ApiResponse<ShopDetailVO> shopDetail() {
        return ApiResponse.success("查询成功", shopInfoService.getShopDetail(getShopId()));
    }
    @LoginShopRequired
    @ApiOperation("门店销售统计")
    @GetMapping("/salesStats")
    @ApiImplicitParams({
@@ -95,7 +108,7 @@
    @ApiOperation("维护门店信息(支付押金后)")
    @PostMapping("/maintain")
    public ApiResponse maintain(@RequestBody ShopInfoMaintainDTO dto) {
        shopInfoService.maintainShopInfo(this.getMemberId(), dto);
        shopInfoService.maintainShopInfo(this.getShopId(), dto);
        return ApiResponse.success("操作成功");
    }
@@ -103,7 +116,7 @@
    @ApiOperation("查询门店维护信息")
    @PostMapping("/maintainInfo")
    public ApiResponse<ShopInfoMaintainDTO> maintainInfo() {
        return ApiResponse.success(shopInfoService.getShopMaintainInfo(this.getMemberId()));
        return ApiResponse.success(shopInfoService.getShopMaintainInfo(this.getShopId()));
    }
    @LoginRequired
@@ -116,4 +129,17 @@
        return ApiResponse.success("操作成功", ordersService.payShopDeposit(getMemberId()));
    }
    @LoginShopRequired
    @Trace
    @ApiOperation(value = "门店修改密码", notes = "新密码必须同时包含字母和数字,修改成功后需重新登录")
    @PostMapping("/changePassword")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "门店token值", required = true),
    })
    public ApiResponse changePassword(@RequestParam String newPassword) {
        String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY);
        shopInfoService.changePassword(this.getShopId(), newPassword, token);
        return ApiResponse.success("密码修改成功,请重新登录");
    }
}