瀏覽代碼

轮播图上传修改

anderx 7 年之前
父節點
當前提交
7c60cd8281

+ 2 - 2
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -146,7 +146,7 @@ public class OpenAppHomeController extends BaseApiController{
 		map.put("recommended", jtBusinessService.recommendedApplication(null,pageNo,pageSize));
 		map.put("tag", jtTagService.selectListJtTag(null, 1, 99));
 		
-		map.put("homeImg", bannersService.findBannersList( BannersStatus.HOME.getDesc(),1, 1, 1));
+		map.put("homeImg", bannersService.findBannersList( BannersStatus.HOME.getKey(),1, 1, 1));
 		result.setData(map);
 		return result;
 	}
@@ -162,7 +162,7 @@ public class OpenAppHomeController extends BaseApiController{
 		Map<String, Object> map=new HashMap<>();
 		//1 赚钱数据    2首页数据
 		map.put("recommended", jtBusinessService.recommendedApplication(null,pageNo,pageSize));
-		map.put("homeImg", bannersService.findBannersList( BannersStatus.HOME.getDesc(),1, 3, 1));
+		map.put("homeImg", bannersService.findBannersList( BannersStatus.HOME.getKey(),1, 3, 1));
 		result.setData(map);
 		return result;
 	}

+ 13 - 25
src/main/java/com/goafanti/common/enums/BannersStatus.java

@@ -3,49 +3,37 @@ package com.goafanti.common.enums;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.lang3.StringUtils;
 
 public enum BannersStatus {
 	
-	HOME( 1,"home"),
-	OTHER(0, "other");
+	HOME( "home","首页"),
+	MAKEMONEY( "makeMoney","赚钱首页"),
+	OTHER( "other","其他");
 
-	private BannersStatus(Integer code, String desc) {
-		this.code = code;
+	private BannersStatus(String key, String desc) {
+		this.key = key;
 		this.desc = desc;
 	}
 
-	private static Map<Integer, BannersStatus> status = new HashMap<Integer, BannersStatus>();
+	private static Map<String, BannersStatus> status = new HashMap<String, BannersStatus>();
 
 	static {
 		for (BannersStatus value : BannersStatus.values()) {
-			status.put(value.getCode(), value);
+			status.put(value.getKey(), value);
 		}
 	}
 
-	public static BannersStatus getStatus(Integer code) {
-		if (containsType(code)) {
-			return status.get(code);
-		}
-		return OTHER;
-	}
-
-	public static BannersStatus getStatus(String code) {
-		if (StringUtils.isNumeric(code)) {
-			return getStatus(Integer.parseInt(code));
-		}
-		return OTHER;
-	}
+	
 
-	public static boolean containsType(Integer code) {
-		return status.containsKey(code);
+	public static boolean containsType(String	key) {
+		return status.containsKey(key);
 	}
 
-	private Integer	code;
+	private String	key;
 	private String	desc;
 
-	public Integer getCode() {
-		return code;
+	public String getKey() {
+		return key;
 	}
 
 	public String getDesc() {