vi icon indicating copy to clipboard operation
vi copied to clipboard

添加自定义resftful接口

Open ShengyuanLu opened this issue 5 years ago • 0 comments

你好,我想确认一个问题:我想下面加一个自己的resftful接口,例如:/@in/api/abc。 我目前的做法是新写一个类ABCHandler实现接口ViFunctionHandler,然后在VIApiHandler的构造方法里面添加注册:

 public VIApiHandler(){ 
         ...
        this.register(new CodeHandler());
        this.register(new ABCHandler()); // <-我添加的服务接口实现
 }

测试下来可以工作。请确认一下这种做法是不是合理?谢谢!

ShengyuanLu avatar Aug 13 '20 10:08 ShengyuanLu