浏览代码

Merge branch 'master' of http://8.152.195.41:3000/alien/alien_cloud

wxd 1 月之前
父节点
当前提交
4b7fc1c4a0

+ 28 - 0
alien-gateway/pom.xml

@@ -36,6 +36,17 @@
             <artifactId>spring-cloud-starter-gateway</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-databind</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
         <!--loadBalancer负载均衡-->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
@@ -136,6 +147,23 @@
             <version>3.4.0</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!--redis连接池需要此依赖-->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+
+
 <!--        <dependency>-->
 <!--            <groupId>shop.alien</groupId>-->
 <!--            <artifactId>alien-util</artifactId>-->

+ 1 - 0
alien-gateway/src/main/java/shop/alien/gateway/config/BaseRedisService.java

@@ -1,6 +1,7 @@
 package shop.alien.gateway.config;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.geo.*;
 import org.springframework.data.redis.connection.RedisGeoCommands;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Component;

+ 1 - 1
alien-gateway/src/main/java/shop/alien/gateway/config/JWTInterceptor.java

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.cors.CorsUtils;
 import org.springframework.web.servlet.HandlerInterceptor;
 import shop.alien.entity.store.StoreUser;
-import shop.alien.store.mapper.StoreUserMapper;
+import shop.alien.gateway.mapper.StoreUserMapper;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

+ 28 - 0
alien-gateway/src/main/java/shop/alien/gateway/entity/dto/NearMeDto.java

@@ -0,0 +1,28 @@
+package shop.alien.gateway.entity.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * 二期-门店信息
+ *
+ * @author ssk
+ * @since 2024-12-05
+ */
+@Data
+@AllArgsConstructor
+@JsonInclude
+@ApiModel(value = "NearMeDto对象", description = "我附近的商家")
+public class NearMeDto {
+
+    @ApiModelProperty(value = "内容")
+    private String conent;
+
+    @ApiModelProperty(value = "距离/km")
+    private Double distance;
+
+
+}

+ 1 - 1
alien-gateway/src/main/java/shop/alien/gateway/mapper/LifeFansMapper.java

@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import shop.alien.entity.store.LifeFans;
-import shop.alien.store.entity.vo.LifeFansVo;
+import shop.alien.gateway.entity.vo.LifeFansVo;
 
 import java.util.List;
 

+ 2 - 2
alien-gateway/src/main/java/shop/alien/gateway/mapper/LifeMessageMapper.java

@@ -9,8 +9,8 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 import shop.alien.entity.store.LifeMessage;
-import shop.alien.store.entity.vo.LifeFansVo;
-import shop.alien.store.entity.vo.LifeMessageVo;
+import shop.alien.gateway.entity.vo.LifeFansVo;
+import shop.alien.gateway.entity.vo.LifeMessageVo;
 
 import java.util.List;
 

+ 2 - 2
alien-gateway/src/main/java/shop/alien/gateway/util/FunctionMagic.java

@@ -10,8 +10,8 @@ import org.springframework.data.redis.connection.RedisGeoCommands;
 import org.springframework.util.CollectionUtils;
 import shop.alien.entity.store.LifeUser;
 import shop.alien.entity.store.StoreUser;
-import shop.alien.store.entity.dto.NearMeDto;
-import shop.alien.store.util.constant.Constant;
+import shop.alien.gateway.entity.dto.NearMeDto;
+import shop.alien.gateway.util.constant.Constant;
 
 import java.util.*;
 import java.util.function.*;

+ 39 - 0
alien-gateway/src/main/java/shop/alien/gateway/util/constant/Constant.java

@@ -0,0 +1,39 @@
+package shop.alien.gateway.util.constant;
+
+/**
+ * 常量
+ */
+public class Constant {
+
+    // 主键
+    public static final String GEO_STORE_PRIMARY = "GEO_STORE_PRIMARY";
+
+    // name
+    public static final String GEO_STORE_NAME = "GEO_STORE_NAME";
+
+    public static final Integer LIMIT_COUNT = 100;
+
+
+    // 举报用户类型(1:商户,2:用户)
+    public static final String REPORTING_USER_TYPE = "reporting_user_type";
+
+    // 举报用户ID
+    public static final String REPORTING_USER_ID = "reporting_user_id";
+
+
+    public static final String PROCESSING_STATUS = "processing_status";
+
+    // 序列
+    public static final String SEQUENCE_1 = "1";
+    public static final String SEQUENCE_2 = "2";
+
+
+    // 序列
+    public static final Integer SEQUENCE_NUM_1 = 1;
+    public static final Integer SEQUENCE_NUM_2 = 2;
+
+    // 符号
+    public static final String SYMBOL_1  = ",";
+
+
+}

+ 82 - 0
alien-gateway/src/main/java/shop/alien/gateway/util/constant/DiscountCouponEnum.java

@@ -0,0 +1,82 @@
+package shop.alien.gateway.util.constant;
+
+/**
+ * 优惠券相关功能枚举
+ * */
+public enum DiscountCouponEnum {
+    /**用户优惠券状态*/
+    //待使用
+    WAITING_USED("0"),
+    //已使用
+    HAVE_BEEN_USED("1"),
+    //已作废
+    HAVE_BEEN_VOIDED("2"),
+
+    /**商家优惠券状态*/
+    //进行中
+    UNDER_WAY("0"),
+    //已结束
+    FINISHED("1"),
+    //未开始
+    HAVE_NOT_STARTED("2"),
+    //暂停领取
+    SUSPEND_GET("3"),
+    //已售罄
+    HAVE_SOLD_OUT("4"),
+
+    /**限制使用规则*/
+    //周规则限制
+    WEEKDAY_UNAVAILABLE("weekday_unavailable"),
+    //节日规则限制
+    HOLIDAY_UNAVAILABLE("holiday_unavailable"),
+
+    /**领取规则*/
+    CLAIM_RULE("claim_rule"),
+    //每日一领
+    DAY("day"),
+    //每周一领
+    WEEK("WEEK"),
+    //每月一领
+    MONTH("MONTH"),
+    //每年一领
+    YEAR("year"),
+
+    /**条件类型*/
+    //所有
+    ALL("0"),
+    //即将过期
+    BE_ABOUT_TO_EXPORE("1"),
+    //已使用
+    HAVE_ALREADY_APPLIED("2"),
+    //已过期
+    HAVE_EXPIRED("3"),
+
+    /**优惠券领取规则*/
+    //可以领取
+    CAN_GET("1"),
+    //不可以领取
+    NO_GET("0"),
+
+    //占位最后一位
+    KEY("VALUE");
+
+    // 属性值
+    private final String description;
+    // 构造方法,用于初始化描述信息
+    DiscountCouponEnum(String description) {
+        this.description = description;
+    }
+    // 获取Value的方法
+    public String getValue() {
+        return description;
+    }
+
+// 测试带属性和方法的枚举的使用
+    public static void main(String[] args) {
+        DiscountCouponEnum discountCouponEnum = DiscountCouponEnum.WAITING_USED;
+        System.out.println("用户优惠券状态:" + discountCouponEnum);
+        System.out.println("值是:" + discountCouponEnum.getValue());
+    }
+
+}
+