设置ai模块展示
This commit is contained in:
@@ -279,4 +279,6 @@ public class RedisConstant {
|
|||||||
public static final String YUN_XUE_TANG_ACCESS_TOKEN = "yun_xue_tang_access_token_";
|
public static final String YUN_XUE_TANG_ACCESS_TOKEN = "yun_xue_tang_access_token_";
|
||||||
|
|
||||||
public static final String SUBMIT_BUILD_KEY = "submit_build_key_";
|
public static final String SUBMIT_BUILD_KEY = "submit_build_key_";
|
||||||
|
|
||||||
|
public static final String GET_AI_MODULE = "get_ai_module_";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,5 +109,8 @@ public class RedisConstantUtil {
|
|||||||
public String submitBuildKey(Long shopId){
|
public String submitBuildKey(Long shopId){
|
||||||
return active + "_" + RedisConstant.SUBMIT_BUILD_KEY + eid + ":" + shopId ;
|
return active + "_" + RedisConstant.SUBMIT_BUILD_KEY + eid + ":" + shopId ;
|
||||||
}
|
}
|
||||||
|
public String getAiModuleKey(){
|
||||||
|
return active + "_" + RedisConstant.GET_AI_MODULE + eid;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,4 +112,12 @@ public interface LineService {
|
|||||||
Integer updateRegionId(Long regionId,Long lineId);
|
Integer updateRegionId(Long regionId,Long lineId);
|
||||||
Boolean hasRegionId(Long lineId);
|
Boolean hasRegionId(Long lineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: wangshuo
|
||||||
|
* @Date: 2025/5/27
|
||||||
|
* @description:小程序ai模块是否展示
|
||||||
|
*/
|
||||||
|
Boolean getAiModule();
|
||||||
|
|
||||||
|
Boolean setAiModule(Boolean flag);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.constants.RedisConstant;
|
||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.entity.*;
|
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.mapper.JoinIntentionMapper;
|
||||||
import com.cool.store.request.*;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.service.*;
|
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.StringUtil;
|
||||||
import com.cool.store.utils.UUIDUtils;
|
import com.cool.store.utils.UUIDUtils;
|
||||||
import com.cool.store.utils.poi.DateUtils;
|
import com.cool.store.utils.poi.DateUtils;
|
||||||
@@ -22,9 +25,11 @@ import com.github.pagehelper.PageInfo;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -37,6 +42,10 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class LineServiceImpl implements LineService {
|
public class LineServiceImpl implements LineService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisUtilPool redisUtilPool;
|
||||||
|
@Autowired
|
||||||
|
private RedisConstantUtil redisConstantUtil;
|
||||||
@Resource
|
@Resource
|
||||||
ShopInfoDAO shopInfoDAO;
|
ShopInfoDAO shopInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -666,6 +675,24 @@ public class LineServiceImpl implements LineService {
|
|||||||
return false;
|
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
|
* @param startTime
|
||||||
|
|||||||
@@ -190,5 +190,16 @@ public class LineInfoController {
|
|||||||
public ResponseResult<Boolean> hasLineRegion(@RequestParam("lineId")Long lineId) {
|
public ResponseResult<Boolean> hasLineRegion(@RequestParam("lineId")Long lineId) {
|
||||||
return ResponseResult.success(lineService.hasRegionId(lineId));
|
return ResponseResult.success(lineService.hasRegionId(lineId));
|
||||||
}
|
}
|
||||||
|
@ApiOperation("获取ai模块是否展示,true展示false不展示")
|
||||||
|
@GetMapping("/getAiModule")
|
||||||
|
public ResponseResult<Boolean> getAiModule() {
|
||||||
|
return ResponseResult.success(lineService.getAiModule());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("设置ai模块是否展示,true展示false不展示")
|
||||||
|
@GetMapping("/setAiModule")
|
||||||
|
public ResponseResult<Boolean> setAiModule(@RequestParam("flag") Boolean flag) {
|
||||||
|
return ResponseResult.success(lineService.setAiModule(flag));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,18 @@ public class LineController {
|
|||||||
public ResponseResult<PageInfo<UserDTO>> getAllUser(@RequestBody GetUserDTO dto) {
|
public ResponseResult<PageInfo<UserDTO>> getAllUser(@RequestBody GetUserDTO dto) {
|
||||||
return ResponseResult.success(userAuthMappingService.getAllUser(dto.getKeyword(),dto.getPageNum(),dto.getPageSize()));
|
return ResponseResult.success(userAuthMappingService.getAllUser(dto.getKeyword(),dto.getPageNum(),dto.getPageSize()));
|
||||||
}
|
}
|
||||||
|
@ApiOperation("获取ai模块是否展示,true展示false不展示")
|
||||||
|
@GetMapping("/getAiModule")
|
||||||
|
public ResponseResult<Boolean> getAiModule() {
|
||||||
|
return ResponseResult.success(lineService.getAiModule());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("设置ai模块是否展示,true展示false不展示")
|
||||||
|
@GetMapping("/setAiModule")
|
||||||
|
public ResponseResult<Boolean> setAiModule(@RequestParam("flag") Boolean flag) {
|
||||||
|
return ResponseResult.success(lineService.setAiModule(flag));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user