cd-it-job
cd-it-job copied to clipboard
收集API需求
请各位把需要实现的API以评论的方式列举在下面,谢谢!
举例如下:
获取所有的职位信息(带分页,带搜索条件:名称/工作年限/学历,用于职位查找)
根据用户获取推荐的职位信息(带分页,用于首页数据,分页是为了懒加载)
格式类似:
Url: /user/login
Method: POST
Request:{
header: {
Content-Type:application/json
},
body: { // post 传递参数对象
"name": "jikey"
}
}
Response: {
headers:{
status: 200
},
body:{
results: [{}, {}]
}
}
获取用户收藏的职位列表,大部分是从已有键值中获取
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": "上海客汗网络科技有限公司"
}
]
}
@MrTreasure 还需要描述下api的用途,如我的举例。具体的api格式,我们会参考数据表设计,进行返回。
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更新是否上线字段即可,以此判断是否上线
@cangku Nice~