cleanup: удалены закомментированные фрагменты кода (104 блока в 14 файлах)
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/serviceOperation/{svcOperationId}">
|
||||
|
||||
<cfsilent>
|
||||
<cfimport prefix="m" taglib="../lib"/>
|
||||
<cfset this.helper=CreateObject("component","lib.rest_api_helper")/>
|
||||
</cfsilent>
|
||||
|
||||
|
||||
<cffunction name="get" hint="Операция сервиса"><!--- *** TODO проверка принадлежности тенанту --->
|
||||
<cfargument name="svcOperationId" type="string" required=true hint="type:integer"/>
|
||||
<cftry>
|
||||
@@ -14,7 +11,6 @@
|
||||
<cfreturn representationOf(this.helper.formatBadRequestError(cfcatch)).withStatus(400)/>
|
||||
</cfcatch>
|
||||
</cftry>
|
||||
|
||||
<cfquery name="local.qSvcOperation" result="local.result">
|
||||
select
|
||||
<m:field_set titleMapOut="local.titleMap" lengthOut="local.fieldCount">
|
||||
@@ -27,12 +23,10 @@
|
||||
from svc_operation o
|
||||
where o.svc_operation_id=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.svcOperationId#" null=#!isValid('integer',arguments.svcOperationId)#/>
|
||||
</cfquery>
|
||||
|
||||
<cfquery name="local.qCfsParam" result="local.result">
|
||||
select
|
||||
<m:field_set titleMapOut="local.cfsParamMap" lengthOut="local.fieldCount">
|
||||
<m:field title="ID" cfSqlType="CF_SQL_INTEGER">p.svc_operation_cfs_param_id</m:field>
|
||||
<!--- <m:field cfSqlType="CF_SQL_INTEGER">p.svc_operation_id</m:field> --->
|
||||
<m:field>p.svc_operation_cfs_param</m:field>
|
||||
<m:field>p.label</m:field>
|
||||
<m:field>p.data_type</m:field>
|
||||
@@ -73,18 +67,14 @@
|
||||
AND p.is_actual
|
||||
order by p.sort, p.svc_operation_cfs_param_id
|
||||
</cfquery>
|
||||
|
||||
<cfif local.qSvcOperation.recordCount EQ 0>
|
||||
<cfreturn representationOf(this.helper.formatMessage("Not Found")).withStatus(404)/>
|
||||
</cfif>
|
||||
|
||||
<cfset var out=structNew("linked")/>
|
||||
<cfset "out.queryDurationMs"=getTickCount() - request.startTickCount/>
|
||||
|
||||
<cfset "out.svcOperation" = this.helper.appendRecord(
|
||||
structNew("linked"), "", local.titleMap, local.qSvcOperation, this.helper.snake2camel
|
||||
)/>
|
||||
|
||||
<cfset "out.svcOperation.cfsParams"=[]/>
|
||||
<cfloop query=#local.qCfsParam#>
|
||||
<cfif (len(local.qCfsParam.func) OR len(local.qCfsParam.expression) OR len(local.qCfsParam.state_path) OR len(local.qCfsParam.nested_ref))
|
||||
@@ -93,16 +83,13 @@
|
||||
</cfif>
|
||||
<cfset arrayAppend(out.svcOperation.cfsParams, this.helper.appendRecord(structNew("linked"), "", local.cfsParamMap, local.qCfsParam, this.helper.snake2camel))/>
|
||||
</cfloop>
|
||||
|
||||
<cfset "out.runDurationMs"=getTickCount() - request.startTickCount/>
|
||||
<cfreturn representationOf(out) />
|
||||
</cffunction>
|
||||
|
||||
<!--- *** выглядит ужасно, но красивый вариант не придумывается ряд месяцев --->
|
||||
<cffunction name="computeDefault">
|
||||
<cfargument name="defaultCompute"/>
|
||||
<cfargument name="original"/>
|
||||
|
||||
<cfswitch expression=#arguments.defaultCompute#>
|
||||
<cfcase value="display_name">
|
||||
</cfcase>
|
||||
@@ -110,7 +97,5 @@
|
||||
<cfreturn #arguments.original#/>
|
||||
</cfdefaultcase>
|
||||
</cfswitch>
|
||||
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
</cfcomponent>
|
||||
|
||||
Reference in New Issue
Block a user