Add swagger.json to main/resources.
[aai/esr-server.git] / esr-mgr / src / main / java / org / onap / aai / esr / resource / ThirdpatySdncManager.java
index 1a3095c..8660ade 100644 (file)
@@ -21,9 +21,10 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
+import io.swagger.annotations.SwaggerDefinition;
 
 import org.eclipse.jetty.http.HttpStatus;
-import org.onap.aai.esr.entity.rest.ThirdPartySdncRestData;
+import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
 import org.onap.aai.esr.util.ExtsysUtil;
 import org.onap.aai.esr.wrapper.ThirdpatySdncWrapper;
 import org.slf4j.Logger;
@@ -40,16 +41,17 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+@SwaggerDefinition
 @Path("/sdncontrollers")
 @Api(tags = {"ThirdParty sdnc Management     "})
 public class ThirdpatySdncManager {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(ThirdpatySdncManager.class);
 
+  private static ExtsysUtil extsysUtil = new ExtsysUtil();
   /**
    *query all thirdParty sdnc.
    */
-  @Path("")
   @GET
   @ApiOperation(value = "get all thirdParty sdnc ")
   @Produces(MediaType.APPLICATION_JSON)
@@ -121,17 +123,16 @@ public class ThirdpatySdncManager {
       @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
           response = String.class)})
   @Timed
-  public Response updateThirdpartySdnc(@ApiParam(value = "thirdpartySdnc", required = true) ThirdPartySdncRestData thirdPartySdnc,
+  public Response updateThirdpartySdnc(@ApiParam(value = "thirdpartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc,
       @ApiParam(value = "sdnc id", required = true) @PathParam("thirdPartySdncId") String thirdPartySdncId) {
-    LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + ExtsysUtil.objectToString(thirdPartySdnc));
-    return ThirdpatySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc);
+    LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + extsysUtil.objectToString(thirdPartySdnc));
+    return ThirdpatySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc, thirdPartySdncId);
   }
   
   /**
    *thirdParty sdnc register.
    */
   @POST
-  @Path("")
   @Consumes(MediaType.APPLICATION_JSON)
   @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
   @ApiOperation(value = "register a thirdparty sdnc")
@@ -143,8 +144,8 @@ public class ThirdpatySdncManager {
       @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
           response = String.class)})
   @Timed
-  public Response registerThirdpatySdnc(@ApiParam(value = "thirdPartySdnc", required = true) ThirdPartySdncRestData thirdPartySdnc) {
-    LOGGER.info("start register sdnc" + " info:" + ExtsysUtil.objectToString(thirdPartySdnc));
+  public Response registerThirdpatySdnc(@ApiParam(value = "thirdPartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc) {
+    LOGGER.info("start register sdnc" + " info:" + extsysUtil.objectToString(thirdPartySdnc));
     return ThirdpatySdncWrapper.getInstance().registerThirdpartySdnc(thirdPartySdnc);
   }
 }