feat: import Sea vHost single-server testing release
This commit is contained in:
commit
248badd33e
441 files changed
+63221
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package httpapi
|
||||
|
||||
import "net/http"
|
||||
|
||||
func (s *Server) resources(w http.ResponseWriter, r *http.Request) {
|
||||
user := currentUser(r)
|
||||
tenantID := *user.TenantID
|
||||
domains, err := s.store.ListDomains(r.Context(), tenantID, user.ProjectID)
|
||||
if err != nil {
|
||||
writeError(w, http.StatusInternalServerError, "无法读取域名资源")
|
||||
return
|
||||
}
|
||||
ftpAccounts, err := s.store.ListFTPResources(r.Context(), tenantID, user.ProjectID)
|
||||
if err != nil {
|
||||
writeError(w, http.StatusInternalServerError, "无法读取 FTP 资源")
|
||||
return
|
||||
}
|
||||
databases, err := s.store.ListDatabaseResources(r.Context(), tenantID, user.ProjectID)
|
||||
if err != nil {
|
||||
writeError(w, http.StatusInternalServerError, "无法读取数据库资源")
|
||||
return
|
||||
}
|
||||
sites, err := s.store.ListTenantSites(r.Context(), tenantID, user.ProjectID)
|
||||
if err != nil {
|
||||
writeError(w, http.StatusInternalServerError, "无法读取网站资源")
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, map[string]any{"domains": domains, "ftpAccounts": ftpAccounts, "databases": databases, "sites": sites})
|
||||
}
|
||||
Reference in new issue
Block a user