This commit is contained in:
msyu
2024-10-23 11:17:42 +03:00
commit ab5c944862
380 changed files with 55823 additions and 0 deletions
@@ -0,0 +1,28 @@
<cfcomponent extends="taffy.core.api">
<cfscript>
this.name = hash(getCurrentTemplatePath());
variables.framework = {};
variables.framework.debugKey = "debug";
variables.framework.reloadKey = "reload";
variables.framework.reloadPassword = "true";
variables.framework.serializer = "taffy.core.nativeJsonSerializer";
variables.framework.returnExceptionsAsJson = true;
function onApplicationStart(){
return super.onApplicationStart();
}
function onRequestStart(TARGETPATH){
return super.onRequestStart(TARGETPATH);
}
// this function is called after the request has been parsed and all request details are known
function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
// this would be a good place for you to check API key validity and other non-resource-specific validation
return true;
}
</cfscript>
</cfcomponent>
+6
View File
@@ -0,0 +1,6 @@
<!---
DO NOT DELETE THIS FILE
===============================
This file is necessary for Taffy to work, but should be blank.
All requests funnel through it, but are handled by framework internal functionality.
--->
@@ -0,0 +1,17 @@
<cfcomponent extends="taffy.core.resource" taffy:uri="/date" hint="Collection of dates">
<cffunction name="get" access="public" output="false" hint="Get some collection of dates">
<cfset var qry = queryNew("id,foo", "integer,date") />
<cfset var i = 0 />
<cfloop from="1" to="15" index="i">
<cfset tmp = queryAddRow(qry) />
<cfset tmp = querySetCell(qry, "id", i) />
<cfset tmp = querySetCell(qry, "foo", dateadd("s",RandRange(1, 5000),now())) />
</cfloop>
<cfreturn representationOf(queryToArray(qry)).withStatus(200) />
</cffunction>
</cfcomponent>
@@ -0,0 +1,27 @@
<cfcomponent extends="taffy.core.resource" taffy:uri="/dateCalback" hint="Collection of dates">
<cffunction name="formatDate" access="private" output="false" hint="Format dates in ISO 8601 format">
<cfargument name="row" type="any" required="yes" />
<cfif isDate(row.foo)>
<cfset row.foo = dateFormat(row.foo,'yyyy-mm-dd')&'T'&timeFormat(row.foo, 'HH:mm:ss.lZ')>
</cfif>
<cfreturn row>
</cffunction>
<cffunction name="get" access="public" output="false" hint="Get some collection of dates">
<cfset var qry = queryNew("id,foo", "integer,date") />
<cfset var i = 0 />
<cfloop from="1" to="15" index="i">
<cfset tmp = queryAddRow(qry) />
<cfset tmp = querySetCell(qry, "id", i) />
<cfset tmp = querySetCell(qry, "foo", dateadd("s",RandRange(1, 5000),now())) />
</cfloop>
<cfreturn representationOf(queryToArray(qry,formatDate)).withStatus(200) />
</cffunction>
</cfcomponent>