设置ai模块展示

This commit is contained in:
shuo.wang
2025-05-27 10:05:43 +08:00
parent 7b30396dae
commit e2a1076b44
6 changed files with 63 additions and 0 deletions

View File

@@ -112,4 +112,12 @@ public interface LineService {
Integer updateRegionId(Long regionId,Long lineId);
Boolean hasRegionId(Long lineId);
/**
* @Auther: wangshuo
* @Date: 2025/5/27
* @description:小程序ai模块是否展示
*/
Boolean getAiModule();
Boolean setAiModule(Boolean flag);
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.*;
import com.cool.store.entity.*;
@@ -13,6 +14,8 @@ import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.request.*;
import com.cool.store.service.*;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.UUIDUtils;
import com.cool.store.utils.poi.DateUtils;
@@ -22,9 +25,11 @@ import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -37,6 +42,10 @@ import java.util.stream.Collectors;
@Service
public class LineServiceImpl implements LineService {
@Autowired
private RedisUtilPool redisUtilPool;
@Autowired
private RedisConstantUtil redisConstantUtil;
@Resource
ShopInfoDAO shopInfoDAO;
@Resource
@@ -666,6 +675,24 @@ public class LineServiceImpl implements LineService {
return false;
}
@Override
public Boolean getAiModule() {
String key =redisConstantUtil.getAiModuleKey();
String value = redisUtilPool.getString(key);
if (StringUtils.isEmpty(value)){
return true;
}else {
return Boolean.valueOf(value);
}
}
@Override
public Boolean setAiModule(Boolean flag) {
String key =redisConstantUtil.getAiModuleKey();
redisUtilPool.setString(key,flag.toString());
return true;
}
/**
* 计算预期时间
* @param startTime