Skip to content

Commit

Permalink
[INLONG-11391][Manager] Add openAPI for adding data add tasks (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweng11 authored Oct 23, 2024
1 parent 1272609 commit 1bdc9e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,16 @@ public InlongGroupTopicInfo getTopic(String id) {
throw new RuntimeException(response.getErrMsg());
}

public String getTenant(String groupId) {
Response<String> response = ClientUtils.executeHttpCall(inlongGroupApi.getTenant(groupId));
if (response.isSuccess()) {
return response.getData();
} else if (response.getErrMsg().contains("not exist")) {
return null;
}
throw new RuntimeException(response.getErrMsg());
}

public List<InlongGroupTopicInfo> listTopics(InlongGroupTopicRequest request) {
Response<List<InlongGroupTopicInfo>> response =
ClientUtils.executeHttpCall(inlongGroupApi.listTopics(request));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public interface InlongGroupApi {
@GET("group/countByStatus")
Call<Response<Object>> countGroupByUser();

@GET("group/getTenant/{groupId}")
Call<Response<String>> getTenant(@Path("groupId") String groupId);

@GET("group/getTopic/{id}")
Call<Response<Object>> getTopic(@Path("id") String id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.inlong.manager.pojo.common.BatchResult;
import org.apache.inlong.manager.pojo.common.PageResult;
import org.apache.inlong.manager.pojo.common.Response;
import org.apache.inlong.manager.pojo.source.DataAddTaskRequest;
import org.apache.inlong.manager.pojo.source.SourcePageRequest;
import org.apache.inlong.manager.pojo.source.SourceRequest;
import org.apache.inlong.manager.pojo.source.StreamSource;
Expand Down Expand Up @@ -129,4 +130,11 @@ public Response<Boolean> restart(@PathVariable Integer id) {
boolean result = sourceService.restart(id, LoginUserUtils.getLoginUser().getName());
return Response.success(result);
}

@RequestMapping(value = "/source/addDataAddTask", method = RequestMethod.POST)
@ApiOperation(value = "Add supplementary recording task for stream source")
public Response<List<Integer>> addSub(@RequestBody DataAddTaskRequest request) {
return Response.success(sourceService.addDataAddTask(request, LoginUserUtils.getLoginUser().getName()));
}

}

0 comments on commit 1bdc9e2

Please sign in to comment.