当前位置: 首页>>代码示例>>Java>>正文


Java LyricsInfo类代码示例

本文整理汇总了Java中net.sourceforge.subsonic.ajax.LyricsInfo的典型用法代码示例。如果您正苦于以下问题:Java LyricsInfo类的具体用法?Java LyricsInfo怎么用?Java LyricsInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LyricsInfo类属于net.sourceforge.subsonic.ajax包,在下文中一共展示了LyricsInfo类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLyrics

import net.sourceforge.subsonic.ajax.LyricsInfo; //导入依赖的package包/类
@SuppressWarnings("UnusedDeclaration")
public void getLyrics(HttpServletRequest request, HttpServletResponse response) throws Exception {
    request = wrapRequest(request);
    String artist = request.getParameter("artist");
    String title = request.getParameter("title");
    LyricsInfo lyrics = lyricsService.getLyrics(artist, title);

    Lyrics result = new Lyrics();
    result.setArtist(lyrics.getArtist());
    result.setTitle(lyrics.getTitle());
    result.setContent(lyrics.getLyrics());

    Response res = createResponse();
    res.setLyrics(result);
    jaxbWriter.writeResponse(request, response, res);
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:17,代码来源:RESTController.java

示例2: getLyrics

import net.sourceforge.subsonic.ajax.LyricsInfo; //导入依赖的package包/类
public void getLyrics(HttpServletRequest request, HttpServletResponse response) throws Exception {
    request = wrapRequest(request);

    String artist = request.getParameter("artist");
    String title = request.getParameter("title");
    String id = request.getParameter("id");

    LyricsInfo lyrics = new LyricsInfo();
    if (id != null) {
        lyrics = lyricsService.getLyrics(id, artist, title);
    } else {
      lyrics = lyricsService.getLyrics(artist, title);
    }

    XMLBuilder builder = createXMLBuilder(request, response, true);
    AttributeSet attributes = new AttributeSet();
    attributes.add("artist", lyrics.getArtist());
    attributes.add("title", lyrics.getTitle());
    builder.add("lyrics", attributes, lyrics.getLyrics(), true);

    builder.endAll();
    response.getWriter().print(builder);
}
 
开发者ID:FutureSonic,项目名称:FutureSonic-Server,代码行数:24,代码来源:RESTController.java


注:本文中的net.sourceforge.subsonic.ajax.LyricsInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。