Skip to content

Commit

Permalink
tmp storage
Browse files Browse the repository at this point in the history
  • Loading branch information
xdu-chenrj committed Sep 27, 2024
1 parent 516baae commit 505bf13
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 689 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
package org.apache.dolphinscheduler.api.controller;

public class OtherSystemController {
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.K8sNamespaceService;
import org.apache.dolphinscheduler.api.service.OtherSystemService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.core.config.OtherSystemInfo;
import org.apache.dolphinscheduler.dao.entity.K8sNamespace;
import org.apache.dolphinscheduler.dao.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static org.apache.dolphinscheduler.api.enums.Status.QUERY_CAN_USE_K8S_NAMESPACE_ERROR;

/**
* otherSystem controller
*
*/
@Tag(name = "OTHER_SYSTEM_TAG")
@RestController
@RequestMapping("/other-system")
public class OtherSystemController extends BaseController {

@Autowired
private OtherSystemService otherSystemService;

@Operation(summary = "queryOtherSystemList", description = "QUERY_OTHER_SYSTEM_LIST")
@GetMapping(value = "/query-all-list")
@ResponseStatus(HttpStatus.OK)
public Result queryOtherSystemList() {
List<OtherSystemInfo> result = otherSystemService.selectOtherSystemList();
return success(result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.dolphinscheduler.api.service;

import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.core.config.OtherSystemInfo;
import org.apache.dolphinscheduler.dao.entity.K8sNamespace;
import org.apache.dolphinscheduler.dao.entity.User;

Expand All @@ -29,68 +30,11 @@
*/
public interface OtherSystemService {

/**
* query namespace list paging
*
* @param loginUser login user
* @param pageNo page number
* @param searchVal search value
* @param pageSize page size
* @return k8s namespace list
*/
Result queryListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize);

/**
* register namespace in db,need to create namespace in k8s first
*
* @param loginUser login user
* @param namespace namespace
* @param clusterCode k8s not null
* @return
*/
Map<String, Object> registerK8sNamespace(User loginUser, String namespace, Long clusterCode);

/**
* verify namespace and k8s
*
* @param namespace namespace
* @param clusterCode cluster code
* @return true if the k8s and namespace not exists, otherwise return false
*/
Result<Object> verifyNamespaceK8s(String namespace, Long clusterCode);

/**
* delete namespace by id
*
* @param loginUser login user
* @param id namespace id
* @return
*/
Map<String, Object> deleteNamespaceById(User loginUser, int id);

/**
* query unauthorized namespace
*
* @param loginUser login user
* @param userId user id
* @return the namespaces which user have not permission to see
*/
Map<String, Object> queryUnauthorizedNamespace(User loginUser, Integer userId);

/**
* query unauthorized namespace
*
* @param loginUser login user
* @param userId user id
* @return namespaces which the user have permission to see
*/
Map<String, Object> queryAuthorizedNamespace(User loginUser, Integer userId);

/**
* query namespace can use
*
* @param loginUser login user
* @return namespace list
*/
List<K8sNamespace> queryNamespaceAvailable(User loginUser);
List<OtherSystemInfo> selectOtherSystemList();

}
Loading

0 comments on commit 505bf13

Please sign in to comment.