platuml-demo.md 4.8 KB


html: embed_local_images: false embed_svg: true offline: false toc: false

print_background: false export_on_save:

html: true

@startuml
!define table(x) class x << (T,orchid) >>
!define primary_key(x) <u>x</u>
hide methods
hide stereotypes

table(User) {
    primary_key(id) : int "用户ID"
    phone : string(11) "手机号"
    name : string(100) "姓名"
    avatar : string(255) "头像URL"
    gender : string(1) "性别 M/F"
    birthdate : datetime "出生日期"
    created_at : datetime "创建时间"
    updated_at : datetime "更新时间"
    status : int "状态: 0-未激活, 1-活跃, 2-禁用"
}

table(UserAddress) {
    primary_key(id) : int "地址ID"
    user_id : int "用户ID"
    province : string(100) "省份"
    city : string(100) "城市"
    district : string(100) "区县"
    address : string(255) "详细地址"
    postal_code : string(6) "邮政编码"
    contact_name : string(100) "联系人姓名"
    contact_phone : string(11) "联系人电话"
    is_default : boolean "是否默认地址"
}

table(Technician) {
    primary_key(id) : int "技师ID"
    name : string(100) "姓名"
    phone : string(11) "手机号"
    avatar : string(255) "头像URL"
    gender : string(1) "性别 M/F"
    id_card : string(18) "身份证号"
    qualification : string(255) "资格证书"
    status : int "状态: 0-离线, 1-在线, 2-服务中"
    created_at : datetime "创建时间"
}

table(TechnicianCertificate) {
    primary_key(id) : int "证书ID"
    technician_id : int "技师ID"
    cert_type : string(50) "证书类型"
    cert_no : string(50) "证书编号"
    cert_image : string(255) "证书图片URL"
    issue_date : datetime "发证日期"
    expire_date : datetime "过期日期"
}

table(TechnicianSkill) {
    primary_key(id) : int "技能ID"
    technician_id : int "技师ID"
    skill_name : string(100) "技能名称"
    level : int "技能等级"
}

table(Order) {
    primary_key(id) : int "订单ID"
    user_id : int "用户ID"
    technician_id : int "技师ID"
    total_amount : decimal(10,2) "总金额"
    status : int "状态: 0-待确认, 1-已确认, 2-进行中, 3-已完成, 4-已取消"
    order_time : datetime "下单时间"
    appointment_time : datetime "预约时间"
    address : string(255) "服务地址"
}

table(OrderService) {
    primary_key(id) : int "订单服务ID"
    order_id : int "订单ID"
    service_name : string(100) "服务名称"
    price : decimal(10,2) "价格"
    quantity : int "数量"
}

table(OrderEvaluation) {
    primary_key(id) : int "评价ID"
    order_id : int "订单ID"
    rating : int "评分"
    comment : string(255) "评论"
    created_at : datetime "创建时间"
}

table(Wallet) {
    primary_key(id) : int "钱包ID"
    user_id : int "用户ID"
    balance : decimal(10,2) "余额"
    status : int "状态: 0-冻结, 1-正常"
    created_at : datetime "创建时间"
}

table(WalletTransaction) {
    primary_key(id) : int "交易ID"
    wallet_id : int "钱包ID"
    amount : decimal(10,2) "金额"
    type : int "类型: 1-充值, 2-消费, 3-提现, 4-退款"
    description : string(255) "描述"
    transaction_date : datetime "交易日期"
}

table(Shop) {
    primary_key(id) : int "店铺ID"
    name : string(100) "名称"
    logo : string(255) "Logo URL"
    address : string(255) "地址"
    phone : string(11) "电话"
    status : int "状态: 0-关闭, 1-营业"
    created_at : datetime "创建时间"
}

table(ShopService) {
    primary_key(id) : int "服务ID"
    shop_id : int "店铺ID"
    service_name : string(100) "服务名称"
    price : decimal(10,2) "价格"
    description : string(255) "描述"
    status : int "状态: 0-下架, 1-上架"
}

table(Tenant) {
    primary_key(id) : int "租户ID"
    name : string(100) "名称"
    code : string(50) "编码"
    status : int "状态: 0-禁用, 1-启用"
    created_at : datetime "创建时间"
}

table(TenantConfig) {
    primary_key(id) : int "配置ID"
    tenant_id : int "租户ID"
    config_key : string(50) "配置键"
    config_value : string(255) "配置值"
}

User "1" -- "1..*" UserAddress
User "1" -- "0..*" Order
User "1" -- "1" Wallet
Technician "1" -- "0..*" TechnicianCertificate
Technician "1" -- "0..*" TechnicianSkill
Technician "1" -- "0..*" Order
Order "1" -- "0..*" OrderService
Order "1" -- "0..1" OrderEvaluation
Shop "1" -- "0..*" ShopService
Tenant "1" -- "0..*" TenantConfig

@enduml