Skip to content

Commit

Permalink
Add RestResource Template
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Fairchild committed Mar 14, 2016
1 parent fdc88d3 commit 76de279
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
36 changes: 36 additions & 0 deletions ApexClass/RestResourceApexClass.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@RestResource(urlMapping='/{{ url }}')
global with sharing class {{ api_name }} {

@HttpGet
global static {{ object_name }} show() {

{{ object_name }} obj;

return obj;

}

@HttpPost
global static {{ object_name }} create() {

{{ object_name }} obj;

return obj;

}

@HttpPut
global static {{ object_name }} updateObject() {

{{ object_name }} obj;

return obj;

}

@HttpDelete
global static void remove() {

}

}
25 changes: 24 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,30 @@
}
]
},
{
{
"name":"RestResource",
"file_name":"RestResourceApexClass.cls",
"description":"A RestResource class",
"author":"Michael Fairchild",
"params":[
{
"name":"api_name",
"description":"Apex Class API Name",
"default":"MyRestResourceApexClass"
},
{
"name":"object_name",
"description":"API name of the Standard or Custom Object",
"default":"Contact"
},
{
"name":"url",
"description":"URL Mapping",
"default":"contact"
}
]
},
{
"name":"Schedulable",
"file_name":"SchedulableApexClass.cls",
"description":"A Schedulable class",
Expand Down

0 comments on commit 76de279

Please sign in to comment.