class ServiceEndpoint {
    @Autowired
    private ServiceResource serviceResource;

    @RequestMapping(path = "/discovery-type", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> discoveryType() {
        return doDiscoveryType();
    }

    @RequestMapping(path = "/groups", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> groups() {
        return doGroups();
    }

    @RequestMapping(path = "/group/{serviceId}", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> group(@PathVariable(value = "serviceId") String serviceId) {
        return doGroup(serviceId);
    }

    @RequestMapping(path = "/services", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> services() {
        return doServices();
    }

    @RequestMapping(path = "/service-list", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<?> serviceList(@RequestBody List<String> serviceTypes) {
        return doServiceList(serviceTypes);
    }

    @RequestMapping(path = "/service-list/{group}", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<?> serviceList(@PathVariable(value = "group") String group, @RequestBody List<String> serviceTypes) {
        return doServiceList(group, serviceTypes);
    }

    @RequestMapping(path = "/gateways", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> gateways() {
        return doGateways();
    }

    @RequestMapping(path = "/gateway-list", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<?> gatewayList(@RequestBody List<String> gatewayTypes) {
        return doGatewayList(gatewayTypes);
    }

    @RequestMapping(path = "/instances/{serviceId}", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> instances(@PathVariable(value = "serviceId") String serviceId) {
        return doInstances(serviceId);
    }

    @RequestMapping(path = "/instance-list/{serviceId}", method = RequestMethod.GET)
    @ResponseBody
    public ResponseEntity<?> instanceList(@PathVariable(value = "serviceId") String serviceId) {
        return doInstanceList(serviceId);
    }

    @RequestMapping(path = "/instance-map", method = RequestMethod.POST)
    @ResponseBody
    public ResponseEntity<?> instanceMap(@RequestBody List<String> groups) {
        return doInstanceMap(groups);
    }

    private ResponseEntity<?> doDiscoveryType() {
        try {
            String discoveryType = serviceResource.getDiscoveryType().toString();

            return ResponseUtil.getSuccessResponse(discoveryType);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doGroups() {
        try {
            List<String> groups = serviceResource.getGroups();

            return ResponseUtil.getSuccessResponse(groups);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doGroup(String serviceId) {
        try {
            String group = serviceResource.getGroup(serviceId);

            return ResponseUtil.getSuccessResponse(group);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doServices() {
        try {
            List<String> services = serviceResource.getServices();

            return ResponseUtil.getSuccessResponse(services);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doServiceList(List<String> serviceTypes) {
        try {
            List<ServiceType> types = new ArrayList<ServiceType>();
            for (String serviceType : serviceTypes) {
                types.add(ServiceType.fromString(serviceType));
            }

            List<String> services = serviceResource.getServiceList(types);

            return ResponseUtil.getSuccessResponse(services);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doServiceList(String group, List<String> serviceTypes) {
        try {
            List<ServiceType> types = new ArrayList<ServiceType>();
            for (String serviceType : serviceTypes) {
                types.add(ServiceType.fromString(serviceType));
            }

            List<String> services = serviceResource.getServiceList(group, types);

            return ResponseUtil.getSuccessResponse(services);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doGateways() {
        try {
            List<String> gateways = serviceResource.getGateways();

            return ResponseUtil.getSuccessResponse(gateways);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doGatewayList(List<String> gatewayTypes) {<FILL_FUNCTION_BODY>}

    private ResponseEntity<?> doInstances(String serviceId) {
        try {
            List<ServiceInstance> instances = serviceResource.getInstances(serviceId);

            return ResponseUtil.getSuccessResponse(instances);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doInstanceList(String serviceId) {
        try {
            List<InstanceEntity> instanceList = serviceResource.getInstanceList(serviceId);

            return ResponseUtil.getSuccessResponse(instanceList);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }

    private ResponseEntity<?> doInstanceMap(List<String> groups) {
        try {
            Map<String, List<InstanceEntity>> instanceMaps = serviceResource.getInstanceMap(groups);

            return ResponseUtil.getSuccessResponse(instanceMaps);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    }
}

        try {
            List<GatewayType> types = new ArrayList<GatewayType>();
            for (String gatewayType : gatewayTypes) {
                types.add(GatewayType.fromString(gatewayType));
            }

            List<String> gatewayList = serviceResource.getGatewayList(types);

            return ResponseUtil.getSuccessResponse(gatewayList);
        } catch (Exception e) {
            return ResponseUtil.getFailureResponse(e);
        }
    
<no_super_class>