Skip to content

Commit

Permalink
Completed API definition and stub implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mjunkin committed Nov 19, 2024
1 parent cc48930 commit c77936e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ca.bc.gov.nrs.vdyp.backend.v1.gen.model.ParameterDetailsMessage;
import ca.bc.gov.nrs.vdyp.backend.v1.model.ParameterDetailsMessageBuilder;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.SecurityContext;

public class HelpApiService {

public Response helpGet(SecurityContext securityContext) throws NotFoundException {
private static final Logger logger = LoggerFactory.getLogger(HelpApiService.class);

public List<ParameterDetailsMessage> helpGet(SecurityContext securityContext) throws NotFoundException {

logger.info("<helpGet");

List<ParameterDetailsMessage> messageList = new ArrayList<>();

Expand Down Expand Up @@ -477,6 +483,6 @@ public Response helpGet(SecurityContext securityContext) throws NotFoundExceptio
)
);

return Response.ok().entity(messageList).build();
return messageList;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.format.DateTimeFormatter;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package ca.bc.gov.nrs.vdyp.backend.v1.gen.api;

import java.util.List;

import ca.bc.gov.nrs.vdyp.backend.v1.api.HelpApiService;
import ca.bc.gov.nrs.vdyp.backend.v1.api.NotFoundException;
import ca.bc.gov.nrs.vdyp.backend.v1.api.factories.HelpApiServiceFactory;
import ca.bc.gov.nrs.vdyp.backend.v1.gen.model.ParameterDetailsMessage;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Response;

@Path("/v1/help")

Expand Down Expand Up @@ -54,7 +55,8 @@ public HelpApi(/* @Context ServletConfig servletContext */) {
code = 200, message = "OK", response = ParameterDetailsMessage.class, responseContainer = "List"
) }
)
public Response helpGet(/* @Context SecurityContext securityContext */) throws NotFoundException {
public List<ParameterDetailsMessage> helpGet(/* @Context SecurityContext securityContext */)
throws NotFoundException {
return delegate.helpGet(null /* securityContext */);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package ca.bc.gov.nrs.vdyp.backend.v1.gen.model;

import java.io.Serializable;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -30,7 +31,10 @@
@jakarta.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", date = "2024-11-12T09:52:55.097945-08:00[America/Vancouver]", comments = "Generator version: 7.9.0"
)
public class ParameterDetailsMessage {
public class ParameterDetailsMessage implements Serializable {

private static final long serialVersionUID = -4514646435523721853L;

public static final String JSON_PROPERTY_FIELD = "field";
@JsonProperty(JSON_PROPERTY_FIELD)
private String field;
Expand Down Expand Up @@ -77,7 +81,7 @@ public ParameterDetailsMessage shortDescription(String shortDescription) {
}

/**
* a brief description of the parameter&#39;s purpose
* a brief description of the parameter's purpose
*
* @return shortDescription
**/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package ca.bc.gov.nrs.vdyp.backend.v1.model;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ca.bc.gov.nrs.vdyp.backend.v1.gen.model.ParameterDetailsMessage;

public class ParameterDetailsMessageBuilder {

@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(ParameterDetailsMessageBuilder.class);

public static ParameterDetailsMessage build(
String field, String shortDescription, String parameterValue, String longDescription, String defaultValue
) {
Expand All @@ -14,6 +21,8 @@ public static ParameterDetailsMessage build(
m.setParameterValue(parameterValue);
m.setShortDescription(shortDescription);

// logger.info("built ParameterDetailsMessage {}", shortDescription);

return m;
}
}

0 comments on commit c77936e

Please sign in to comment.