Sha256: 555ad00bbb4a1c59935584165e008874522c3dd7962911dd729f83c914cdf3c5
Contents?: true
Size: 1.5 KB
Versions: 5
Compression:
Stored size: 1.5 KB
Contents
package <%= controllers_base_package %>; <% if action_map.values.member? :get_all -%> import java.util.List; <% end -%> import javax.ws.rs.*; import org.fusesource.restygwt.client.*; <% if name -%> import <%= models_base_package %>.<%= class_name %>; <% end -%> @Path("/<%= table_name %>") public interface <%= controller_class_name %>Controller extends RestService { <% actions.each do |action| case action_map[action] when :get_all -%> @GET void <%= action %>(MethodCallback<List<<%= class_name %>>> callback); // @GET // void <%= action %>(MethodCallback<List<<%= class_name %>>> callback, @QueryParam("limit") int limit, @QueryParam("offset") int offset); // <% when :get_single -%> @GET<% unless options[:singleton] -%> @Path("/{id}")<% end %> void <%= action %>(<% unless options[:singleton] -%>@PathParam("id") int id, <% end -%>MethodCallback<<%= class_name %>> callback); <% when :post -%> @POST void <%= action %>(<%= class_name %> value, MethodCallback<<%= class_name %>> callback); <% when :put -%> @PUT<% unless options[:singleton] -%> @Path("/{id}")<% end %> void <%= action %>(<% unless options[:singleton] -%>@PathParam("id") @Attribute("id") <% end -%><%= class_name %> value, MethodCallback<<%= class_name %>> callback); <% when :delete -%> @DELETE @Path("/{id}") void <%= action %>(@PathParam("id") @Attribute("id") <%= class_name %> value, MethodCallback<Void> callback); <% else -%> @GET void <%= action %>(MethodCallback<Void> callback); <% end end -%> }
Version data entries
5 entries across 5 versions & 1 rubygems