@ Wolfgang Fahl은 Lithium REST API를 수정할 수 있기를 바랍니다.
불행하게도 그렇지 않은, 그래서 우리는 우리가 무엇을 얻을 처리해야, 그런 것을 할 수 일을 뭔가 :
<#-- this variable we need to store unique author ids -->
<#assign authorids = [] />
<#-- I'd use API v2 here, think for such stuff it's more powerful than v1 -->
<#assign query = 'SELECT author FROM messages WHERE conversation.style = "blog" AND board.id = "audiofiles"'?url />
<#assign response = rest("2.0", "https://stackoverflow.com/search?q=" + query) />
<#-- the response object will contain a list of blog post authors,
we loop trough them to get uniqe ids of every user that has written
a blog post, we need them later -->
<#list response.data.items as author>
<#-- make sure each author just gets added once -->
<#if !authorids?seq_contains(author.id)>
<#assign authorids = authorids + [author.id] />
</#if>
</#list>
<#-- now we loop trough the unique author ids and ask for the amount of
blog posts they have written -->
<ul>
<#list authorids as id>
<#assign query = 'SELECT count(*) FROM messages WHERE author.id = id AND board.id = "audiofiles"'?url />
<#assign response = rest("2.0", "https://stackoverflow.com/search?q=" + query) />
<li>User with ID ${id} has written ${response.data.count} blog posts</li>
</#list>
</ul>
코드가 작동하는 경우, 그래서 100 % 확인 안된이지만, 위의 코드를 사용하여 내가 선택한 방법이 분명 해졌을 때 ...