Commit c5c5851a by 苗权威

9.3

parent 0348618f
package ai.qiwu.com.xiaoduhome.common.temple; package ai.qiwu.com.xiaoduhome.common.temple;
import ai.qiwu.com.xiaoduhome.pojo.dpl.Item; import ai.qiwu.com.xiaoduhome.pojo.dpl.Item;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
...@@ -31,6 +32,8 @@ public class FrameTemple implements Agent{ ...@@ -31,6 +32,8 @@ public class FrameTemple implements Agent{
private String marginLeft; private String marginLeft;
@JsonProperty("margin-bottom") @JsonProperty("margin-bottom")
private String marginBottom; private String marginBottom;
@JsonProperty("margin-top")
private String marginTop;
private String width; private String width;
private String height; private String height;
@JsonProperty("border-width") @JsonProperty("border-width")
......
...@@ -9,6 +9,7 @@ import ai.qiwu.com.xiaoduhome.common.temple.funny.FunnyUtil; ...@@ -9,6 +9,7 @@ import ai.qiwu.com.xiaoduhome.common.temple.funny.FunnyUtil;
import ai.qiwu.com.xiaoduhome.common.temple.playUpdate.PlayUpdateDocument; import ai.qiwu.com.xiaoduhome.common.temple.playUpdate.PlayUpdateDocument;
import ai.qiwu.com.xiaoduhome.common.temple.playUpdate.PlayUpdatePojo; import ai.qiwu.com.xiaoduhome.common.temple.playUpdate.PlayUpdatePojo;
import ai.qiwu.com.xiaoduhome.common.temple.rank.RankBotInfo; import ai.qiwu.com.xiaoduhome.common.temple.rank.RankBotInfo;
import ai.qiwu.com.xiaoduhome.common.temple.rank.RankUtil;
import ai.qiwu.com.xiaoduhome.common.temple.rank.RankingDocument; import ai.qiwu.com.xiaoduhome.common.temple.rank.RankingDocument;
import ai.qiwu.com.xiaoduhome.common.temple.recommand.RecommandBotInfo; import ai.qiwu.com.xiaoduhome.common.temple.recommand.RecommandBotInfo;
import ai.qiwu.com.xiaoduhome.common.temple.recommand.RecommandDocument; import ai.qiwu.com.xiaoduhome.common.temple.recommand.RecommandDocument;
...@@ -50,15 +51,18 @@ public class TempleUtils { ...@@ -50,15 +51,18 @@ public class TempleUtils {
private static FrameTemple FRAME_RAKKING; private static FrameTemple FRAME_RAKKING;
private static FrameTemple FRAME_RECOMMAND; private static FrameTemple FRAME_RECOMMAND;
private static FrameTemple FRAME_CATEGORY; private static FrameTemple FRAME_CATEGORY;
private static RankingDocument RANKING_DOCUMENT; // private static RankingDocument RANKING_DOCUMENT;
static { static {
FRAME_RAKKING = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class); FRAME_RAKKING = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class);
FRAME_RAKKING.getItems().get(1).getItems().get(0).setText("小度小度,打开排行榜"); FRAME_RAKKING.getItems().get(1).getItems().get(0).setText("小度小度,打开排行榜");
FRAME_RAKKING.getItems().get(0).setText("排行榜");
FRAME_RECOMMAND = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class); FRAME_RECOMMAND = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class);
FRAME_RECOMMAND.getItems().get(1).getItems().get(0).setText("小度小度,打开推荐"); FRAME_RECOMMAND.getItems().get(1).getItems().get(0).setText("小度小度,打开推荐");
FRAME_RECOMMAND.getItems().get(0).setText("推荐作品");
FRAME_CATEGORY = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class); FRAME_CATEGORY = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class);
FRAME_CATEGORY.getItems().get(1).getItems().get(0).setText("小度小度,打开古风"); FRAME_CATEGORY.getItems().get(1).getItems().get(0).setText("小度小度,打开古风");
FRAME_CATEGORY.getItems().get(0).setText("作品分类");
} }
public static PlayUpdateDocument getPlayUpdate(String audio, String text) { public static PlayUpdateDocument getPlayUpdate(String audio, String text) {
...@@ -91,33 +95,62 @@ public class TempleUtils { ...@@ -91,33 +95,62 @@ public class TempleUtils {
return document; return document;
} }
// public static RankingDocument getRanking() {
// if (RANKING_DOCUMENT != null) {
// return RANKING_DOCUMENT;
// }
// RANKING_DOCUMENT = JSON.parseObject(getDPLTemple("static/json/ranking.json"), RankingDocument.class);
// List<RankBotInfo> datas = new ArrayList<>();
// StringBuilder botIds = new StringBuilder();
// for (GameProjectTb bot:ScheduleService.getRankingList()) {
// botIds.append(bot.getBotAccount()).append(File.separator);
// String imgSrc = new StringBuilder(Constants.IMG_PREFIX).append(bot.getBannerImgUrl()).toString();
// String imageId = new StringBuilder(Constants.PRE_PRODUCT_IMG).append(bot.getName()).toString();
// RankBotInfo rankBotInfo = new RankBotInfo(imgSrc, imageId, correctName(bot.getName()));
// datas.add(rankBotInfo);
// }
// if (botIds.length() != 0) {
// botIds.deleteCharAt(botIds.length()-1);
// String idToken = Base64.getEncoder().encodeToString(botIds.toString().getBytes());
// RANKING_DOCUMENT.setRankBotIds(idToken);
// }
// RANKING_DOCUMENT.getMainTemplate().getItems().get(0).getItems().get(2).getItems().get(0).setData(datas);
// return RANKING_DOCUMENT;
// }
public static RankingDocument getRanking() { public static RankingDocument getRanking() {
if (RANKING_DOCUMENT != null) { return RankUtil.getRankDocument();
return RANKING_DOCUMENT; }
}
RANKING_DOCUMENT = JSON.parseObject(getDPLTemple("static/json/ranking.json"), RankingDocument.class); public static RecommandDocument getRecommand2(int num) {
List<RankBotInfo> datas = new ArrayList<>(); RecommandDocument document = JSON.parseObject(getDPLTemple("static/json/recommand2.json"), RecommandDocument.class);
List<RecommandBotInfo> firstRowData = new ArrayList<>();
List<RecommandBotInfo> secondRowData = new ArrayList<>();
StringBuilder botIds = new StringBuilder(); StringBuilder botIds = new StringBuilder();
for (GameProjectTb bot:ScheduleService.getRankingList()) { int upBound = num+8 <= ScheduleService.getAllProductCount()? num+8: ScheduleService.getAllProductCount();
botIds.append(bot.getBotAccount()).append(File.separator); for (int i = num; i < num+8; i++) {
String imgSrc = new StringBuilder(Constants.IMG_PREFIX).append(bot.getBannerImgUrl()).toString(); OnProductDetail detail = ScheduleService.getAllOnProduct().get(i);
String imageId = new StringBuilder(Constants.PRE_PRODUCT_IMG).append(bot.getName()).toString(); botIds.append(detail.getBotAccount()).append(File.separator);
RankBotInfo rankBotInfo = new RankBotInfo(imgSrc, imageId, correctName(bot.getName())); String imgSrc = new StringBuilder(Constants.IMG_PREFIX).append(detail.getBannerImgUrl()).toString();
datas.add(rankBotInfo); String imageId = new StringBuilder(Constants.PRE_PRODUCT_IMG).append(detail.getName()).toString();
if (i < num+4) {
RecommandBotInfo recommend = new RecommandBotInfo(imgSrc, imageId, correctName(detail.getName()));
firstRowData.add(recommend);
}else {
RecommandBotInfo recommend = new RecommandBotInfo(imgSrc, imageId, correctName(detail.getName()));
secondRowData.add(recommend);
}
} }
if (botIds.length() != 0) { if (botIds.length() != 0) {
botIds.deleteCharAt(botIds.length()-1); botIds.deleteCharAt(botIds.length()-1);
String idToken = Base64.getEncoder().encodeToString(botIds.toString().getBytes()); String idToken = Base64.getEncoder().encodeToString(botIds.toString().getBytes());
RANKING_DOCUMENT.setRankBotIds(idToken); document.setRecommendIdList(idToken);
document.setCount(String.valueOf(botIds.length()));
} }
RANKING_DOCUMENT.getMainTemplate().getItems().get(0).getItems().get(2).getItems().get(0).setData(datas); //document.getMainTemplate().getItems().get(0).getItems().get(2).getItems().get(0).setData(datas);
return RANKING_DOCUMENT; return document;
} }
// public static RankingDocument getNextRank() {
//
// }
public static RecommandDocument getRecommend() { public static RecommandDocument getRecommend() {
RecommandDocument document = JSON.parseObject(getDPLTemple("static/json/recommand.json"), RecommandDocument.class); RecommandDocument document = JSON.parseObject(getDPLTemple("static/json/recommand.json"), RecommandDocument.class);
List<RecommandBotInfo> datas = new ArrayList<>(); List<RecommandBotInfo> datas = new ArrayList<>();
......
...@@ -50,10 +50,7 @@ public class FunnyUtil { ...@@ -50,10 +50,7 @@ public class FunnyUtil {
pager.setHeight("100%"); pager.setHeight("100%");
Event onLoadEvent = new Event("AutoPage", "funnyPage"); Event onLoadEvent = new Event("AutoPage", "funnyPage");
onLoadEvent.setDurationInMillisecond(3000); onLoadEvent.setDurationInMillisecond(3000);
Event setPage = new Event("SetPage", "funnyPage"); pager.setOnLoaded(Collections.singletonList(onLoadEvent));
setPage.setPosition("relative");
setPage.setValue("-1");
pager.setOnLoaded(Arrays.asList(onLoadEvent, setPage));
pageContainer.setItems(Collections.singletonList(pager)); pageContainer.setItems(Collections.singletonList(pager));
......
package ai.qiwu.com.xiaoduhome.common.temple.rank;
import ai.qiwu.com.xiaoduhome.common.BaseHolder;
import ai.qiwu.com.xiaoduhome.common.Constants;
import ai.qiwu.com.xiaoduhome.entity.primary.GameProjectTb;
import ai.qiwu.com.xiaoduhome.pojo.dpl.Event;
import ai.qiwu.com.xiaoduhome.repository.primary.GameProjectTbRepository;
import ai.qiwu.com.xiaoduhome.service.ScheduleService;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.util.*;
/**
* @author 苗权威
* @dateTime 19-9-2 下午9:04
*/
@Slf4j
public class RankUtil {
private static final RankingPojo RANK_FOOTER = buildRankFooter();
private static final RankingPojo RANK_BACKGROUND_IMG = buildRankBackgroundImg();
private static final RankingPojo RANK_HEAD = buildRankHead();
private static final List<RankingPojo> RANK_CONTAINER_LIST = buildImgTextContainer();
private static RankingDocument RANKING_DOCUMENT;
public static RankingDocument getRankDocument() {
if (RANKING_DOCUMENT != null) return RANKING_DOCUMENT;
RANKING_DOCUMENT = new RankingDocument();
RankingMainTemplate mainTemplate = new RankingMainTemplate();
RANKING_DOCUMENT.setMainTemplate(mainTemplate);
List<RankBotInfo> datas = new ArrayList<>();
StringBuilder botIds = new StringBuilder();
for (GameProjectTb bot: ScheduleService.getRankingList()) {
botIds.append(bot.getBotAccount()).append(File.separator);
String imgSrc = new StringBuilder(Constants.IMG_PREFIX).append(bot.getBannerImgUrl()).toString();
String imageId = new StringBuilder(Constants.PRE_PRODUCT_IMG).append(bot.getName()).toString();
RankBotInfo rankBotInfo = new RankBotInfo(imgSrc, imageId, correctName(bot.getName()));
datas.add(rankBotInfo);
}
if (botIds.length() != 0) {
botIds.deleteCharAt(botIds.length()-1);
String idToken = Base64.getEncoder().encodeToString(botIds.toString().getBytes());
RANKING_DOCUMENT.setRankBotIds(idToken);
}
buildMainItem(datas, mainTemplate.getItems());
return RANKING_DOCUMENT;
}
public static RankingDocument updateRankDocument(int num) {
RankingDocument document = new RankingDocument();
RankingMainTemplate mainTemplate = new RankingMainTemplate();
document.setMainTemplate(mainTemplate);
GameProjectTbRepository repository = BaseHolder.getBean("gameProjectTbRepository");
List<GameProjectTb> bots;
try {
bots = repository.postRankBot(num*15);
} catch (Exception e) {
log.error("查询后续排行榜作品信息出错");
return null;
}
if (bots == null || bots.size() == 0) return null;
StringBuilder botIds = new StringBuilder();
List<RankBotInfo> datas = new ArrayList<>();
for (GameProjectTb bot: bots) {
botIds.append(bot.getBotAccount()).append(File.separator);
String imgSrc = new StringBuilder(Constants.IMG_PREFIX).append(bot.getBannerImgUrl()).toString();
String imageId = new StringBuilder(Constants.PRE_PRODUCT_IMG).append(bot.getName()).toString();
RankBotInfo rankBotInfo = new RankBotInfo(imgSrc, imageId, correctName(bot.getName()));
datas.add(rankBotInfo);
}
if (botIds.length() != 0) {
botIds.deleteCharAt(botIds.length()-1);
String idToken = Base64.getEncoder().encodeToString(botIds.toString().getBytes());
document.setRankBotIds(idToken);
document.setCount(String.valueOf(bots.size()));
}
buildMainItem(datas, mainTemplate.getItems());
return document;
}
private static void buildMainItem(List<RankBotInfo> datas, List<RankingPojo> items) {
RankingPojo main = new RankingPojo();
main.setType("Container");
main.setHeight("100%");
main.setWidth("100%");
main.setComponentId("whole");
main.setMarginTop("65dp");
RankingPojo list = new RankingPojo();
list.setType("List");
list.setHeight("100%");
list.setWidth("100%");
list.setDirection("horizontal");
list.setComponentId("scrollToIndex");
list.setData(datas);
list.setItems(RANK_CONTAINER_LIST);
main.setItems(Collections.singletonList(list));
items.add(RANK_BACKGROUND_IMG);
items.add(RANK_HEAD);
items.add(main);
items.add(RANK_FOOTER);
}
private static RankingPojo buildRankFooter() {
RankingPojo footerCon = new RankingPojo();
footerCon.setType("Container");
footerCon.setPosition("absolute");
footerCon.setWidth("100%");
footerCon.setLeft("0");
footerCon.setBottom("0");
RankingPojo footer = new RankingPojo();
footer.setType("Footer");
footer.setHints(Arrays.asList("向右滑","向左滑","打开第一个","返回"));
footerCon.setItems(Collections.singletonList(footer));
return footerCon;
}
private static RankingPojo buildRankBackgroundImg() {
RankingPojo backGroundImg = new RankingPojo();
backGroundImg.setType("Image");
backGroundImg.setPosition("absolute");
backGroundImg.setTop("0dp");
backGroundImg.setLeft("0dp");
backGroundImg.setSrc("https://aliyun-hz1.chewrobot.com/xiaoduhome/image/backend.jpg");
backGroundImg.setHeight("100%");
backGroundImg.setWidth("100%");
return backGroundImg;
}
private static RankingPojo buildRankHead() {
RankingPojo head = new RankingPojo();
head.setType("Header");
head.setHeaderTitle("排行榜");
head.setHasBackIcon(false);
return head;
}
private static List<RankingPojo> buildImgTextContainer() {
RankingPojo container = new RankingPojo();
container.setType("Container");
container.setAlignItems("center");
container.setMarginLeft("15dp");
RankingPojo image = new RankingPojo();
image.setType("Image");
image.setSrc("${data.imageSrc}");
image.setHeight("220dp");
image.setWidth("220dp");
image.setComponentId("${data.imageId}");
image.setScaleType("fitXY");
image.setBorderRadius("10dp");
Event onClickEvent = new Event("SendEvent", "${data.imageId}");
image.setOnClick(Collections.singletonList(onClickEvent));
RankingPojo text = new RankingPojo();
text.setType("Text");
text.setFontSize("30dp");
text.setMarginTop("10dp");
text.setText("${data.imageName}");
container.setItems(Arrays.asList(image, text));
return Collections.singletonList(container);
}
private static String correctName(String name) {
int brace = name.indexOf("{");
if (brace != -1) name = name.substring(0, brace);
return name;
}
}
...@@ -23,5 +23,5 @@ public class RankingDocument extends Document { ...@@ -23,5 +23,5 @@ public class RankingDocument extends Document {
private String rankBotIds; private String rankBotIds;
@JsonIgnore @JsonIgnore
private String count; private String count = "15";
} }
...@@ -26,7 +26,6 @@ public class RecommandPojo { ...@@ -26,7 +26,6 @@ public class RecommandPojo {
private String top; private String top;
private String left; private String left;
private String src; private String src;
private String headerImage;
private String headerTitle; private String headerTitle;
private Boolean hasBackIcon; private Boolean hasBackIcon;
private String componentId; private String componentId;
...@@ -48,4 +47,7 @@ public class RecommandPojo { ...@@ -48,4 +47,7 @@ public class RecommandPojo {
private String bottom; private String bottom;
private List<String> hints; private List<String> hints;
private List<RecommandBotInfo> data; private List<RecommandBotInfo> data;
@JsonProperty("background-color")
private String backgroundColor;
} }
...@@ -144,7 +144,15 @@ public class Oauth2Controller { ...@@ -144,7 +144,15 @@ public class Oauth2Controller {
@RequestMapping("/accessToken") @RequestMapping("/accessToken")
public @ResponseBody TokenDuerosResponse returnTokenToDueros(@RequestParam String grant_type, public @ResponseBody TokenDuerosResponse returnTokenToDueros(@RequestParam String grant_type,
@RequestParam(required = false) String code, @RequestParam String client_id, @RequestParam(required = false) String code, @RequestParam String client_id,
@RequestParam String client_secret, @RequestParam String redirect_uri) { @RequestParam String client_secret, @RequestParam String redirect_uri,
@RequestParam(required = false) String refresh_token,
@RequestParam(required = false) String refreshToken) {
log.info("小度请求Token,client_id:{};client_secret:{};redirect_uri:{};code:{}",
client_id, client_secret, redirect_uri, code);
if (code == null) {
log.info("refreshToken:{},{}",refresh_token,refreshToken);
return null;
}
log.info("小度请求Token,client_id:{};client_secret:{};redirect_uri:{};code:{}", log.info("小度请求Token,client_id:{};client_secret:{};redirect_uri:{};code:{}",
client_id, client_secret, redirect_uri, code); client_id, client_secret, redirect_uri, code);
// 请求会出现发来的消息每个值重复一遍的情况,待解决? // 请求会出现发来的消息每个值重复一遍的情况,待解决?
......
...@@ -15,6 +15,7 @@ public class Data { ...@@ -15,6 +15,7 @@ public class Data {
private String imageSrc; private String imageSrc;
private String imageName; private String imageName;
private String imageId; private String imageId;
private Integer num;
public Data() { public Data() {
} }
......
...@@ -98,4 +98,6 @@ public class Item implements Agent { ...@@ -98,4 +98,6 @@ public class Item implements Agent {
private String textOverflow; private String textOverflow;
private List<Agent> firstItem; private List<Agent> firstItem;
@JsonProperty("background-color")
private String backgroundColor;
} }
...@@ -15,7 +15,7 @@ import java.util.List; ...@@ -15,7 +15,7 @@ import java.util.List;
@Repository @Repository
public interface GameProjectTbRepository extends JpaRepository<GameProjectTb, Integer> { public interface GameProjectTbRepository extends JpaRepository<GameProjectTb, Integer> {
List<GameProjectTb> findFirst15ByApplyStatusOrderByWatchDesc(Integer applyStatus); List<GameProjectTb> findFirst10ByApplyStatusOrderByWatchDesc(Integer applyStatus);
@Query(value = "select id,intro,name,watch,banner_img_url,apply_status,bot_account,user_nickname from game_project_tb where apply_status = 1 and id >= (select floor(RAND()*(select MAX(id) from game_project_tb))) order by id limit 10", nativeQuery = true) @Query(value = "select id,intro,name,watch,banner_img_url,apply_status,bot_account,user_nickname from game_project_tb where apply_status = 1 and id >= (select floor(RAND()*(select MAX(id) from game_project_tb))) order by id limit 10", nativeQuery = true)
List<GameProjectTb> recommendList(); List<GameProjectTb> recommendList();
...@@ -23,5 +23,6 @@ public interface GameProjectTbRepository extends JpaRepository<GameProjectTb, In ...@@ -23,5 +23,6 @@ public interface GameProjectTbRepository extends JpaRepository<GameProjectTb, In
@Query(value = "select p.id,p.intro,p.name,p.watch,p.banner_img_url,p.apply_status,p.bot_account,p.user_nickname from game_project_tb as p,game_project_label_tb as l where l.name= :category and p.id = l.project_id and p.apply_status=1", nativeQuery = true) @Query(value = "select p.id,p.intro,p.name,p.watch,p.banner_img_url,p.apply_status,p.bot_account,p.user_nickname from game_project_tb as p,game_project_label_tb as l where l.name= :category and p.id = l.project_id and p.apply_status=1", nativeQuery = true)
List<GameProjectTb> categoryProject(@Param("category") String category); List<GameProjectTb> categoryProject(@Param("category") String category);
GameProjectTb getByBotAccount(String botAccount); @Query(value = "select id,intro,name,watch,banner_img_url,apply_status,bot_account,user_nickname from game_project_tb where apply_status = 1 order by watch desc limit ?1,15", nativeQuery = true)
List<GameProjectTb> postRankBot(Integer begin);
} }
...@@ -26,6 +26,7 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -26,6 +26,7 @@ import java.util.concurrent.ConcurrentHashMap;
@Slf4j @Slf4j
@Component @Component
public class ScheduleService implements InitializingBean { public class ScheduleService implements InitializingBean {
static int allProductCount;
static volatile List<GameProjectTb> RANKING_LIST = new ArrayList<>(); static volatile List<GameProjectTb> RANKING_LIST = new ArrayList<>();
static volatile List<GameProjectTb> RECOMMEND_LIST = new ArrayList<>(); static volatile List<GameProjectTb> RECOMMEND_LIST = new ArrayList<>();
static volatile List<OnProductDetail> ALL_ON_PRODUCT = new ArrayList<>(); static volatile List<OnProductDetail> ALL_ON_PRODUCT = new ArrayList<>();
...@@ -64,7 +65,7 @@ public class ScheduleService implements InitializingBean { ...@@ -64,7 +65,7 @@ public class ScheduleService implements InitializingBean {
@Scheduled(cron = "0 0 19 * * ?") @Scheduled(cron = "0 0 19 * * ?")
public void initRankingList() { public void initRankingList() {
new Thread(() -> { new Thread(() -> {
RANKING_LIST = gameProjectTbRepository.findFirst15ByApplyStatusOrderByWatchDesc(1); RANKING_LIST = gameProjectTbRepository.findFirst10ByApplyStatusOrderByWatchDesc(1);
//log.info("排行榜:{}", RANKING_LIST); //log.info("排行榜:{}", RANKING_LIST);
}).start(); }).start();
//log.error("更新排行榜出错:{}", e.getMessage()); //log.error("更新排行榜出错:{}", e.getMessage());
...@@ -83,6 +84,7 @@ public class ScheduleService implements InitializingBean { ...@@ -83,6 +84,7 @@ public class ScheduleService implements InitializingBean {
public void initAllOnTableProductInfo() { public void initAllOnTableProductInfo() {
new Thread(() -> { new Thread(() -> {
ALL_ON_PRODUCT = allOnProductInfoRepository.findAllByApplyStatus(1); ALL_ON_PRODUCT = allOnProductInfoRepository.findAllByApplyStatus(1);
allProductCount = ALL_ON_PRODUCT.size();
for (OnProductDetail item : ALL_ON_PRODUCT) { for (OnProductDetail item : ALL_ON_PRODUCT) {
String productName = item.getName(); String productName = item.getName();
String botAccount = item.getBotAccount(); String botAccount = item.getBotAccount();
...@@ -190,4 +192,12 @@ public class ScheduleService implements InitializingBean { ...@@ -190,4 +192,12 @@ public class ScheduleService implements InitializingBean {
public static List<String> getExceptBotAccount() { public static List<String> getExceptBotAccount() {
return EXCEPT_BOT_ACCOUNT; return EXCEPT_BOT_ACCOUNT;
} }
public static List<OnProductDetail> getAllOnProduct() {
return ALL_ON_PRODUCT;
}
public static int getAllProductCount() {
return allProductCount;
}
} }
...@@ -22,9 +22,8 @@ ...@@ -22,9 +22,8 @@
}, },
{ {
"type": "Header", "type": "Header",
"headerImage": "https://skillstore.cdn.bcebos.com/icon/23/fc7581b7-b505-1f44-ab52-3d9f5e567dfd.png",
"headerTitle": "横向列表", "headerTitle": "横向列表",
"hasBackIcon": true "hasBackIcon": false
}, },
{ {
"type": "Container", "type": "Container",
......
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
"type": "Container", "type": "Container",
"flex-direction": "row", "flex-direction": "row",
"margin-bottom": "15dp", "margin-bottom": "15dp",
"margin-top": "15dp",
"items": [ "items": [
{ {
"type": "Text", "type": "Text",
"text": "作品排行榜", "text": "排行榜",
"font-size": "35dp", "font-size": "38dp",
"margin-left": "30dp" "margin-left": "30dp"
}, },
{ {
"type": "Frame", "type": "Frame",
"margin-left": "15dp", "margin-left": "15dp",
"border-width": "1dp",
"border-top-left-radius": "25dp", "border-top-left-radius": "25dp",
"border-top-right-radius": "15dp", "border-top-right-radius": "15dp",
"border-bottom-right-radius": "15dp", "border-bottom-right-radius": "15dp",
"padding-vertical": "8dp", "padding-vertical": "8dp",
"padding-horizontal": "15dp", "padding-horizontal": "15dp",
"border-color": "rgb(255,255,255)", "background-color": "rgb(105,105,105)",
"items": [ "items": [
{ {
"type": "Text", "type": "Text",
"font-size": "15dp", "font-size": "28dp",
"color": "rgb(255,255,255)" "color": "rgb(255,255,255)"
} }
] ]
......
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
}, },
{ {
"type": "Header", "type": "Header",
"headerImage": "https://skillstore.cdn.bcebos.com/icon/23/fc7581b7-b505-1f44-ab52-3d9f5e567dfd.png",
"headerTitle": "交游天下", "headerTitle": "交游天下",
"hasBackIcon": true "hasBackIcon": false
}, },
{ {
"type": "Container", "type": "Container",
...@@ -114,7 +113,7 @@ ...@@ -114,7 +113,7 @@
{ {
"type": "Text", "type": "Text",
"font-size": "25dp", "font-size": "25dp",
"line-height": "5dp", "line-height": "20dp",
"margin-top": "30dp", "margin-top": "30dp",
"max-lines": 3, "max-lines": 3,
"text-overflow": "ellipsis", "text-overflow": "ellipsis",
......
...@@ -7,65 +7,58 @@ ...@@ -7,65 +7,58 @@
], ],
"items": [ "items": [
{ {
"type": "Image",
"position": "absolute",
"top": "0dp",
"left": "0dp",
"src": "https://aliyun-hz1.chewrobot.com/xiaoduhome/image/backend.jpg",
"height": "100%",
"width": "100%"
},
{
"type": "Header",
"headerTitle": "排行榜",
"hasBackIcon": false
},
{
"type": "Container", "type": "Container",
"height": "100%", "height": "100%",
"width": "100%", "width": "100%",
"componentId": "whole",
"margin-top": "65dp",
"items": [ "items": [
{ {
"type": "Image", "type": "List",
"position": "absolute",
"top": "0dp",
"left": "0dp",
"src": "https://aliyun-hz1.chewrobot.com/xiaoduhome/image/backend.jpg",
"height": "100%",
"width": "100%"
},
{
"type": "Header",
"headerTitle": "排行榜",
"hasBackIcon": false
},
{
"type": "Container",
"height": "100%", "height": "100%",
"width": "100%", "width": "100%",
"componentId": "whole", "direction": "horizontal",
"margin-top": "65dp", "componentId": "scrollToIndex",
"items": [ "items": [
{ {
"type": "List", "type": "Container",
"height": "100%", "align-items": "center",
"width": "100%", "margin-left": "15dp",
"direction": "horizontal",
"componentId": "scrollToIndex",
"items": [ "items": [
{ {
"type": "Container", "type": "Image",
"align-items": "center", "width": "220dp",
"margin-left": "15dp", "height": "220dp",
"items": [ "componentId": "${data.imageId}",
"scale-type": "fitXY",
"border-radius": "10dp",
"src": "${data.imageSrc}",
"onClick": [
{ {
"type": "Image", "type": "SendEvent",
"width": "220dp", "componentId": "${data.imageId}"
"height": "220dp",
"componentId": "${data.imageId}",
"scale-type": "fitXY",
"border-radius": "10dp",
"src": "${data.imageSrc}",
"onClick": [
{
"type": "SendEvent",
"componentId": "${data.imageId}"
}
]
},
{
"type": "Text",
"font-size": "30dp",
"margin-top": "10dp",
"text": "${data.imageName}"
} }
] ]
},
{
"type": "Text",
"font-size": "30dp",
"margin-top": "10dp",
"text": "${data.imageName}"
} }
] ]
} }
...@@ -83,7 +76,7 @@ ...@@ -83,7 +76,7 @@
{ {
"type": "Footer", "type": "Footer",
"hints": [ "hints": [
"打开推荐作品","下一个分类","打开排行榜" "向右滑","向左滑","打开第一个","返回"
] ]
} }
] ]
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
{ {
"type": "Footer", "type": "Footer",
"hints": [ "hints": [
"打开推荐作品","下一个分类","打开排行榜" "打开第一个","下一页","返回"
] ]
} }
] ]
......
{
"type": "DPL",
"version": "1.0",
"mainTemplate": {
"parameters": [
"payload"
],
"items": [
{
"type": "Image",
"position": "absolute",
"top": "0dp",
"left": "0dp",
"src": "https://aliyun-hz1.chewrobot.com/xiaoduhome/image/backend.jpg",
"height": "100%",
"width": "100%"
},
{
"type": "Header",
"headerTitle": "推荐页",
"hasBackIcon": false
},
{
"type": "Container",
"height": "100%",
"width": "100%",
"items": [
{
"type": "List",
"height": "50%",
"width": "100%",
"margin-left": "15dp",
"direction": "horizontal",
"items": [
{
"type": "Container",
"margin-left": "15dp",
"items": [
{
"type": "Image",
"width": "220dp",
"height": "220dp",
"margin-left": "7dp",
"margin-top": "7dp",
"position": "absolute",
"componentId": "${data.imageId}",
"scale-type": "fitXY",
"border-radius": "10dp",
"src": "${data.imageSrc}",
"onClick": [
{
"type": "SendEvent",
"componentId": "${data.imageId}"
}
]
},
{
"type": "Frame",
"width": "45dp",
"height": "45dp",
"background-color": "rgb(0,0,0)",
"border-radius": "10dp",
"items": [
{
"type": "Container",
"width": "100%",
"height": "100%",
"align-items":"center",
"items": [
{
"type": "Text",
"text": "${data.num}",
"font-size": "28dp",
"margin-top": "157dp",
"margin-left": "7dp"
}
]
}
]
},
{
"type": "Text",
"font-size": "30dp",
"margin-top": "10dp",
"text": "${data.imageName}"
}
]
}
]
},
{
"type": "List",
"height": "50%",
"width": "100%",
"margin-left": "15dp",
"direction": "horizontal",
"items": [
{
"type": "Container",
"margin-left": "15dp",
"items": [
{
"type": "Image",
"width": "220dp",
"height": "220dp",
"margin-left": "7dp",
"margin-top": "7dp",
"position": "absolute",
"componentId": "${data.imageId}",
"scale-type": "fitXY",
"border-radius": "10dp",
"src": "${data.imageSrc}",
"onClick": [
{
"type": "SendEvent",
"componentId": "${data.imageId}"
}
]
},
{
"type": "Frame",
"width": "45dp",
"height": "45dp",
"background-color": "rgb(0,0,0)",
"border-radius": "10dp",
"items": [
{
"type": "Container",
"width": "100%",
"height": "100%",
"align-items":"center",
"items": [
{
"type": "Text",
"text": "${data.num}",
"font-size": "28dp",
"margin-top": "157dp",
"margin-left": "7dp"
}
]
}
]
},
{
"type": "Text",
"font-size": "30dp",
"margin-top": "10dp",
"text": "${data.imageName}"
}
]
}
]
}
]
},
{
"type": "Container",
"position": "absolute",
"width": "100%",
"left": "0",
"bottom": "0",
"items": [
{
"type": "Footer",
"hints": [
"打开第一个","下一页","返回"
]
}
]
}
]
}
}
\ No newline at end of file
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