Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

收集API需求 #31

Open
hstarorg opened this issue Feb 14, 2017 · 5 comments
Open

收集API需求 #31

hstarorg opened this issue Feb 14, 2017 · 5 comments

Comments

@hstarorg
Copy link
Member

hstarorg commented Feb 14, 2017

请各位把需要实现的API以评论的方式列举在下面,谢谢!

举例如下:

获取所有的职位信息(带分页,带搜索条件:名称/工作年限/学历,用于职位查找)

根据用户获取推荐的职位信息(带分页,用于首页数据,分页是为了懒加载)

@jikeytang
Copy link
Collaborator

格式类似:

Url: /user/login
Method: POST
Request:{
    header: {
        Content-Type:application/json
    },
    body: { // post 传递参数对象
        "name": "jikey"
    }
}
Response: {
    headers:{
        status: 200
    },
    body:{
        results: [{}, {}]
    }
}

@MrTreasure
Copy link
Contributor

MrTreasure commented Feb 15, 2017

获取用户收藏的职位列表,大部分是从已有键值中获取

Url: /user/jobCollection
Method: GET
Request:{
}
Response: {
    headers:{
        status: 200
    },
    body:[
    {
    "name": "媒介合作人及运营负责人",
    "city": "浦东新区-上海",
    "logoUrl": null,
    "salary": "15-20K",
    "comName": "上海客汗网络科技有限公司"
    },
    {
    "name": "媒介合作人及运营负责人",
    "city": "浦东新区-上海",
    "logoUrl": null,
    "salary": "15-20K",
    "comName": "上海客汗网络科技有限公司"
    },
    {
    "name": "媒介合作人及运营负责人",
    "city": "浦东新区-上海",
    "logoUrl": null,
    "salary": "15-20K",
    "comName": "上海客汗网络科技有限公司"
    }
  ]
}

@hstarorg
Copy link
Member Author

@MrTreasure 还需要描述下api的用途,如我的举例。具体的api格式,我们会参考数据表设计,进行返回。

@cangku
Copy link
Contributor

cangku commented Feb 20, 2017

API:发布职位

Url: /hr/job
Method: POST
Request:{
    header: {
        Content-Type:application/json
    },
    body: {
        "address": "天府三街",
        "category": "0001",
        "describle": "职位描述",
        "educational": "0001",
        "experience": "0004",
        "name": "职位名称",
        "nature": "0002",
        "salary": "0004"
    }
}
Response: {
    headers:{
        status: 200
    },
    body:{
        results: [{
            "address": "天府三街",
            "category": "0001",
            "describle": "职位描述",
            "educational": "0001",
            "experience": "0004",
            "name": "职位名称",
            "nature": "0002",
            "salary": "0004",
            ……
        }]
    }
}

提交数据来源于现在表单的设计,可能后续还需要优化,数据名称对于中文意义

"address" 工作地址
"category" 职位类别
"describle" 职位描述
"educational" 学历要求
"experience" 工作经验
"name" 职位名称
"nature" 职位性质
"salary" 月薪范围

上述字段中,职位类别、学历要求、工作经验、职位性质、月薪范围都是选项,选项数据都是死数据,职位类别看看是否也需要增加一个API来细分类别,还有参照现有数据库设计的工作地址也有一些出入,可以修改为可选前缀方案,只填写细节,或者接入地图方案,插入静态或者动态地图等。

API: 修改职位

Url: /hr/job
Method: PUT

Url: /hr/job
Method: PUT
Request:{
    header: {
        Content-Type:application/json
    },
    body: {
        "id": "1000001",
        ……
    }
}
Response: {
    headers:{
        status: 200
    },
    body:{
        results: [{
            "address": "天府三街",
            "category": "0001",
            "describle": "职位描述",
            "educational": "0001",
            "experience": "0004",
            "name": "职位名称",
            "nature": "0002",
            "salary": "0004",
            ……
        }]
    }
}

只是提交某指定ID需要修改的字段

API:职位状态改变(发布/下线)

Url: /hr/job
Method: PUT

Url: /hr/job
Method: PUT
Request:{
    header: {
        Content-Type:application/json
    },
    body: {
        "id": "1000001",
        "isOnline": 1
    }
}
Response: {
    headers:{
        status: 200
    },
    body:{
        results: [{
            "address": "天府三街",
            "category": "0001",
            "describle": "职位描述",
            "educational": "0001",
            "experience": "0004",
            "name": "职位名称",
            "nature": "0002",
            "salary": "0004",
            ……
        }]
    }
}

根据指定职位ID更新是否上线字段即可,以此判断是否上线

@hstarorg
Copy link
Member Author

@cangku Nice~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants