|
|
@@ -1,12 +1,11 @@
|
|
|
package com.cyksj.web.controller.manage.home;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
-import com.cyksj.model.entity.GoodsDonCategory;
|
|
|
-import com.cyksj.model.entity.HomeManagementConfig;
|
|
|
-import com.cyksj.model.entity.HomeManagementConfigUserClickRecord;
|
|
|
+import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.request.HomeConfigTimingReq;
|
|
|
import com.cyksj.model.request.HomeManageConfigReq;
|
|
|
import com.cyksj.model.views.HomeManagementAvailableGoodsView;
|
|
|
@@ -14,6 +13,7 @@ import com.cyksj.model.views.HomeManagementConfigView;
|
|
|
import com.cyksj.service.home.HomeManagementConfigService;
|
|
|
import com.cyksj.service.mange.GoodsDonCategoryService;
|
|
|
import com.cyksj.service.mange.RefreshCacheService;
|
|
|
+import com.cyksj.service.translations.BackInfoTranslationsService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
@@ -43,6 +43,8 @@ public class HomeManageConfigController {
|
|
|
|
|
|
private final GoodsDonCategoryService goodsDonCategoryService;
|
|
|
|
|
|
+ private final BackInfoTranslationsService backInfoTranslationsService;
|
|
|
+
|
|
|
/**
|
|
|
* 新增首页配置
|
|
|
*/
|
|
|
@@ -57,7 +59,12 @@ public class HomeManageConfigController {
|
|
|
*/
|
|
|
@PutMapping("/put")
|
|
|
public Result<String> updateConfig(@RequestBody HomeManageConfigReq config) {
|
|
|
- homeManagementConfigService.saveOrUpdateConfig(config);
|
|
|
+ String lang = request.getHeader("lang");
|
|
|
+ if (lang != null && !StrUtil.equals(UserPageLanguage.Language.zh_CN.name(), lang)) {
|
|
|
+ backInfoTranslationsService.saveOrUpdateBackInfoTranslations(BackInfoTranslations.Type.home_config, config.getId(), config, lang);
|
|
|
+ } else {
|
|
|
+ homeManagementConfigService.saveOrUpdateConfig(config);
|
|
|
+ }
|
|
|
refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|