From 59b1f0e9967902aa10f5e017d5a0bdfd1b60c9ea Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 29 四月 2026 09:42:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 47 insertions(+), 7 deletions(-)
diff --git a/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java b/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
index 60b5eee..6087e89 100644
--- a/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
@@ -2,10 +2,13 @@
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;
import com.doumee.dao.business.model.Member;
+import com.doumee.dao.dto.ChangePasswordDTO;
import com.doumee.dao.dto.ShopApplyDTO;
import com.doumee.dao.dto.ShopDetailQueryDTO;
import com.doumee.dao.dto.ShopInfoMaintainDTO;
@@ -13,6 +16,7 @@
import com.doumee.dao.vo.ShopDetailVO;
import com.doumee.dao.vo.ShopCenterVO;
import com.doumee.dao.vo.ShopNearbyVO;
+import com.doumee.dao.vo.ShopSalesStatsVO;
import com.doumee.dao.vo.ShopWebDetailVO;
import com.doumee.dao.vo.PayResponse;
import com.doumee.service.business.OrdersService;
@@ -22,6 +26,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import javax.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -30,7 +35,7 @@
* @author rk
* @date 2026/04/10
*/
-@Api(tags = "闂ㄥ簵鍏ラ┗")
+@Api(tags = "闂ㄥ簵涓氬姟鎺ュ彛")
@RestController
@RequestMapping("/web/shopInfo")
public class ShopInfoApi extends ApiController {
@@ -45,8 +50,8 @@
@ApiOperation("闂ㄥ簵鍏ラ┗鐢宠/淇敼")
@PostMapping("/apply")
public ApiResponse apply(@RequestBody @Validated ShopApplyDTO request) {
- Member member = this.getMemberResponse();
- shopInfoService.applyShop(request, member);
+ request.setMemberId(getMemberId());
+ shopInfoService.applyShop(request);
return ApiResponse.success("鎿嶄綔鎴愬姛");
}
@@ -56,6 +61,7 @@
public ApiResponse<ShopDetailVO> myShop() {
return ApiResponse.success(shopInfoService.getMyShop(this.getMemberId()));
}
+
@ApiOperation("闄勮繎闂ㄥ簵鍒嗛〉鍒楄〃")
@PostMapping("/nearby")
@@ -80,10 +86,31 @@
}
@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({
+ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "闂ㄥ簵token鍊�", required = true),
+ @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "period", value = "缁熻鍛ㄦ湡锛�0=浠婃棩, 1=鏈湀, 2=涓婃湀", required = true)
+ })
+ public ApiResponse<ShopSalesStatsVO> salesStats(@RequestParam Integer period) {
+ return ApiResponse.success("鏌ヨ鎴愬姛", shopInfoService.getShopSalesStats(getShopId(), period));
+ }
+
+ @LoginShopRequired
@ApiOperation("缁存姢闂ㄥ簵淇℃伅锛堟敮浠樻娂閲戝悗锛�")
@PostMapping("/maintain")
public ApiResponse maintain(@RequestBody ShopInfoMaintainDTO dto) {
- shopInfoService.maintainShopInfo(this.getMemberId(), dto);
+ shopInfoService.maintainShopInfo(this.getShopId(), dto);
return ApiResponse.success("鎿嶄綔鎴愬姛");
}
@@ -91,17 +118,30 @@
@ApiOperation("鏌ヨ闂ㄥ簵缁存姢淇℃伅")
@PostMapping("/maintainInfo")
public ApiResponse<ShopInfoMaintainDTO> maintainInfo() {
- return ApiResponse.success(shopInfoService.getShopMaintainInfo(this.getMemberId()));
+ return ApiResponse.success(shopInfoService.getShopMaintainInfo(this.getShopId()));
}
- @LoginShopRequired
+ @LoginRequired
@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()));
+ 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(@RequestBody @Valid ChangePasswordDTO dto) {
+ String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY);
+ shopInfoService.changePassword(this.getShopId(), dto.getOldPassword(), dto.getNewPassword(), token);
+ return ApiResponse.success("瀵嗙爜淇敼鎴愬姛锛岃閲嶆柊鐧诲綍");
}
}
--
Gitblit v1.9.3