BJ-917: Add servlets

This commit is contained in:
a.romanov 2020-05-25 14:38:21 +03:00 committed by a.romanov
parent 5970d849f4
commit fa37fe0e30
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.rbkmoney.threeds.server.storage.servlet;
import com.rbkmoney.damsel.three_ds_server_storage.CardRangesStorageSrv;
import com.rbkmoney.threeds.server.storage.handler.CardRangesStorageHandler;
import com.rbkmoney.woody.thrift.impl.http.THServiceBuilder;
import lombok.RequiredArgsConstructor;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
@RequiredArgsConstructor
@WebServlet("/three-ds-server-storage/card-ranges")
public class CardRangesStorageServlet extends GenericServlet {
private final CardRangesStorageHandler handler;
private Servlet servlet;
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
servlet = new THServiceBuilder()
.build(CardRangesStorageSrv.Iface.class, handler);
}
@Override
public void service(
ServletRequest request,
ServletResponse response) throws ServletException, IOException {
servlet.service(request, response);
}
}

View File

@ -0,0 +1,33 @@
package com.rbkmoney.threeds.server.storage.servlet;
import com.rbkmoney.damsel.three_ds_server_storage.RReqTransactionInfoStorageSrv;
import com.rbkmoney.threeds.server.storage.handler.RReqTransactionInfoStorageHandler;
import com.rbkmoney.woody.thrift.impl.http.THServiceBuilder;
import lombok.RequiredArgsConstructor;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
@RequiredArgsConstructor
@WebServlet("/three-ds-server-storage/rreq-transaction-info")
public class RReqTransactionInfoStorageServlet extends GenericServlet {
private final RReqTransactionInfoStorageHandler handler;
private Servlet servlet;
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
servlet = new THServiceBuilder()
.build(RReqTransactionInfoStorageSrv.Iface.class, handler);
}
@Override
public void service(
ServletRequest request,
ServletResponse response) throws ServletException, IOException {
servlet.service(request, response);
}
}