gpt4 book ai didi

io.kaif.model.zone.ZoneInfo.isHideFromTop()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:54:59 25 4
gpt4 key购买 nike

本文整理了Java中io.kaif.model.zone.ZoneInfo.isHideFromTop()方法的一些代码示例,展示了ZoneInfo.isHideFromTop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneInfo.isHideFromTop()方法的具体详情如下:
包路径:io.kaif.model.zone.ZoneInfo
类名称:ZoneInfo
方法名:isHideFromTop

ZoneInfo.isHideFromTop介绍

暂无

代码示例

代码示例来源:origin: kaif-open/kaif

@Override
public List<ZoneInfo> listRecommendZones() {
 int recommendSize = 10;
 List<ZoneInfo> results = articleDao.listHotZonesWithCache(recommendSize,
   Instant.now().minus(Duration.ofHours(24)));
 if (results.size() >= recommendSize) {
  return results;
 }
 // not enough hot zone within 24 hours, fall back to all zones...
 List<ZoneInfo> all = zoneDao.listOrderByName()
   .stream()
   .filter(zoneInfo -> !zoneInfo.isHideFromTop())
   .collect(toList());
 Collections.shuffle(all);
 return all.stream().limit(recommendSize).collect(toList());
}

代码示例来源:origin: kaif-open/kaif

@CacheEvict(value = "listAdministrators", key = "#a0.zone")
public ZoneInfo create(ZoneInfo zoneInfo) {
 jdbc().update(""
     + " INSERT "
     + "   INTO ZoneInfo "
     + "        (zone, aliasName, theme, voteAuthority, debateAuthority, writeAuthority, "
     + "         createTime, adminAccountIds, hideFromTop) "
     + " VALUES "
     + questions(9),
   zoneInfo.getZone().value(),
   zoneInfo.getAliasName(),
   zoneInfo.getTheme(),
   zoneInfo.getVoteAuthority().name(),
   zoneInfo.getDebateAuthority().name(),
   zoneInfo.getWriteAuthority().name(),
   Timestamp.from(zoneInfo.getCreateTime()),
   createUuidArray(zoneInfo.getAdminAccountIds().stream()),
   zoneInfo.isHideFromTop());
 createZoneAdmin(zoneInfo);
 return zoneInfo;
}

代码示例来源:origin: kaif-open/kaif

@Test
public void createDefault() throws Exception {
 ZoneInfo zoneInfo = service.createDefault("abc", "Abc");
 ZoneInfo loaded = zoneDao.loadZoneWithoutCache(Zone.valueOf("abc"));
 assertEquals(zoneInfo, loaded);
 assertEquals("abc", loaded.getName());
 assertEquals("Abc", loaded.getAliasName());
 assertEquals(Authority.CITIZEN, loaded.getVoteAuthority());
 assertEquals(Authority.CITIZEN, loaded.getWriteAuthority());
 assertEquals(Authority.CITIZEN, loaded.getDebateAuthority());
 assertEquals(ZoneInfo.THEME_DEFAULT, loaded.getTheme());
 assertFalse(loaded.isHideFromTop());
 assertEquals(0, loaded.getAdminAccountIds().size());
}

代码示例来源:origin: kaif-open/kaif

@Test
public void createKaif() throws Exception {
 ZoneInfo zoneInfo = service.createKaif("faq", "FAQ");
 ZoneInfo loaded = zoneDao.loadZoneWithoutCache(Zone.valueOf("faq"));
 assertEquals(zoneInfo, loaded);
 assertEquals("faq", loaded.getZone().value());
 assertEquals("FAQ", loaded.getAliasName());
 assertEquals(Authority.CITIZEN, loaded.getVoteAuthority());
 assertEquals(Authority.CITIZEN, loaded.getDebateAuthority());
 assertEquals(Authority.FORBIDDEN, loaded.getWriteAuthority());
 assertEquals(ZoneInfo.THEME_KAIF, loaded.getTheme());
 assertTrue(loaded.isHideFromTop());
 assertEquals(0, loaded.getAdminAccountIds().size());
}

代码示例来源:origin: kaif-open/kaif

@Test
public void createByUser() throws Exception {
 accountDao.changeTotalVotedDebate(citizen.getAccountId(), 10, 0);
 ZoneInfo zoneInfo = service.createByUser("aaa", "this is aaa", citizen);
 ZoneInfo loaded = zoneDao.loadZoneWithoutCache(Zone.valueOf("aaa"));
 assertEquals(zoneInfo, loaded);
 assertEquals("aaa", loaded.getName());
 assertEquals("this is aaa", loaded.getAliasName());
 assertEquals(Authority.CITIZEN, loaded.getVoteAuthority());
 assertEquals(Authority.CITIZEN, loaded.getWriteAuthority());
 assertEquals(Authority.CITIZEN, loaded.getDebateAuthority());
 assertEquals(ZoneInfo.THEME_DEFAULT, loaded.getTheme());
 assertFalse(loaded.isHideFromTop());
 assertEquals(citizen.getAccountId(), loaded.getAdminAccountIds().get(0));
 List<ZoneInfo> zones = zoneDao.listZonesByAdmin(citizen.getAccountId());
 assertEquals(zoneInfo, zones.get(0));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com