|
@@ -0,0 +1,41 @@
|
|
|
|
+package com.xynet.marketing.controller.merc;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.xynet.marketing.service.PromotionService;
|
|
|
|
+import com.xynet.marketing.utils.MercAuthUtils;
|
|
|
|
+import com.xynet.marketing.utils.R;
|
|
|
|
+import com.xynet.marketing.utils.collections.map.JHashMap;
|
|
|
|
+import com.xynet.marketing.utils.collections.map.JMap;
|
|
|
|
+import com.xynet.marketing.utils.redis.utils.RedisService;
|
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @author hechunping
|
|
|
|
+ * @date 2025/2/12
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("merc/promotion")
|
|
|
|
+@AllArgsConstructor
|
|
|
|
+@Slf4j
|
|
|
|
+public class PromotionController {
|
|
|
|
+
|
|
|
|
+ private PromotionService promotionService;
|
|
|
|
+ private RedisService redisService;
|
|
|
|
+
|
|
|
|
+ @PostMapping("page")
|
|
|
|
+ private R page(@RequestBody Map<String, Object> param, @RequestHeader Map<String, String> headers) {
|
|
|
|
+ //获取token
|
|
|
|
+ String token = headers.get("token");
|
|
|
|
+ String providerId = headers.get("provider_id");
|
|
|
|
+ Integer mercId = MercAuthUtils.getMercId(token, providerId);
|
|
|
|
+ JMap<String, Object> jParam = new JHashMap<>(param);
|
|
|
|
+ jParam.put("mercId", mercId);
|
|
|
|
+ Page<Map<String, Object>> data = promotionService.page(jParam);
|
|
|
|
+ return R.ok(data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|