package com.envelon.note
import com.envelon.pencil.Pencil
import org.joda.time.DateTime
class Note extends AbstractNote {
String content
String creator
DateTime timestamp
public String toString() {
return "[$timestamp - $creator] $content"
}
}
grails-app/domain/.../*.groovy
package com.envelon.miracleBalnk
import com.envelon.miracleBalnk.BankGroup
import com.envelon.miracleBalnk.client.Client
import com.envelon.miracleBalnk.crew.Director
class Bank {
String name
Director director
BankGroup bankGroup
static hasMany = [clients: Client]
static belongsTo = [BankGroup]
static constraints = {
name nullable: false, blank: false, unique: true
}
}
grails-app/services/.../*.groovy
class BankService {
static transactional = true
def acountService
def bankrupt() {
def acounts = acountService.acounts
def money = 0
acounts.each { Account account ->
money += account.money
account.money = 0
account.save()
}
money // no return needed
}
}
grails-app/controllers/.../*.groovy
class AccountController {
def springSecurityService
def index() {
def user = springSecurityService.currentUser
redirect(action: "show", id: user.account?.id)
}
def show(Long id) {
def account = Account.get(id)
[account: account]
}
}
grails-app/views/.../*.gsp
...
...
Templates for controllers, views and more