<commit_before>package controllers

import actions.asset.{CreateAction, DeleteAction, DeleteAttributeAction, FindAction, FindSimilarAction, GetAction, SolrFindAction}
import actions.asset.{UpdateAction, UpdateForMaintenanceAction}

import views.html
import models.{Status => AStatus}
import models._
import util._

import play.api.data._
import play.api.data.Forms._
import play.api.http.{Status => StatusValues}
import play.api.mvc._
import play.api.libs.json._

import java.util.Date

trait AssetApi {
  this: Api with SecureController =>

  // GET /api/asset/:tag
  def getAsset(tag: String, location: Option[String] = None) = GetAction(
    tag, location, Permissions.AssetApi.GetAsset, this
  )

  // GET /api/assets?params
  def getAssets(page: Int, size: Int, sort: String, sortField: String, query: String, details: String) = VersionRouter {
    case `1.1` => FindAction(PageParams(page, size, sort), sortField, Permissions.AssetApi.GetAssets, this)
    case `1.2` => SolrFindAction(PageParams(page, size, sort), query, (new Truthy(details)).isTruthy, sortField, Permissions.AssetApi.GetAssets, this)
  }

  // PUT /api/asset/:tag
  def createAsset(tag: String) = CreateAction(Some(tag), None, Permissions.AssetApi.CreateAsset, this)

  // POST /api/asset/:tag
  def updateAsset(tag: String) = UpdateAction(tag, Permissions.AssetApi.UpdateAsset, this)

  def updateAssetForMaintenance(tag: String) = UpdateForMaintenanceAction(
    tag, Permissions.AssetApi.UpdateAssetForMaintenance, this
  )

  // DELETE /api/asset/attribute/:attribute/:tag
  def deleteAssetAttribute(tag: String, attribute: String) = DeleteAttributeAction(
    tag, attribute, Permissions.AssetApi.DeleteAssetAttribute, this
  )

  // DELETE /api/asset/:tag
  def deleteAsset(tag: String) = DeleteAction(tag, Permissions.AssetApi.DeleteAsset, this)

  //GET /api/asset/:tag/similar
  def similar(tag: String, page: Int, size: Int, sort: String) = 
    FindSimilarAction(tag, PageParams(page, size, sort), Permissions.AssetApi.GetAssets, this)

}<commit_msg>removing version routing from asset find api<commit_after>package controllers

import actions.asset.{CreateAction, DeleteAction, DeleteAttributeAction, FindAction, FindSimilarAction, GetAction, SolrFindAction}
import actions.asset.{UpdateAction, UpdateForMaintenanceAction}

import views.html
import models.{Status => AStatus}
import models._
import util._

import play.api.data._
import play.api.data.Forms._
import play.api.http.{Status => StatusValues}
import play.api.mvc._
import play.api.libs.json._

import java.util.Date

trait AssetApi {
  this: Api with SecureController =>

  // GET /api/asset/:tag
  def getAsset(tag: String, location: Option[String] = None) = GetAction(
    tag, location, Permissions.AssetApi.GetAsset, this
  )

  // GET /api/assets?params
  def getAssets(page: Int, size: Int, sort: String, sortField: String, query: String, details: String) = if (query == "") {
    FindAction(PageParams(page, size, sort), sortField, Permissions.AssetApi.GetAssets, this)
  } else {
    SolrFindAction(PageParams(page, size, sort), query, (new Truthy(details)).isTruthy, sortField, Permissions.AssetApi.GetAssets, this)
  }

  // PUT /api/asset/:tag
  def createAsset(tag: String) = CreateAction(Some(tag), None, Permissions.AssetApi.CreateAsset, this)

  // POST /api/asset/:tag
  def updateAsset(tag: String) = UpdateAction(tag, Permissions.AssetApi.UpdateAsset, this)

  def updateAssetForMaintenance(tag: String) = UpdateForMaintenanceAction(
    tag, Permissions.AssetApi.UpdateAssetForMaintenance, this
  )

  // DELETE /api/asset/attribute/:attribute/:tag
  def deleteAssetAttribute(tag: String, attribute: String) = DeleteAttributeAction(
    tag, attribute, Permissions.AssetApi.DeleteAssetAttribute, this
  )

  // DELETE /api/asset/:tag
  def deleteAsset(tag: String) = DeleteAction(tag, Permissions.AssetApi.DeleteAsset, this)

  //GET /api/asset/:tag/similar
  def similar(tag: String, page: Int, size: Int, sort: String) = 
    FindSimilarAction(tag, PageParams(page, size, sort), Permissions.AssetApi.GetAssets, this)

}
{'fraction_non_alphanumeric': 0.12032281731474688, 'fraction_numerical': 0.0009782342871117633, 'mean_word_length': 4.953420669577874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5900040', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1270, 'n_words': 304}