All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.beangle.webmvc.entity.action.AbstractRestfulAction.scala Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
package org.beangle.webmvc.entity.action

import org.beangle.data.model.Entity
import org.beangle.webmvc.api.annotation.{ ignore, mapping, param }
import org.beangle.webmvc.api.context.Params
import org.beangle.webmvc.api.view.View

abstract class AbstractRestfulAction[T <: Entity[_ <: java.io.Serializable]] extends AbstractEntityAction[T] {

  def index(): String = {
    indexSetting()
    forward()
  }

  def search(): String = {
    put(shortName + "s", entityDao.search(getQueryBuilder()))
    forward()
  }

  @mapping(value = "{id}")
  def info(@param("id") id: String): String = {
    put(shortName, getModel(entityName, convertId(id)))
    forward()
  }

  protected def indexSetting(): Unit = {}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy