yapi/doc/db_dict.md
2017-07-06 19:21:54 +08:00

1.9 KiB
Raw Blame History

数据库字典

数据库基于mongodb

1.User数据表表名:user

{
    _id:      (int)
    username: (string)
    password: (sha1)
    passsalt: (string)
    email   : (string)
    role    : (string)
    add_time: (int)
    up_time: (int)
}

2.Project 数据表,表名:project

{
    _id:          (int)
    uid :         (int)
    name:         (string)
    basepath:     (string)
    desc:         (string)
    group_id:     (int)
    members: [
        ...  //成员uid
    ]
    prd_host: (string)//网站上线的domain,可用来获取mock数据
    env:(object){
        'local环境' : 'http://127.0.0.1'
    }
    add_time:     (int)
    up_time:      (int)
}

3.api 数据表,表名:interface

{
    _id:   (int)
    uid:      (int)   //负责人uid
    path:     (string)
    group_id: (int)
    status:   (int)
    desc  :   (string)
    add_time: (int)
    up_time : (int)
    req_headers:(Object){
        "header_name":(Object){
            default_value: (string),
            desc:          (string),
            mock:          (string)
        }
    }
    req_params_type: (form|raw)
    req_params: (Object){
        "key" : (Object){
            default_value: (string),
            desc:          (string),
            mock:          (string)
        }
    }
    res_header: (Object){
        "header_name":(Object){
            default_value: (string),
            desc:          (string),
            mock:          (string)
        }
    }
    res_body_type: (text|json),
    res_body: (Object){
        "key":(Object){
            default_value: (string),
            desc:          (string),
            mock:          (string)
        }
    }
}

4.项目分组,表名: group

{
    _id:    (int),
    uid:    (int),
    group_name:  (string),
    group_desc:  (string),
    add_time: (int),
    up_time: (int)
}