當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。