feature: support search group & project in global system (#178)

* feat: add global search api

* featï: add global search menu
This commit is contained in:
vran
2022-05-16 08:55:41 +08:00
committed by GitHub
parent 59570a9ee6
commit ff3f2e111f
47 changed files with 227 additions and 49 deletions

View File

@@ -182,4 +182,8 @@ public interface Routes {
String GET_SQL_MOCK_DATA = BASE + "/groups/{groupId}/projects/{projectId}/mock_data/sql";
}
interface Search {
String SEARCH = BASE + "/search";
}
}

View File

@@ -0,0 +1,27 @@
package com.databasir.api;
import com.databasir.common.JsonData;
import com.databasir.core.domain.search.SearchService;
import com.databasir.core.domain.search.data.SearchResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@Validated
@Tag(name = "SearchController", description = "全局搜索 API")
public class SearchController {
private final SearchService searchService;
@GetMapping(Routes.Search.SEARCH)
@Operation(summary = "搜索")
public JsonData<SearchResponse> search(@RequestParam(name = "query") String keyword) {
return JsonData.ok(searchService.search(keyword));
}
}

View File

@@ -1 +0,0 @@
.left-menu:not(.el-menu--collapse){height:100vh}.databasir-nav{left:0;bottom:0}.databasir-main-header,.databasir-nav{position:fixed;transform:scale(1);top:0}.databasir-main-header{display:flex;justify-content:space-between;align-items:center;right:0;left:50px;padding:30px;margin-left:33px;background:#fff;z-index:100;border-color:#eee;border-width:0 0 1px 0;border-style:solid}.databasir{display:block}.databasir-main{position:relative;margin-left:60px;margin-top:80px;--el-main-padding:0px 20px 20px 20px}.databasir-main-expand{margin-left:50px}.databasir-main-content{max-width:95%;--el-main-padding:0px 20px 20px 20px}.h2{font-size:24px;color:#606266;margin-top:13px;margin-bottom:13px}.h2,.h3{font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,,Arial,sans-serif}.h3{font-size:20px;color:#909399;margin-top:18px;margin-bottom:18px}

View File

@@ -0,0 +1 @@
.left-menu:not(.el-menu--collapse){height:100vh}.search-item{padding:10px;width:99%;margin-bottom:12px;margin-right:12px;display:flex;justify-content:space-between;border-radius:8px}.search-item:hover{background-color:#f0f2f5}.search-item .jump{margin-right:8px}.search-container{max-height:420px;overflow-y:auto;overflow-x:hidden}.databasir-nav{left:0;bottom:0}.databasir-main-header,.databasir-nav{position:fixed;transform:scale(1);top:0}.databasir-main-header{display:flex;justify-content:space-between;align-items:center;right:0;left:50px;padding:30px;margin-left:33px;background:#fff;z-index:100;border-color:#eee;border-width:0 0 1px 0;border-style:solid}.databasir{display:block}.databasir-main{position:relative;margin-left:60px;margin-top:80px;--el-main-padding:0px 20px 20px 20px}.databasir-main-expand{margin-left:50px}.databasir-main-content{max-width:95%;--el-main-padding:0px 20px 20px 20px}.h2{font-size:24px;color:#606266;margin-top:13px;margin-bottom:13px}.h2,.h3{font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,,Arial,sans-serif}.h3{font-size:20px;color:#909399;margin-top:18px;margin-bottom:18px}

View File

@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.9effab81.js"></script><script defer="defer" type="module" src="/js/app.1aa391ea.js"></script><link href="/css/chunk-vendors.81898547.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fb0c8458.js" nomodule></script><script defer="defer" src="/js/app-legacy.18135b1d.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.4f3fe369.js"></script><script defer="defer" type="module" src="/js/app.7ac511a9.js"></script><link href="/css/chunk-vendors.81898547.css" rel="stylesheet"><link href="/css/app.ee11d130.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.572a3b83.js" nomodule></script><script defer="defer" src="/js/app-legacy.94b013ac.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long