gpt4 book ai didi

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

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

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

ZoneInfo.getAliasName介绍

暂无

代码示例

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

@RequestMapping(value = "/all", method = RequestMethod.GET)
public List<ZoneDto> listCitizenZones() {
 return zoneService.listCitizenZones()
   .stream()
   .map(z -> new ZoneDto(z.getZone().value(), z.getAliasName()))
   .collect(toList());
}

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

public V1ZoneDto toV1Dto() {
  return new V1ZoneDto(getName(), getAliasName());
 }
}

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

public Article createSpeak(ZoneInfo zoneInfo,
  Account author,
  String title,
  String content,
  Instant now) {
 return insertArticle(Article.createSpeak(zoneInfo.getZone(),
   zoneInfo.getAliasName(),
   kaifIdGenerator.next(),
   author,
   title,
   content,
   now));
}

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

private Article savedArticleWithId(ZoneInfo zoneInfo, Instant time) {
  Article article = Article.createExternalLink(zoneInfo.getZone(),
    zoneInfo.getAliasName(),
    FlakeId.startOf(time.toEpochMilli()),
    account,
    "title x",
    "http://foo.com",
    time);
  dao.insertArticle(article);
  return article;
 }
}

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

@Override
protected void buildFeedMetadata(Map<String, Object> model,
  Channel feed,
  HttpServletRequest request) {
 ZoneInfo zoneInfo = (ZoneInfo) model.get("zoneInfo");
 @SuppressWarnings("unchecked")
 List<Article> articles = (List<Article>) model.get("articles");
 if (zoneInfo != null) {
  feed.setTitle(zoneInfo.getName() + " kaif.io");
  feed.setLink(zoneUrl(zoneInfo.getZone()));
  feed.setDescription(zoneInfo.getAliasName() + " 熱門");
  feed.setPubDate(buildFeedUpdateTime(articles, zoneInfo.getCreateTime()));
 } else {
  feed.setTitle("熱門 kaif.io");
  feed.setLink(SCHEME_AND_HOST);
  feed.setDescription("綜合熱門");
  feed.setPubDate(buildFeedUpdateTime(articles, DEFAULT_INSTANT));
 }
}

代码示例来源: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

public Article createExternalLink(ZoneInfo zoneInfo,
  Account author,
  String title,
  String url,
  String canonicalUrl,
  Instant now) {
 FlakeId flakeId = kaifIdGenerator.next();
 Article article = insertArticle(Article.createExternalLink(zoneInfo.getZone(),
   zoneInfo.getAliasName(),
   flakeId,
   author,
   title,
   url,
   now));
 jdbc().update(""
     + " INSERT "
     + "   INTO ArticleExternalLink "
     + "        (articleId, zone, canonicalUrl, rawUrl, createTime) "
     + " VALUES "
     + questions(5),
   article.getArticleId().value(),
   article.getZone().value(),
   canonicalUrl,
   article.getLink(),
   Timestamp.from(article.getCreateTime()));
 return article;
}

代码示例来源: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));
}

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