(improvement)(Headless) Obtain model list of domain and subDomain (#982)

This commit is contained in:
LXW
2024-05-11 15:02:47 +08:00
committed by GitHub
parent 6268fa33f0
commit fb465b74f3

View File

@@ -1,5 +1,6 @@
package com.tencent.supersonic.headless.server.rest;
import com.google.common.collect.Lists;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.utils.UserHolder;
import com.tencent.supersonic.common.pojo.enums.AuthType;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@@ -80,6 +82,11 @@ public class ModelController {
return modelService.getModelList(modelFilter);
}
@GetMapping("/getAllModelByDomainId")
public List<ModelResp> getAllModelByDomainId(@RequestParam("domainId") Long domainId) {
return modelService.getAllModelByDomainIds(Lists.newArrayList(domainId));
}
@GetMapping("/getModelDatabase/{modelId}")
public DatabaseResp getModelDatabase(@PathVariable("modelId") Long modelId) {
return modelService.getDatabaseByModelId(modelId);