deploy debug 3 test2 added
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/test2">
|
||||
|
||||
<cfsilent>
|
||||
<cfimport prefix="m" taglib="../lib"/>
|
||||
<cfset this.helper=CreateObject("component","lib.rest_api_helper")/>
|
||||
</cfsilent>
|
||||
|
||||
|
||||
<cffunction name="get" hint="попробуем авторизоваться у элмы">
|
||||
<!--- <cfargument name="svcOperationId" required=true hint="int"/> --->
|
||||
<!--- <cftry>
|
||||
<cfset this.helper.validateField(arguments, "svcOperationId", "integer")/>
|
||||
<cfcatch type="invalidParamValue">
|
||||
<cfreturn representationOf(this.helper.formatBadRequestError(cfcatch)).withStatus(400)/>
|
||||
</cfcatch>
|
||||
</cftry> --->
|
||||
<!--- <cfdump var=#request#/><cfabort/>--->
|
||||
<cfset var auth="Bearer eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55IjoiaGVhZCIsInVzZXJJZCI6ImQ3MjUzMGUxLTY2YTQtNDEyZi1hMDQ2LTM4MTUzYzRlNTQwNSIsIm93bmVyIjpmYWxzZSwiaXNQb3J0YWwiOmZhbHNlLCJzZXNzaW9uSWQiOiI0ZTVmNjVkMC00YTdkLTVkZWQtYjNkYi1iY2ZiMzkyNjk5MDIiLCJwcml2aWxlZ2VzIjpbInN5c3RlbSIsImFkbWluaXN0cmF0aW9uIl0sIm5lZWRDaGFuZ2VQYXNzd29yZCI6ZmFsc2UsImNyZWF0ZWRBdCI6MTcyOTI1ODk4NiwiaXNzIjoiYXBpIiwiZXhwIjoxNzMxNjc4MjQ2LCJpYXQiOjE3MjkyNTg5MjZ9.asqG8SBCI7ih_10QDya7H1VlXr3rLDfoxlfvMPwQ7sPO3N1y4_vqMFy7T5kOKkXC495WjHDZZLe169ABUVvpkOD1oyTfXiyaDDlW0hW0BXWXWL-ktm6C_Dejz_GK9toRz2CheADiBdSmjBFQVYWriwrPijWD0nVZW9d5q9yhP7s"/>
|
||||
<cfif structKeyExists(request._taffyrequest.headers,"Authorization")>
|
||||
<cfset auth=request._taffyrequest.headers.Authorization/>
|
||||
</cfif>
|
||||
|
||||
<cfhttp method="get"
|
||||
url="https://personal-cabinet.adl.nubes.ru/api/v1/user"
|
||||
<!--- multipart=true
|
||||
multipartType="form-data" --->
|
||||
timeout="3"
|
||||
charset="utf-8"
|
||||
result="userdata"
|
||||
>
|
||||
<cfhttpparam type="HEADER" name="Authorization" value="#auth#"/>
|
||||
<cfhttpparam type="HEADER" name="Accept" value="application/json"/>
|
||||
<!--- <cfhttpparam type="formfield" name="delay" value="0sec"/>
|
||||
<cfloop query="qInstanceOperationParam">
|
||||
<cfhttpparam type="formfield" name="#param#" value="#param_value#"/>
|
||||
</cfloop> --->
|
||||
</cfhttp>
|
||||
<!--- <cfdump var=#userdata#/><cfabort/> --->
|
||||
|
||||
<cfset var out=structNew("linked")/>
|
||||
<cfset "out.test"="ttttttttttttttttttttttttt"/>
|
||||
<cfset "out.userdata"=deserializeJson(userdata.filecontent)/>
|
||||
|
||||
|
||||
<!--- https://blog.rabu.me/rest-api-taffy-jwt/ --->
|
||||
|
||||
<cfset "out.queryDurationMs"=getTickCount() - request.startTickCount/>
|
||||
|
||||
<cfset "out.runDurationMs"=getTickCount() - request.startTickCount/>
|
||||
<cfreturn representationOf(out) />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
Reference in New Issue
Block a user