系统设置使用缓存代理,不再直接读取数据库
This commit is contained in:
parent
1c95a56f44
commit
3b21fede61
@ -63,7 +63,7 @@ public class UploadController {
|
|||||||
if (authUser == null) {
|
if (authUser == null) {
|
||||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
}
|
}
|
||||||
Setting setting = settingService.getById(SettingEnum.OSS_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
|
||||||
if (setting == null || StrUtil.isBlank(setting.getSettingValue())) {
|
if (setting == null || StrUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException(ResultCode.OSS_NOT_EXIST);
|
throw new ServiceException(ResultCode.OSS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void sendSmsCode(String mobile, VerificationEnums verificationEnums, String uuid) {
|
public void sendSmsCode(String mobile, VerificationEnums verificationEnums, String uuid) {
|
||||||
//获取短信配置
|
//获取短信配置
|
||||||
Setting setting = settingService.getById(SettingEnum.SMS_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.SMS_SETTING.name());
|
||||||
if (StrUtil.isBlank(setting.getSettingValue())) {
|
if (StrUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException("您还未配置阿里云短信");
|
throw new ServiceException("您还未配置阿里云短信");
|
||||||
}
|
}
|
||||||
@ -331,7 +331,7 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
|||||||
*/
|
*/
|
||||||
public com.aliyun.dysmsapi20170525.Client createClient() {
|
public com.aliyun.dysmsapi20170525.Client createClient() {
|
||||||
try {
|
try {
|
||||||
Setting setting = settingService.getById(SettingEnum.SMS_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.SMS_SETTING.name());
|
||||||
if (StrUtil.isBlank(setting.getSettingValue())) {
|
if (StrUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException("您还未配置阿里云短信");
|
throw new ServiceException("您还未配置阿里云短信");
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class AliFileManagerPlugin implements FileManagerPlugin {
|
|||||||
private OssSetting getSetting() {
|
private OssSetting getSetting() {
|
||||||
//如果没有配置,或者没有下次刷新时间,或者下次刷新时间小于当前时间,则从redis 更新一次
|
//如果没有配置,或者没有下次刷新时间,或者下次刷新时间小于当前时间,则从redis 更新一次
|
||||||
if (ossSetting == null || nextInitSetting == null || nextInitSetting < System.currentTimeMillis()) {
|
if (ossSetting == null || nextInitSetting == null || nextInitSetting < System.currentTimeMillis()) {
|
||||||
Setting setting = settingService.getById(SettingEnum.OSS_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
|
||||||
if (setting == null || StrUtil.isBlank(setting.getSettingValue())) {
|
if (setting == null || StrUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException("您还未配置阿里云OSS存储");
|
throw new ServiceException("您还未配置阿里云OSS存储");
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ import cn.lili.modules.system.service.SettingService;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -62,7 +61,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
|||||||
public GoodsGallery getGoodsGallery(String origin) {
|
public GoodsGallery getGoodsGallery(String origin) {
|
||||||
GoodsGallery goodsGallery = new GoodsGallery();
|
GoodsGallery goodsGallery = new GoodsGallery();
|
||||||
//获取商品系统配置决定是否审核
|
//获取商品系统配置决定是否审核
|
||||||
Setting setting = settingService.getById(SettingEnum.GOODS_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.GOODS_SETTING.name());
|
||||||
GoodsSetting goodsSetting = JSONUtil.toBean(setting.getSettingValue(), GoodsSetting.class);
|
GoodsSetting goodsSetting = JSONUtil.toBean(setting.getSettingValue(), GoodsSetting.class);
|
||||||
//缩略图
|
//缩略图
|
||||||
String thumbnail = fileManagerPlugin.getUrl(origin, goodsSetting.getAbbreviationPictureWidth(), goodsSetting.getAbbreviationPictureHeight());
|
String thumbnail = fileManagerPlugin.getUrl(origin, goodsSetting.getAbbreviationPictureWidth(), goodsSetting.getAbbreviationPictureHeight());
|
||||||
|
@ -68,7 +68,7 @@ public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, Logistics
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private Traces getOrderTracesByJson(String logisticsId, String expNo) throws Exception {
|
private Traces getOrderTracesByJson(String logisticsId, String expNo) throws Exception {
|
||||||
Setting setting = settingService.getById(SettingEnum.KUAIDI_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.KUAIDI_SETTING.name());
|
||||||
if (StrUtil.isBlank(setting.getSettingValue())) {
|
if (StrUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException("您还未配置快递查询");
|
throw new ServiceException("您还未配置快递查询");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user