统计数据导出
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.service.GeoService;
|
||||
import com.czg.exception.CzgException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class GeoServiceImpl implements GeoService {
|
||||
param.put("key", "7a7f2e4790ea222660a027352ee3af39");
|
||||
param.put("keywords", keywords);
|
||||
param.put("subdistrict", "1");
|
||||
if (StringUtils.isNotBlank(subdistrict)) {
|
||||
if (StrUtil.isNotBlank(subdistrict)) {
|
||||
param.put("subdistrict", "2");
|
||||
}
|
||||
param.put("extensions", "base");
|
||||
|
||||
@@ -7,13 +7,13 @@ import com.czg.config.RedisCst;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.RedisService;
|
||||
import com.czg.utils.CzgRandomUtils;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.ShopSong;
|
||||
import com.czg.account.service.ShopSongService;
|
||||
import com.czg.service.account.mapper.ShopSongMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ import org.springframework.stereotype.Service;
|
||||
* @since 2025-03-01
|
||||
*/
|
||||
@Service
|
||||
public class ShopSongServiceImpl extends ServiceImpl<ShopSongMapper, ShopSong> implements ShopSongService{
|
||||
public class ShopSongServiceImpl extends ServiceImpl<ShopSongMapper, ShopSong> implements ShopSongService {
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
@@ -49,18 +49,12 @@ public class ShopSongServiceImpl extends ServiceImpl<ShopSongMapper, ShopSong> i
|
||||
public String getSongUrl(Long shopId) {
|
||||
String code;
|
||||
String key = RedisCst.getSongUrlKey(shopId);
|
||||
if(redisService.hasKey(key)){
|
||||
if (redisService.hasKey(key)) {
|
||||
code = (String) redisService.get(key);
|
||||
}else {
|
||||
code = RandomStringUtils.randomAlphanumeric(12);
|
||||
} else {
|
||||
code = CzgRandomUtils.randomString(12);
|
||||
redisService.set(key, code);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String string = RandomStringUtils.randomAlphanumeric(12);
|
||||
System.out.println(string);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user