插件处理web请求示例。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
987 B

package com.fr.plugin.demo.web.request.handler;
import com.fanruan.api.web.FlushKit;
import com.fr.decision.fun.impl.BaseHttpHandler;
import com.fr.third.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author Elijah
* @version 10.0.4
* Created by Elijah on 2019/11/15
*/
public class AdminHttpHandler extends BaseHttpHandler {
@Override
public RequestMethod getMethod() {
return RequestMethod.GET;
}
@Override
public String getPath() {
return "/demo/admin";
}
@Override
public boolean isPublic() {
return false;
}
public boolean needAdmin() {
return true;
}
@Override
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
FlushKit.printAsString(httpServletResponse, "这是个只有超管能访问的接口");
}
}