[关闭]
@lina 2019-10-09T14:36:47.000000Z 字数 7486 阅读 385

闪签云 1.0 后台接口文档

列表项
秒云达 1.0 后台

1、项目约定

1.1 基本约定

1.1.1 API Base Url

1.1.2 鉴权字段(身份标识)

  • X-location : [string] 坐标 lng-lat 请求头带此字段
  • X-unique-key : [string] 服务端下发的标识,取window.uniqueKey 请求头带此字段
  • X-city : [string] 所在城市名称 请求头带此字段
  • X-platform-code : [string] 平台标识字段,所有请求均需要此字段,取window.platformCode 请求头带此字段

1.1.3 HTTP请求中字段要求

  • POST请求Content-Type为:Content-Type:application/x-www-form-urlencoded
  • 文件上传时Content-Type为:Content-Type:multipart/form-data
  • 对于:Content-Type:application/json:Content-Type:application/xml不保证完全支持,请谨慎使用

1.2 通用接口

1.2.1 通用接口URL

1.2.2 上传图片

通用图片上传文件服务

请求URL

POST
/image

请求参数

  • file : 文件

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. url: 'http://xxx'
  5. }
  6. }
  • url : [string] 文件的访问URL

1.2.3 验证码图片

注:请求图片时,需解析图片的cookie,不然无法认证

GET
/captcha

1.2.4 发送短信

POST
/verifycode

请求参数

  • captcha_code : [string] 图形验证码
  • phone : [string] 手机号

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

1.3 通用响应字段

1.3.1 状态字段

  • error_code: [int] 服务器状态码,0 为正常状态,异常状态待定。
  • error_message:[string] 错误信息,但 error_code 不为 0 时返回

1.3.2 数据字段

  • data: [object] 数据字段,所有响应数据都在此字段中
  • list: [array],当返回数据为列表时会将数据放在该字段

1.3.3 分页字段

  • page: [int] 当前页码,默认为1
  • total: [int] 总页数
  • pageSize: [int]
    每页数量:本项目常用page_size==10

示例

  1. {
  2. status: 0,
  3. msg: '',
  4. data: {
  5. list: [{
  6. key: value
  7. }],
  8. total: 23
  9. }
  10. }

2、数据结构

2.1 常用字段含义

2.1.1 性别字段

gender:[int]

0: 未知
1: 男
2: 女

2.1.2 是否启用状态

status: [int]

0:未启用
1:启用

2.1.3 签约状态

status: [int]

1签约申请,2待签约,3已签约,4已驳回,5已取消

2.2 核心结构

2.2.1 个人简历信息

  1. {
  2. real_name varchar(16) not null,
  3. phone varchar(16) not null,
  4. id_number varchar(32) not null comment '身份证',
  5. age int(3) default 0 not null comment '年龄',
  6. gender int(1) default 0 not null comment '0未知 1男 2女',
  7. nation varchar(12) default '' not null comment '民族',
  8. marital_sts int(1) not null comment ' 1未婚 2已婚 3离异',
  9. political_sts int(1) not null comment '1共产党员 2共青团员 3群众',
  10. acct_type int(1) not null comment '户口类型,0农村,1城市',
  11. acct_prc_id int null comment '户籍省份id',
  12. acct_prc_name varchar(16) null comment '户籍省份',
  13. acct_city_id int null comment '户籍城市id',
  14. acct_city_name varchar(12) null,
  15. acct_coy_id int null comment '户籍区/县id',
  16. acct_coy_name varchar(255) null comment '户籍区、县名称',
  17. acct_addr varchar(16) null comment '户籍详细地址',
  18. province_id int null,
  19. province_name varchar(12) null,
  20. city_id int null,
  21. city_name varchar(12) null,
  22. county_id int null,
  23. county_name varchar(255) null,
  24. addr varchar(255) null,
  25. em_contact_name varchar(16) null comment '紧急联系人姓名',
  26. em_contact_phone varchar(32) null comment '紧急联系人电话',
  27. em_contact_relationship varchar(32) null comment '与紧急联系人的关系',
  28. id_card_front varchar(256) null comment '身份证正面照片',
  29. id_card_back varchar(256) null comment '身份证反面照片'
  30. company_id int default 0 not null comment '所属用人单位id',(company对象里包含名称)
  31. work_pos varchar(16) null comment '岗位',
  32. work_exp 数组是工作经验,
  33. employee_edu 数组是学历信息
  34. }

2.2.2 签约信息

  1. {
  2. em_id int not null comment '签约人',
  3. employee 表示签约人信息,
  4. ad_user_id int not null comment '处理人id,管理员id',
  5. ad_user 表示管理员信息,
  6. work_pos varchar(16) default '' not null comment '岗位',
  7. company_id int default 0 not null comment '用人单位id'
  8. company 对象表示公司信息,
  9. entry_date date null comment '入职日期',
  10. contract_id int default 0 null comment '合同id',
  11. salary decimal(15, 2) default 0.00 not null comment '薪资',
  12. contract 对象合同信息,
  13. apply_time timestamp default CURRENT_TIMESTAMP not null comment '申请时间',
  14. status int(1) not null comment '1签约申请,2待签约,3已签约,4已驳回,5已取消',
  15. reason varchar(256) null comment '驳回原因',
  16. }

2.2.3 合同信息

  1. {
  2. contract_name varchar(32) not null comment '合同名称',
  3. contract_body varchar(32) not null comment '合同主体',
  4. company_id int not null comment '用人单位id',
  5. sign_year int(2) not null comment '合同年限',
  6. file_url varchar(64) not null comment '合同文件地址',
  7. status int(1) default 1 not null comment '0禁用,1启用',
  8. }

2.2.4 管理员信息

  1. {
  2. username varchar(32) not null,
  3. name varchar(16) null comment '姓名',
  4. phone varchar(16) null comment '电话',
  5. email varchar(32) null comment '邮箱',
  6. status int(1) default 1 not null comment '0 禁用,1启用',
  7. }

3、接口列表

3.1 签约管理

3.1.1 签约管理列表

请求URL

GET
/sign_apply

status参数必填

请求参数

  • keyword: [string] 关键字搜索姓名、手机号、证件号码 【非必填】
  • status: [int] 签约状态 【必填】
  • page: [string] 当前页数 【必填】
  • pageSize: [string] 每页数量【非必填】
  • start_date: [date] 入职日期 YYYY-MM-dd格式(只有已签约才有)【非必填】
  • end_date: [date] 入职日期 YYYY-MM-dd格式(只有已签约才有)【非必填】
  • company_id: [int] 用人单位id【非必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data":{
  5. list: [
  6. @签约信息
  7. ],
  8. total: 122 // 总数
  9. }
  10. }

3.1.2 拒绝签约

请求URL

PUT
/sign_apply/${apply_id}/reject

apply_id是列表下发的主键id,不是签约人的id

请求参数

  • reason: [string] 拒绝原因,长度最长为256 【必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "保存成功",
  4. "data": null
  5. }

3.1.3 转移给其他处理人

请求URL

PUT
/sign_apply/{apply_id}/migrate

请求参数

  • ad_user_id: [int] 转给具体哪个处理人,非自己 【必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "保存成功",
  4. "data": null
  5. }

3.1.4 发送合同

请求URL

PUT
/sign_apply/{apply_id}/send

请求参数

  • company_id: [int] 用人单位【必填】
  • addr: [string] 选择的地址【必填】
  • entry_date: [string] YYYY-MM-dd格式入职时间【必填】
  • work_pos: [string] 岗位【必填】
  • contract_id: [int] 合同id【必填】
  • salary: [int] 薪资【必填】
  • real_name: [string] 姓名 【必填】

响应

  1. {
  2. "status": 0,
  3. "data": null
  4. "msg": ""
  5. }

3.1.5 查看签约人简历信息

请求URL

GET
/employee/id

id为签约人id

请求参数

  1. {
  2. "status": 0,
  3. "data": {
  4. @签约人简历信息
  5. },
  6. "msg": ""
  7. }

3.1.6 编辑签约人简历信息

PUT
/employee/id

id为签约人id

请求参数

  • 基本信息字段: [string] 略
  • employee_edu: [array] 教育情况【必填】
  • work_exp: [array] 工作情况 【必填】

下面给出请求字段

  1. {
  2. "id": 1,
  3. "real_name": "贾向庭",
  4. "phone": "18801156569",
  5. "id_number": "362302199509204035",
  6. ...基本信息略
  7. "employee_edu": [
  8. {
  9. "id": 1,
  10. "em_id": 1,
  11. "school": "北京理工大学",
  12. "edu_type": "junior",
  13. "start_date": "2016-08-07",
  14. "end_date": "2019-08-29",
  15. "record_sts": 1,
  16. }
  17. ],
  18. "work_exp": [
  19. {
  20. "id": 1,
  21. "em_id": 1,
  22. "company": "依图科技",
  23. "work_pos": "测试",
  24. "salary": "年薪300w",
  25. "departure_reason": "2019-09-29",
  26. "start_date": "2019-08-31",
  27. "end_date": "2019-08-31",
  28. "record_sts": 1
  29. },
  30. {
  31. "id": 2,
  32. "em_id": 1,
  33. "company": "test",
  34. "work_pos": "test",
  35. "salary": "2019-08-07",
  36. "departure_reason": "2019-08-29",
  37. "start_date": "2019-08-31",
  38. "end_date": "2019-08-31",
  39. "record_sts": 1,
  40. }
  41. ]
  42. }

3.2 合同管理

3.2.1 合同列表

请求URL

GET
/contract

请求参数

  • page: [int] 获取页数【必填】
  • pageSize: [int] 每页大小,默认10 【非必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. list: [
  6. @合同信息
  7. ],
  8. total: 122 // 总数
  9. }
  10. }

3.2.2 新建合同

请求URL

POST
/contract

请求参数

  • contract_name: [string] 合同名称 最大32个字符 【必填】
  • contract_body: [string] 合同主体 最大32个字符 【必填】
  • sign_year: [int] 合同年限 0~99【必填】
  • company_id: [int] 公司id 【必填】
  • file_url: [string] 合同文件url 【必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null,
  5. }

3.2.3 编辑合同

POST
/contract/{id}

请求参数

  • contract_name: [string] 合同名称 最大32个字符 【必填】
  • contract_body: [string] 合同主体 最大32个字符 【必填】
  • sign_year: [int] 合同年限 0~99【必填】
  • company_id: [int] 公司id 【必填】
  • file_url: [string] 合同文件url 【必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null,
  5. }

3.2.4 启用禁用合同

请求URL

PUT
/contract/{id}/status

请求参数

  • status [int] 0禁用,1启用

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null,
  5. }

3.3 权限管理(处理人&管理员)

3.3.1 管理员列表

请求URL

GET
/manager

请求参数

  • page: [int] 获取页数【必填】
  • pageSize: [int] 每页大小,默认10 【非必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": {
  5. list: [
  6. @管理员信息
  7. ],
  8. total: 122 // 总数
  9. }
  10. }

3.3.2 新建管理员

请求URL

POST
/manager

请求参数

  • username: [string] 最少6位最大32个字符 【必填】
  • name: [string] 姓名 最大个字符 【必填】
  • phone: [int] 电话【必填】
  • password: [int] 最少6位 最大32个字符 【必填】
  • email: [string] 邮件 最大32个字符 【必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null,
  5. }

3.3.3 编辑管理员

POST
/manager/{id}

请求参数

  • username: [string] 最少6位最大32个字符 【必填】
  • name: [string] 姓名 最大个字符 【必填】
  • phone: [int] 电话【必填】
  • password: [int] 最少6位 最大32个字符 【必填】
  • email: [string] 邮件 最大32个字符 【必填】

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null,
  5. }

3.3.4 启用禁用管理员

请求URL

PUT
/manager/{id}/status

请求参数

  • status [int] 0禁用,1启用

响应

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null,
  5. }

3.4 其他接口

3.4.1 获取字典接口(例如获取学历的类型)

请求URL

GET
/dict/{dict_item}

dict_item为Edu_Type则表示获取学历类型的字典

请求参数

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": [
  5. {
  6. "dict_key": "junior",
  7. "dict_value": "初中"
  8. }, // 还有其他的,具体见dictionary表
  9. ],
  10. }

3.4.2 获取所有岗位

请求URL

GET
/work_pos

请求参数

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": [
  5. "A岗位", "B岗位","C岗位",
  6. ],
  7. }

3.4.3 岗位设置

请求URL

PUT
/work_pos

请求参数

  • work_pos: [string] A岗位,B岗位,C岗位 用逗号拼接
  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": null
  5. }

3.4.4 获取公司选择列表

请求URL

GET
/companies

请求参数

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": [
  5. {
  6. "id": 1,
  7. "company_name": "test",
  8. }
  9. ]
  10. }

3.4.4 获取人事专员选择列表

请求URL

GET
/handlers

请求参数

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": [
  5. {
  6. "id": 1,
  7. "name": "test",
  8. }
  9. ]
  10. }

3.5 用人单位(公司)

3.5.1 获取公司列表

只有id, company_name(长度最大32),addr(长度最大512,用英文逗号分隔)三个字段

/company get

/company post 新建

/company/{id} put 编辑
/company/{id} get 查看

3.6 实名认证

3.6.1 跳转实名认证的url(微信认证完会跳转到之前的写的实名认证页面)

请求URL

POST
/weixin/bind

见resources/views/verify.blade.php

  1. window.apiHost = '{{$apiHostType}}://{{$apiHostName}}';
  2. window.apiHostName = '{{$apiHostName}}';
  3. window.params = '{{$params}}}';

params包括userWechatIdreal_name,两个字段,name字段可能为空

3.6.2 提交实名认证信息

请求URL

POST
/esign/verify

请求参数

  • id_number: [string] 身份证
  • real_name: [string] 身份证
  • userWechatId: [string] user_wechat表主键的hashid的值
  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": [
  5. {
  6. "id": 1,
  7. "name": "test",
  8. }
  9. ]
  10. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注