[关闭]
@lina 2019-09-04T17:39:32.000000Z 字数 4588 阅读 456

闪签云 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 状态字段

  • status: [int] 服务器状态码,0 为正常状态,异常状态待定。
  • msg:[string] 错误信息&提示信息

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

POST
/weixin/login

请求参数

  • code: [string]
  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data":
  5. {
  6. "session_token": "xxxx", // 会话 token 信息
  7. "em_id": 0, // 为0表示未提交过简历信息,大于零得需要调用下面接口判断具体处于哪个状态
  8. }
  9. }

3.1.2 首页状态

请求URL

GET
/em_status

请求头需要有X-auth-token的信息

请求参数

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data":
  5. {
  6. "reason": "驳回原因",
  7. "company_name": "申请的公司名称",
  8. "status": 1, // 签约的状态,同表sign_apply中的状态,1签约申请,2待签约,3已签约,4已驳回,5已取消
  9. "verify_status": 0, // 实名认证状态,同user_wechat表中verify_status状态,0 待实名, 1实名中,2实名成功 3实名失败
  10. }
  11. }

3.2 简历相关

3.2.1 提交简历

请求URL

POST
/employee

请求头需要有X-auth-token的信息

请求参数

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

响应

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

3.2.2 更新简历(处于待签约和已签约不可以修改简历)

请求URL

PUT
/employee

其他内容和更新一致

3.2.3 获取简历

请求URL

GET
/employee

请求头需要有X-auth-token的信息

3.4 其他接口(基本上都要请求头上带上token)

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

GET
/handlers

请求参数

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

3.4.3 获取所有用人单位

请求URL

GET
/companies

请求参数

  1. {
  2. "status": 0,
  3. "msg": "",
  4. "data": [
  5. {
  6. 'id': 12,
  7. 'company_name': xxx
  8. }
  9. ]
  10. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注