From 824edc826c92312c150a2f0eea9bdd2bfcb82b2f Mon Sep 17 00:00:00 2001
From: gongzuming <gongzuming>
Date: 星期四, 29 八月 2024 14:28:37 +0800
Subject: [PATCH] 冲突

---
 src/main/java/com/mzl/flower/web/point/CustomerPointController.java |   72 ++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/mzl/flower/web/point/CustomerPointController.java b/src/main/java/com/mzl/flower/web/point/CustomerPointController.java
index 3664ad8..342d05d 100644
--- a/src/main/java/com/mzl/flower/web/point/CustomerPointController.java
+++ b/src/main/java/com/mzl/flower/web/point/CustomerPointController.java
@@ -1,16 +1,82 @@
 package com.mzl.flower.web.point;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.mzl.flower.base.BaseController;
+import com.mzl.flower.base.R;
+import com.mzl.flower.base.ReturnDataDTO;
+import com.mzl.flower.config.security.SecurityUtils;
+import com.mzl.flower.dto.request.point.ChangePointDTO;
+import com.mzl.flower.dto.request.point.QueryCustomerPointDTO;
+import com.mzl.flower.dto.request.point.QueryPointDetailDTO;
+import com.mzl.flower.dto.request.supplier.UpdateSupplierDTO;
+import com.mzl.flower.dto.response.content.AdvertisementDTO;
+import com.mzl.flower.dto.response.point.CustomerPointDTO;
+import com.mzl.flower.dto.response.point.CustomerPointDetailDTO;
+import com.mzl.flower.service.point.CustomerPointService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.ValidationException;
+import javax.validation.constraints.NotNull;
+import java.util.List;
 
 @RestController
 @RequestMapping("/api/customer/point")
 @Api(value = "会员积分", tags = "会员积分")
 @Validated
 @Slf4j
-public class CustomerPointController {
+public class CustomerPointController extends BaseController {
+
+
+    private final CustomerPointService customerPointService;
+
+    public CustomerPointController(CustomerPointService customerPointService) {
+        this.customerPointService = customerPointService;
+    }
+
+
+    @GetMapping("/page/list")
+    @ApiOperation(value = "管理端-积分详细记录列表", notes = "管理端-商户积分详细记录列表")
+    public ResponseEntity<ReturnDataDTO<Page<CustomerPointDetailDTO>>> queryCustomerDetails(QueryPointDetailDTO dto, Page page) {
+        if(dto.getCustomerId() == null || dto.getCustomerId() == 0){
+            throw new ValidationException("商户ID不能为空");
+        }
+        return returnData(R.SUCCESS.getCode(),customerPointService.queryCustomerDetails(dto, page));
+    }
+
+
+    @GetMapping("/page")
+    @ApiOperation(value = "管理端-积分查询", notes = "用户端-积分查询")
+    public ResponseEntity<ReturnDataDTO<Page<CustomerPointDTO>>> queryPage(QueryCustomerPointDTO dto, Page page)  {
+        return returnData(R.SUCCESS.getCode(), customerPointService.queryPage(dto, page));
+    }
+
+    @PostMapping("/giveaway")
+    @ApiOperation(value = "管理端-积分赠送", notes = "管理端-积分赠送")
+    public ResponseEntity<ReturnDataDTO> giveawayPoint(@Validated @RequestBody ChangePointDTO dto) {
+        customerPointService.giveawayPoint(dto);
+        return returnData(R.SUCCESS.getCode(),null);
+    }
+
+    @PostMapping("/deduction")
+    @ApiOperation(value = "管理端-积分扣除", notes = "管理端-积分扣除")
+    public ResponseEntity<ReturnDataDTO> deductionPoint(@Validated @RequestBody ChangePointDTO dto) {
+        customerPointService.deductionPoint(dto);
+        return returnData(R.SUCCESS.getCode(),null);
+    }
+
+
+
+    @GetMapping("/list")
+    @ApiOperation(value = "用户端-积分列表(花店积分列表)", notes = "管理端-积分列表(花店积分列表)")
+    public ResponseEntity<ReturnDataDTO<Page<CustomerPointDetailDTO>>> myPointDetails(QueryPointDetailDTO dto, Page page) {
+        dto.setUserId(SecurityUtils.getUserId());
+        return returnData(R.SUCCESS.getCode(),customerPointService.queryCustomerDetails(dto, page));
+    }
+
 }

--
Gitblit v1.9.3