lib/generators/resty/templates/Controller.java in resty-generators-0.1.0 vs lib/generators/resty/templates/Controller.java in resty-generators-0.2.0
- old
+ new
@@ -16,33 +16,33 @@
public interface <%= controller_class_name %>Controller extends RestService {
<% actions.each do |action|
case action_map[action]
when :get_all -%>
- @GET @Path('.json')
+ @GET @Path("/<%= table_name %>.json")
void <%= action %>(MethodCallback<List<<%= class_name %>>> callback);
-// @GET @Path('.json')
+// @GET @Path("/<%= table_name %>.json")
// void <%= action %>(MethodCallback<List<<%= class_name %>>> callback, @QueryParam("limit") int limit, @QueryParam("offset") int offset);
//
<% when :get_single -%>
- @GET<% unless options[:singleton] -%> @Path("/{id}.json")<% end %>
+ @GET<% unless options[:singleton] -%> @Path("/<%= table_name %>/{id}.json")<% end %>
void <%= action %>(<% unless options[:singleton] -%>@PathParam("id") int id, <% end -%>MethodCallback<<%= class_name %>> callback);
<% when :post -%>
- @POST @Path('.json')
+ @POST @Path("/<%= table_name %>.json")
void <%= action %>(<%= class_name %> value, MethodCallback<<%= class_name %>> callback);
<% when :put -%>
- @PUT<% unless options[:singleton] -%> @Path("/{id}.json")<% end %>
+ @PUT<% unless options[:singleton] -%> @Path("/<%= table_name %>/{id}.json")<% end %>
void <%= action %>(<% unless options[:singleton] -%>@PathParam("id") @Attribute("id") <% end -%><%= class_name %> value, MethodCallback<<%= class_name %>> callback);
<% when :delete -%>
- @DELETE @Path("/{id}.json")
+ @DELETE @Path("/<%= table_name %>/{id}.json")
void <%= action %>(@PathParam("id") @Attribute("id") <%= class_name %> value, MethodCallback<Void> callback);
<% else -%>
- @GET @Path("/<%= action %>.json")
+ @GET @Path("/<%= table_name %>/<%= action %>.json")
void <%= action %>(MethodCallback<Void> callback);
<% end
end -%>
}
\ No newline at end of file