feat: add folder uploads and archives with simpler account and plan forms

This commit is contained in:
canglan committed 2026-11-15 18:57:02 +08:00
1 parent 9afd7d0067
commit faaa614cee
41 files changed
+1027 -71

No files matched your search

+2 -1
View File
@@ -12,6 +12,7 @@ import (
// references cannot accidentally grant access to a different customer.
type AccountProfile struct {
ID uint64 `json:"id"`
LoginName string `json:"loginName"`
Slug string `json:"slug"`
Name string `json:"name"`
Email string `json:"email"`
@@ -21,7 +22,7 @@ type AccountProfile struct {
func (s *Store) AccountProfile(ctx context.Context, id uint64) (AccountProfile, error) {
var p AccountProfile
err := s.db.QueryRowContext(ctx, `SELECT t.id,t.slug,t.name,u.email,u.display_name,(SELECT COUNT(*) FROM projects WHERE owner_tenant_id=t.id) FROM tenants t JOIN users u ON u.tenant_id=t.id AND u.role='tenant' WHERE t.id=? AND t.resource_namespace=FALSE AND t.deleted_at IS NULL ORDER BY u.id LIMIT 1`, id).Scan(&p.ID, &p.Slug, &p.Name, &p.Email, &p.DisplayName, &p.ProjectCount)
err := s.db.QueryRowContext(ctx, `SELECT t.id,t.slug,t.name,u.email,u.display_name,COALESCE(u.login_name,u.email),(SELECT COUNT(*) FROM projects WHERE owner_tenant_id=t.id) FROM tenants t JOIN users u ON u.tenant_id=t.id AND u.role='tenant' WHERE t.id=? AND t.resource_namespace=FALSE AND t.deleted_at IS NULL ORDER BY u.id LIMIT 1`, id).Scan(&p.ID, &p.Slug, &p.Name, &p.Email, &p.DisplayName, &p.LoginName, &p.ProjectCount)
if errors.Is(err, sql.ErrNoRows) {
err = ErrNotFound
}