| | |
| | | package com.oying.modules.pc.store.domain.dto; |
| | | |
| | | import com.oying.utils.StringUtils; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | @ApiModelProperty(value = "商户ID", example = "1") |
| | | private Long merchantId; |
| | | |
| | | private Long storeId; |
| | | |
| | | private Long platformCategoryId; |
| | | |
| | | private String storeName; |
| | | |
| | | private Integer status; |
| | | |
| | | private Long storeId; |
| | | |
| | | private Long platformCategoryId; |
| | | private Integer businessStatus; |
| | | |
| | | private String blurry; |
| | | |
| | |
| | | |
| | | private Double latitude; // 中心点纬度 |
| | | |
| | | private Integer radius = 10000; // 搜索半径(米) |
| | | private Integer radius = 50000000; // 搜索半径(米) |
| | | |
| | | private Integer limit = 20; // 返回数量限制 |
| | | |
| | |
| | | |
| | | public String buildConditionCacheKey() { |
| | | StringJoiner baseKeyJoiner = new StringJoiner("|"); |
| | | if (platformCategoryId != null) { |
| | | baseKeyJoiner.add("platformCategoryId=" + platformCategoryId); |
| | | } |
| | | if (StringUtils.isNotEmpty(blurry)) { |
| | | baseKeyJoiner.add("blurry=" + blurry); |
| | | } |
| | | if (longitude != null && latitude != null) { |
| | | baseKeyJoiner.add("longitude=" + longitude); |
| | | baseKeyJoiner.add("latitude=" + latitude); |
| | | } |
| | | if (StringUtils.isNotEmpty(blurry)) { |
| | | baseKeyJoiner.add("radius=" + radius); |
| | | } |
| | | baseKeyJoiner.add("merchantId=" + merchantId); |
| | | baseKeyJoiner.add("storeId=" + storeId); |
| | | baseKeyJoiner.add("platformCategoryId=" + platformCategoryId); |
| | | baseKeyJoiner.add("storeName=" + storeName); |
| | | baseKeyJoiner.add("status=" + status); |
| | | baseKeyJoiner.add("businessStatus=" + businessStatus); |
| | | baseKeyJoiner.add("blurry=" + blurry); |
| | | baseKeyJoiner.add("longitude=" + longitude); |
| | | baseKeyJoiner.add("latitude=" + latitude); |
| | | baseKeyJoiner.add("radius=" + radius); |
| | | // 使用MD5或SHA缩短键长度 |
| | | return "store:search:page:" + DigestUtils.md5DigestAsHex(baseKeyJoiner.toString().getBytes()); |
| | | } |