接口模型.md 7.7 KB

认证

登录

  • URL: /v1/auth/login
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "uid":3507839547244544
    }
  • 应答示例

    {
    "code": 0,
    "msg": "登录成功",
    "data": {
    "authCode": "f7641e7d1cb811ea942d000c29ad8d6d"
    }
    }

短信验证码

  • URL: /v1/auth/smsCode
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "phone":"18860180001"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "登录成功",
    "data":{}
    }

获取token

  • URL: /v1/auth/accessToken
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "clientId":"lks3Z8Ncn2j",
    "clientSecret":"gtfhyjukiol3Qncbvmdwe67khh",
    "authCode":"5251839614a611eaab01000c29ad8d6d"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "refreshToken": "8debc5a314a611eaab01000c29ad8d6d",
    "accessToken": "8debc59814a611eaab01000c29ad8d6d",
    "expiresIn": 3600
    }
    }

刷新token

  • URL: /v1/auth/refreshToken
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "clientId":"lks3Z8Ncn2j",
    "clientSecret":"gtfhyjukiol3Qncbvmdwe67khh",
    "refreshToken":"8debc5a314a611eaab01000c29ad8d6d"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "refreshToken": "8debc5a314a611eaab01000c29ad8d6d",
    "accessToken": "dd57fa4914a611eaab01000c29ad8d6d",
    "expiresIn": 3600
    }
    }

更新设备

  • URL: /v1/auth/updateDevice
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "clientId":"123456",
    "deviceToken":"123456"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "更新成功",
    "data": null
    }

注销登录

  • URL: /v1/auth/rovoke
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例 ```json {

}



* 应答示例
```json
{
  "code": 0,
  "msg": "成功",
  "data":{}
}

用户中心

修改手机号 检查手机验证码

  • URL: /v1/user/checkSmsCode
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "captcha":"252051"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data":{}
    }

修改手机号

  • URL: /v1/user/changePhone
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "phone":"18860180001",
    "captcha":"077163"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data":{}
    }

重置密码

  • URL: /v1/user/resetPassword
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "newPwd":"123456",
    "confirmPwd":"123456"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data":{}
    }

修改密码

  • URL: /v1/user/changePassword
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "newPwd":"1234567",
    "confirmPwd":"1234567",
    "oldPwd":"123456"
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data":{}
    }

用户信息

  • URL: /v1/user/userInfo
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "user": {
      "uid": 1,
      "uname": "Jennifer Clark",
      "phone": "18065048301",
      "image": {
        "path": "https://wx.qlogo.cn/mmopen/vi_32/AA24UDKOHgm9gy631bhPkjbrhQysEicjQLDibACO3DNksPpLuuwOYVhUPCDFud0W07wuICfkmhYng3ZtQo59Juzw/132",
        "w": 0,
        "h": 0
      },
      "department": "部门1",
      "position": "董事长",
      "imToken": "741df673c1671f8fad6d5d20adfa165e",
      "companyId": 1,
      "company": "test_company"
    }
    }
    }

公司列表

  • URL: /v1/user/userCompanys
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "companys": [
      {
        "id": 1,
        "name": "test_company"
      },
      {
        "id": 2,
        "name": "dyt_company"
      }
    ]
    }
    }

切换公司

  • URL: /v1/user/switchCompany
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "companyId":1
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {}
    }

机会

机会类型

  • URL: /v1/chance/chanceType
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "list": [
      {
        "id": 1,
        "name": "产品",
        "icon": ""
      },
      {
        "id": 2,
        "name": "渠道",
        "icon": ""
      },
      {
        "id": 3,
        "name": "客户",
        "icon": ""
      },
      {
        "id": 4,
        "name": "区域",
        "icon": ""
      },
      {
        "id": 5,
        "name": "其他",
        "icon": ""
      }
    ]
    }
    }

机会模板

  • URL: /v1/chance/templates
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "chanceTypeId":1
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "list": [
      {
        "id": 1,
        "name": "产品-1",
        "doc": "新型产品1",
        "icon": "",
        "formList": [
          {
            "id": 1,
            "name": "产品名称",
            "inputType": "text",
            "sectionType": 1,
            "value": "",
            "required": 0
          },
          {
            "id": 2,
            "name": "竞品",
            "inputType": "text",
            "sectionType": 2,
            "value": "",
            "required": 0
          }
        ]
      }
    ]
    }
    }

提交机会

  • URL: /v1/chance/submit
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "id":279802775016046593,
    "auditTemplateId": 1,
    "content": "是否素:是\n 出厂价格:¥100 \n",
    "formList": [{
            "lable": "是否素食",
            "inputType": "text",
            "section": 1,
            "value": ""
        },
        {
            "lable": "竞品",
            "inputType": "text",
            "section": 2,
            "value": ""
        }
    ],
    "speechs": [{
            "path": "www.xx.com/file/xx/xx...",
            "duration": 60
        },
        {
            "path": "www.xx.com/file/xx/xx...",
            "duration": 30
        }
    ],
    "pictures": [{
            "path": "www.xx.com/file/xx/xx...",
            "w": 600,
            "h": 600
        },
        {
            "path": "www.xx.com/file/xx/xx...",
            "w": 600,
            "h": 600
        }
    ],
    "videos": [{
            "path": "www.xx.com/file/xx/xx...",
            "cover": "www.xx.com/file/xx/xx...",
            "duration": 60
        },
        {
            "path": "www.xx.com/file/xx/xx...",
            "cover": "www.xx.com/file/xx/xx...",
            "duration": 30
        }
    ],
    "relatedDepartments": 1
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {}
    }

文件上传

上传图片

  • URL: /v1/upload/image
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例 json { }
form-data:  file
  • 应答示例 json { "code": 0, "msg": "成功", "data": { "paths": [ "http:/192.168.139.137:8080/file/opp/image/20191214/1576290273_H7WDQpksZyXaGxmwKQDC5T6mhQBMTF3M.png" ] } }

上传语音

  • URL: /v1/upload/voice
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例 json { }
form-data:  file
  • 应答示例 json { "code": 0, "msg": "成功", "data": { "paths": [ "http:/192.168.139.137:8080/file/opp/voice/20191214/1576290273_H7WDQpksZyXaGxmwKQDC5T6mhQBMTF3M.wav" ] } }

上传视频

  • URL: /v1/upload/video
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "paths": [
      "http:/192.168.139.137:8080/file/opp/video/20191214/1576290351_R3h4nQxxcMJ7ympktMsYBBQ6bAcFC6xj.mp3"
    ]
    }
    }

部门统计

部门列表

  • URL: /v1/department/departments
  • 格式: JSON
  • HTTP请求方式: POST
  • 请求示例

    {
    "type": 0
    }
  • 应答示例

    {
    "code": 0,
    "msg": "成功",
    "data": {
    "departments": [
      {
        "id": 1,
        "name": "部门1"
      }
    ]
    }
    }