Commit 01cabc67 authored by 刘基明's avatar 刘基明

主页背景图

parent 7a929a72
package com.tanpu.community.api;
import org.springframework.beans.factory.annotation.Value;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
/**
* monitor系统常量
......@@ -12,12 +14,6 @@ public final class CommunityConstant {
public static final String OSS_PREFIX_URL ="http://tamperfeodev.oss-cn-shanghai.aliyuncs.com/";
@Value("${aliyun.oss.bucketName}")
public String OSS_BUCKET_NAME;
@Value("${aliyun.oss.endpoint}")
public String OSS_END_POINT;
public static final String OSS_PREFIX_FOLDER ="community/";
//图片压缩比例:50%
......@@ -29,9 +25,17 @@ public final class CommunityConstant {
public static final Integer OSS_CHECK_FAIL_DEFAULT_HEIGHT = 1115;
public static final String THEME_PREFIX ="NEW_THEME_";
// 旧图片上传地址
public static final String OLD_FILE_UPLOAD_URL ="http://tp-fatools-svc/fatools/h5/rest/common/uploadSingleFile";
// 首页背景图配置
public static final Map<String,String> BACKGROUND_IMG_URL_MAP = ImmutableMap.of
// 西安家办
("309054222178349056","https://tamp-pro.oss-cn-shanghai.aliyuncs.com/corpCert/xi-an-homepage/green-yellow.png"
// 测试环境
,"295920641461243904","https://tamp-pro.oss-cn-shanghai.aliyuncs.com/corpCert/xi-an-homepage/green-yellow.png"
// 默认
,"default","https://tamp-pro.oss-cn-shanghai.aliyuncs.com/corpCert/xi-an-homepage/blue.png");
......
......@@ -97,4 +97,8 @@ public class UserInfoResp {
@ApiModelProperty(value = "机构用户信息")
private UserInfoNewOrg userInfoNewOrg;
//↓↓↓↓↓首部背景图↓↓↓↓↓↓
@ApiModelProperty(value = "主页背景图")
private String backgroundImgUrl;
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import com.tanpu.common.api.CommonResp;
import com.tanpu.common.constant.BizStatus;
import com.tanpu.common.exception.BizException;
import com.tanpu.common.util.DateUtils;
import com.tanpu.community.api.CommunityConstant;
import com.tanpu.community.api.beans.qo.FollowQo;
import com.tanpu.community.api.beans.req.homepage.FollowRelReq;
import com.tanpu.community.api.beans.req.homepage.QueryFollowReq;
......@@ -190,6 +191,14 @@ public class HomePageManager {
CommonResp<Integer> integerCommonResp = feignClientForCourse.getStudyCourseCount(userId);
if (integerCommonResp.isSuccess()) userInfoNew.setCourseNumber(integerCommonResp.getData());
}
// 主页背景图
if (CommunityConstant.BACKGROUND_IMG_URL_MAP.containsKey(userInfoNew.getUserId())){
userInfoNew.setBackgroundImgUrl(CommunityConstant.BACKGROUND_IMG_URL_MAP.get(userInfoNew.getUserId()));
}else {
userInfoNew.setBackgroundImgUrl(CommunityConstant.BACKGROUND_IMG_URL_MAP.get("default"));
}
//刷新用户缓存
redisCache.put(StringUtils.joinWith("_", CACHE_FEIGN_USER_INFO, userId), userInfoNew, 60);
......
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