websprit / rop

rapid open platform

Home Page:https://itstamen@github.com/itstamen/rop.git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

   ROP is the Rapid Open Platform ,thus like the TOP(Taobao Open Platform:http://api.taobao.com).

   The Rest url of ROP  is thus like the following :

   1)http://yourhost?method=rop.user.add&v=1.0&param1=value1&param=value2...
   2)http://yourhost?method=rop.user.update&v=1.0&param1=value1&param=value2...

   ROP can router the request to the dest handler's api.You can use the 
@ServiceMethod("rop.user.add") annotation to mark the api method in the handler.
Handler must mark annotation @ServiceMethodBean, The remain thing to do is
using spring <context:component-scan/> to scan the package where the "ServiceMethodBeans"
in,Then ROP can auto detect the handlers and register the "ServiceMethods"

   There is a simple example:
--------------------------------------------------------------------
import com.rop.RopRequest;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;

@ServiceMethodBean <==1.Let it be ServiceMethodBean
public class SampleRestService {

    @ServiceMethod("sample.method1")  <==1.Let it be ServiceMethod
    public Object method1(SampleRopRequest1 request1) {
        SampleRopResponse1 response = new SampleRopResponse1();
        response.setCreateTime("20120101010101");
        response.setUserId("1");
        return response;
    }
}
--------------------------------------------------------------------
   The parameter's list of the api method must extends the RopRequest,and the
Return parameter can be any Object.
   The Rop can marshaller the response to the xml or json format output,you can
control the output format by "format" parameter.
   Good 2014!
   stame by 2012-3-1 Xiamen China