我有一個用戶分配給團隊的場景。
不同ClientServices被分配到不同的團隊和
我們需要指定用戶這些球隊的輪轉方式
我試圖如下得到一個地圖,隊名和ClientServiceInstance的名單將被映射到解決它clientservice所以我可以做它進一步處理grails:將域類分配給另一個域類
def teamMap = [:]
clientServicesList.each {clientServiceInstance->
if(teamMap[clientServiceInstance.ownerTeam] == null){
teamMap.putAt(clientServiceInstance.ownerTeam, new ArrayList().push(clientServiceInstance))
}else{
def tmpList = teamMap[clientServiceInstance.ownerTeam]
tmpList.push(clientServiceInstance)
teamMap[clientServiceInstance.ownerTeam] = tmpList
}
}
but instead of pushing clientServiceInstance it pushes true.
Any idea?
我就知道你有什麼聰明;) – doelleri