forked from EduCraft/curriculum-project-hub
3a50ed0ce2
- Hierarchy.lean: Platform/Organization/User struct, 三层主体层级 - User.lean: FeishuProfile, 飞书身份是绑定不是本体 - User struct: id/displayName/passwordHash/feishu - Organization.lean: OrganizationRole(owner/admin/member) + 成员管理规则 - Prelude.lean: UserId/FeishuOpenId/FeishuConnectionId 实现偏离: spec 钉 User 为独立实体, 实现 User.id 由飞书身份派生 lake build 35/35 全绿
26 lines
803 B
Lean4
26 lines
803 B
Lean4
import Spec.Prelude
|
|
|
|
/-!
|
|
# User —— 飞书绑定
|
|
|
|
飞书身份是用户的绑定(登录途径),不是用户本体。用户实体见 `Hierarchy.User`。
|
|
用户创建当前只钉管理员直接创建;飞书自助注册→管理员审批未钉死(`OPEN`)。
|
|
-/
|
|
|
|
namespace Spec.System
|
|
|
|
variable (I : Identifiers)
|
|
|
|
/-- 飞书用户信息(`PINNED`)。User 上的可选飞书绑定载荷。 -/
|
|
structure FeishuProfile where
|
|
/-- 飞书 open_id(`OPEN` 表示;单应用作用域内唯一)。 -/
|
|
openId : I.FeishuOpenId
|
|
/-- 绑定所属飞书应用连接(`PINNED`;org-scoped,不可跨 org)。 -/
|
|
connection : I.FeishuConnectionId
|
|
/-- 飞书显示名(`OPEN`;是否预填 displayName 未定)。 -/
|
|
name : Option String
|
|
/-- 飞书头像 URL(`OPEN`)。 -/
|
|
avatarUrl : Option String
|
|
|
|
end Spec.System
|