org 模块: - tenants 表 (UUID PK, name, slug, status, settings) - 完整 CRUD API: /api/v1/org/tenants - 多租户隔离 audit 模块: - audit_logs 表 (actor, action, resource, IP, 时间) - 查询 API: /api/v1/audit/logs (支持分页+筛选) - 按 tenant_id/user_id/action/resource 过滤
13 lines
388 B
Go
13 lines
388 B
Go
package domain
|
|
|
|
import "context"
|
|
|
|
type TenantRepository interface {
|
|
Create(ctx context.Context, tenant *Tenant) error
|
|
FindByID(ctx context.Context, id string) (*Tenant, error)
|
|
FindBySlug(ctx context.Context, slug string) (*Tenant, error)
|
|
FindAll(ctx context.Context) ([]Tenant, error)
|
|
Update(ctx context.Context, tenant *Tenant) error
|
|
Delete(ctx context.Context, id string) error
|
|
}
|