Commit f92de300 authored by 赵啸非's avatar 赵啸非

添加主题缓存

parent 3b217b2d
......@@ -26,12 +26,10 @@ import com.mortals.xhx.module.site.model.SiteThemeEntity;
import com.mortals.xhx.module.site.service.SiteThemeService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
......@@ -62,25 +60,21 @@ public class SiteThemeController extends BaseCRUDJsonBodyMappingController<SiteT
/**
* 根据站点id获取当前站点主题
*/
@PostMapping(value = "site")
@PostMapping(value = "getThemeBySite")
@UnAuth
public String getThemeCacheBySite(@RequestBody SiteThemeEntity site) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据站点id获取当前站点主题列表" + this.getModuleDesc();
try {
if(ObjectUtils.isEmpty(site.getSiteId()))
throw new AppException("站点id不能为空!");
if(ObjectUtils.isEmpty(site.getUserType()))
throw new AppException("服务类型不能为空!");
if(ObjectUtils.isEmpty(site.getSiteId())) throw new AppException("站点id不能为空!");
if(ObjectUtils.isEmpty(site.getUserType())) throw new AppException("服务类型不能为空!");
String jsonstr = cacheService.hget(RedisCacheKeys.getSiteUserTypeThemeCodeKey() + site.getSiteId(), site.getUserType(), String.class);
List<SiteThemeEntity> siteThemeEntities = JSON.parseObject(jsonstr, new TypeReference<List<SiteThemeEntity>>() {
});
List<SiteThemeEntity> siteThemeEntities = JSON.parseObject(jsonstr, new TypeReference<List<SiteThemeEntity>>() {});
if(ObjectUtils.isEmpty(siteThemeEntities)){
jsonObject.put(KEY_RESULT_DATA, new ArrayList<SiteThemeEntity>());
}else{
jsonObject.put(KEY_RESULT_DATA, siteThemeEntities);
}
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "根据站点id获取当前站点主题列表成功!");
recordSysLog(request, busiDesc + " 【成功】");
......
......@@ -13,14 +13,15 @@ client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###主题列表
POST {{baseUrl}}/site/theme/list
###主题站点
POST {{baseUrl}}/site/theme/site
Content-Type: application/json
{
"siteId":22,
"page":1,
"size":10
"siteId":1,
"userType":4
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment