026 bug fix

This commit is contained in:
msyu
2024-11-25 18:12:15 +03:00
parent 0df2473c1b
commit ac71e6d886
3 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -71,7 +71,7 @@
//variables.framework.docs={}; //variables.framework.docs={};
variables.framework.docs.APIName="Deck API"; variables.framework.docs.APIName="Deck API";
variables.framework.docs.APIVersion="0.025"; variables.framework.docs.APIVersion="0.026";
variables.framework.globalHeaders = structNew(); variables.framework.globalHeaders = structNew();
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location"; variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
@@ -132,7 +132,7 @@
<cfthrow type="invalidParamValue" message="Cannot find CFS parameter by instanceOperationCfsParamUid=#arguments.instanceOperationCfsParamUid#"/> <cfthrow type="invalidParamValue" message="Cannot find CFS parameter by instanceOperationCfsParamUid=#arguments.instanceOperationCfsParamUid#"/>
</cfif> </cfif>
<cfset CreateObject("component", "instance_operation_cfs_param_ls").checkParam(local.qCheck.svc_operation_cfs_param_id, arguments.paramValue)/> <cfset CreateObject("component", "instance_operation_cfs_param_ls").checkParam(local.qCheck.svc_operation_cfs_param_id, arguments.paramValue, arguments.instanceOperationCfsParamUid)/>
</cffunction> </cffunction>
</cfcomponent> </cfcomponent>
@@ -225,8 +225,9 @@
</cffunction> </cffunction>
<cffunction name="checkParam"> <cffunction name="checkParam">
<cfargument name="svcOperationCfsParamId" type="numeric" required=true/> <cfargument name="svcOperationCfsParamId" type="numeric" required = true/>
<cfargument name="paramValue" required=true/> <cfargument name="paramValue" required = true/>
<cfargument name="instanceOperationCfsParamUid" type="guid" required = false/>
<!--- *** Вероятно, стоит возвращать конкретную ругань ---> <!--- *** Вероятно, стоит возвращать конкретную ругань --->
<!--- принадлежит ли параметр к данному сервису, проверяется выше ---> <!--- принадлежит ли параметр к данному сервису, проверяется выше --->
<cfquery name="qSvcOperationCfsParam"> <cfquery name="qSvcOperationCfsParam">
@@ -269,6 +270,9 @@
</cfif> </cfif>
<!--- *** интересно, как мы ухитряемся проверить уникальность параметра, если он относится к операции, а не к экземпляру. Нам-то нужна уникальность для стейта (и то, скорее, единовременная, и интересовать будут только успешные операции) ---> <!--- *** интересно, как мы ухитряемся проверить уникальность параметра, если он относится к операции, а не к экземпляру. Нам-то нужна уникальность для стейта (и то, скорее, единовременная, и интересовать будут только успешные операции) --->
<!--- ****** Внимание! Этот код сравнивает параметры одноименных операций, но уникальность должна быть и между create-modify и т.п. --->
<cfswitch expression=#qSvcOperationCfsParam.unique_scope#> <cfswitch expression=#qSvcOperationCfsParam.unique_scope#>
<cfcase value="provider"> <cfcase value="provider">
<cfquery name="qUnique"> <cfquery name="qUnique">
@@ -276,11 +280,11 @@
from instance_operation_cfs_param p from instance_operation_cfs_param p
where p.param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value=#arguments.paramValue#/> where p.param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value=#arguments.paramValue#/>
AND p.svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#qSvcOperationCfsParam.svc_operation_cfs_param_id#/> AND p.svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#qSvcOperationCfsParam.svc_operation_cfs_param_id#/>
<cfif isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)> <cfif structKeyExists(arguments,"instanceOperationCfsParamUid")>
AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#qSvcOperationCfsParam.instance_operation_cfs_param_uid# null=#!isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)#/> AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.instanceOperationCfsParamUid#/><!--- null=#!isValid("guid",arguments.instanceOperationCfsParamUid)# --->
</cfif> </cfif>
</cfquery> </cfquery>
<!--- <cfdump var=#qUnique#/> ---> <!--- <cfdump var=#qUnique#/><cfabort/> --->
<cfif qUnique.cnt GT 0> <cfif qUnique.cnt GT 0>
<!--- <cfreturn '#qSvcOperationCfsParam.svc_operation_cfs_param# = "#arguments.paramValue#" is not unique in the provider scope'/> ---> <!--- <cfreturn '#qSvcOperationCfsParam.svc_operation_cfs_param# = "#arguments.paramValue#" is not unique in the provider scope'/> --->
<cfthrow type="invalidParamValue" message='#qSvcOperationCfsParam.svc_operation_cfs_param# = "#arguments.paramValue#" is not unique in the provider scope'/> <cfthrow type="invalidParamValue" message='#qSvcOperationCfsParam.svc_operation_cfs_param# = "#arguments.paramValue#" is not unique in the provider scope'/>
@@ -300,8 +304,8 @@
where p.param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value=#arguments.paramValue#/> where p.param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value=#arguments.paramValue#/>
AND svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#qSvcOperationCfsParam.svc_operation_cfs_param_id#/> AND svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#qSvcOperationCfsParam.svc_operation_cfs_param_id#/>
AND u.usr_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#request.usr_id#/> AND u.usr_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#request.usr_id#/>
<cfif isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)> <cfif structKeyExists(arguments,"instanceOperationCfsParamUid")>
AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#qSvcOperationCfsParam.instance_operation_cfs_param_uid# null=#!isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)#/> AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.instanceOperationCfsParamUid#/> <!--- null=#!isValid("guid",arguments.instanceOperationCfsParamUid)# --->
</cfif> </cfif>
</cfquery> </cfquery>
<!--- <cfdump var=#qUnique#/> ---> <!--- <cfdump var=#qUnique#/> --->