put patch
This commit is contained in:
+1
-1
@@ -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.019";
|
variables.framework.docs.APIVersion="0.020";
|
||||||
|
|
||||||
variables.framework.globalHeaders = structNew();
|
variables.framework.globalHeaders = structNew();
|
||||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||||
|
|||||||
@@ -174,5 +174,40 @@
|
|||||||
<cfabort/> --->
|
<cfabort/> --->
|
||||||
<cfreturn representationOf(out) />
|
<cfreturn representationOf(out) />
|
||||||
</cffunction>
|
</cffunction>
|
||||||
|
|
||||||
|
|
||||||
|
<cffunction name="patch">
|
||||||
|
<cfargument name="instanceUid" type="string" required=true hint="type:guid"/>
|
||||||
|
<cfargument name="displayName" type="string" required=false hint="type:string"/>
|
||||||
|
<cfargument name="descr" type="string" required=false default="" hint="type:varchar (no cleanup here!)"/>
|
||||||
|
|
||||||
|
<!--- ****** проверка уникальности --->
|
||||||
|
<cftry>
|
||||||
|
<cfset this.helper.keyExistsAndValid(arguments, "instanceUid", "guid")/>
|
||||||
|
<cfquery name="local.qSave">
|
||||||
|
update instance set
|
||||||
|
dt_updated=<cfqueryparam cfsqltype="cf_sql_timestamp" value="#Now()#" />
|
||||||
|
,updater_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.usrId#" />
|
||||||
|
<cfif structKeyExists(arguments,"displayName")>
|
||||||
|
,display_name=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.displayName#" />
|
||||||
|
</cfif>
|
||||||
|
<cfif structKeyExists(arguments,"descr")>
|
||||||
|
,descr=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.descr#" />
|
||||||
|
</cfif>
|
||||||
|
where instance_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceUid#" />;
|
||||||
|
--select @@rowcount as cnt;
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
|
<!--- <cfif local.qSave.cnt EQ 0>
|
||||||
|
<cfreturn noData().withStatus(404, "Record Not Found") />
|
||||||
|
</cfif> --->
|
||||||
|
|
||||||
|
<cfcatch type="invalidParamValue">
|
||||||
|
<cfreturn representationOf(this.helper.formatBadRequestError(cfcatch)).withStatus(400)/>
|
||||||
|
</cfcatch>
|
||||||
|
</cftry>
|
||||||
|
|
||||||
|
<cfreturn noData().withStatus(204, "No Content") />
|
||||||
|
</cffunction>
|
||||||
|
|
||||||
</cfcomponent>
|
</cfcomponent>
|
||||||
@@ -94,5 +94,20 @@
|
|||||||
|
|
||||||
<cfreturn noData().withStatus(204, "No Content") />
|
<cfreturn noData().withStatus(204, "No Content") />
|
||||||
</cffunction>
|
</cffunction>
|
||||||
|
|
||||||
|
<cffunction name="put" hint="запись CFS параметра операции инстанса">
|
||||||
|
<cfargument name="instanceOperationCfsParamUid" type="string" required=true hint="type:guid"/>
|
||||||
|
<cfargument name="paramValue" type="string" required=true/>
|
||||||
|
|
||||||
|
<cfquery name="local.qSave" result="local.result">
|
||||||
|
update instance_operation_cfs_param set
|
||||||
|
dt_created=<cfqueryparam cfsqltype="cf_sql_timestamp" value="#Now()#" />
|
||||||
|
,creator_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.usrId#" />
|
||||||
|
,param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.paramValue#" />
|
||||||
|
where instance_operation_cfs_param_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceOperationCfsParamUid#" null=#!isValid('guid',arguments.instanceOperationCfsParamUid)#/>
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
|
<cfreturn noData().withStatus(204, "No Content") />
|
||||||
|
</cffunction>
|
||||||
|
|
||||||
</cfcomponent>
|
</cfcomponent>
|
||||||
Reference in New Issue
Block a user