openapi: 3.0.0
info:
  version: 2.0.0
  title: iLabservice Intelab
  description: >
    # Intelab API Server 接口定义 2.0.

    ## 默认参数

    绝大部分 Model 定义中, id 字段在 POST 方法中是不需要的. 在 get方法中, 如果获取的是 list, 应该加上分页的参数, 比如(
    offset, limit), 或者( page, pagesize)


    ##  HTTP 返回值

    400 请求本身为非法, 例如, 请求所含的参数非法, 请求中缺少了必要参数


    401 无权限. 发出请求的用户的角色没有改请求对应操作的权限.


    409 请求对应的操作和资源当前的状态冲突, 一般只对 PUT/DELETE 有效. 例如, 一个租赁开始了之后, 是不能被修改的.


    200 其他情况. 说明请求本身是成功的, 即使实际操作并不成功. 例如, 添加一个租赁到一个已经被占用的时间段. 请求的 HTTP status
    会是200, 不过在返回的对象里会具体描述.


    ## API 返回对象

    所有的请求都会返回一个 json 对象, 含有三个 items.  code, message, data.


    data: 包含API 定义里的返回对象.


    code: 对于成功的操作其 code 值为0, 如果不成功, code 为一个正整数. 相当于一个错误的 ID 值, 对应一种错误.


    message: 具体错误的文字描述


    ## 多语言

    支持 HTTP header "x-language", 值为 english, chinese. 返回值中的描述部分, 会根据语言而不同


    ## 接口说明

    所有带admin的接口都需要管理平台的角色来调用，customer则允许公司的用户调用
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
servers:
  - url: 'xxx.ilabservice.cloud:8999/api/v2'
tags:
  - name: unsecure
    description: 'unsecure api, 不需要配合token一起使用，允许直接调用, 基本路径为 /unsecure'
  - name: secure
    description: >
      * 登录后用户会拿到一个token，有效期默认为300分钟, 不同的用户角色有不同的有效期.

      * Refresh Token用来刷新登录用户的token，有效期为600分钟，时间都允许自定义

      * 所有 secure api,  配合令牌才能使用, 基本路径为 /secure.

      使用令牌的方式是在请求中加上 Header {"X-Authorization": "Bearer token"}. 如果 token 过期,
      会返回标准的 http status 的 json 形式.

      { "status": 401, "message": "Token has expired", "code": 11 }
  - name: customer
    description: 'under secure, 供用户在ilabservice 公司平台调用. 基本路径为 /secure/admin'
  - name: admin
    description: 'under secure, 仅供ilabservice 系统管理员在管理平台调用. 基本路径为 /secure/admin'
  - name: company
    description: '公司, 此类对象由 admin 控制. 用户只能看到自己的公司.'
  - name: feature
    description: '产品功能. 每一个公司可以根据需求购买不同的功能模块, 只有购买了之后, 该公司的用户才能使用该功能, 例如: 利用率统计'
  - name: department
    description: '部门, 此类对象由公司 admin 控制'
  - name: user
    description: '账户, 用户的管理员可以添加删除输入该公司的用户账户. admin 无权修改.'
  - name: role
    description: '角色, 此类对象由admin控制, 用户不能增删, 只能查看, 分配角色给用户.'
  - name: permission
    description: '权限, 此类对象由admin控制, admin 需要分配权限给角色.'
  - name: measure_type
    description: '监控参数类型, 例如 温度, CO2. 此类对象由admin控制, 用户不能增删, 只能查看.'
  - name: monitor_template
    description: '监控模板, 一个模板对应一组监控参数, 传感器, 监控规则, 运行状态模型. 创建监控对象的时候可以指定一个模板, 这样这个对象会有这个模板下的所有监控信息. 此类对象由admin控制, 用户不能增删, 只能查看.'
  - name: monitor_target_lab_device
    description: '监控对象, 冰箱-001, 储藏室-2-3-1'
  - name: lease
    description: 设备租赁
  - name: sample
    description: 样品
  - name: sample_type
    description: '样品种类, 注意: 和设备种类不同, 没有全局的样品种类, 每个公司有独立的样品种类, 所有样品种类由用户管理'
  - name: specimen
    description: 样本, 区分于 sample, sample 是试剂, specimen 是从 nature 采集的标本
  - name: sensor
    description: 传感器
  - name: location
    description: 监控资产位置
  - name: rule
    description: 监控事件判定规则
  - name: telemetry
    description: 监控数据
  - name: utilization
    description: 利用率
  - name: statistics
    description: 统计
  - name: event
    description: 事件
  - name: event_type
    description: 事件种类
  - name: operating_status
    description: 运行状态
  - name: excel
    description: excel导入导出以及excel数据校验接口
  - name: private
    description: '私有 api, 只对独立部署的客户开放, 不对共有平台开放'
  - name: maintenance
    description: 所有维保相关的接口 如：供应商，维修记录，维修人员等
  - name: Janssen
    description: Janssen专用接口
  - name: mobile
    description: 移动端专用接口 一般一个接口对应一个页面.
  - name: Weijian
    description: 衢州卫检项目专用
  - name: Task
    description: 设备|部门操作任务
  - name: Show
    description: 大屏专用接口, 方便轮播时候一次性获取渲染需要的数据
  - name: edge
    description: 给边缘测调用的接口. 不需要 token
  - name: video-account-controller
    description: CRUD account that cameras belong to
  - name: video-controller
    description: CRUD camera, config network, control recording
  - name: video-stats-controller
    description: statistics of accounts, cameras, videos
paths:
  /unsecure/login:
    post:
      description: 用户登录.
      tags:
        - unsecure
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginInfo'
      responses:
        '200':
          description: login good
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: user access token
                  refreshToken:
                    type: string
                    description: 用这个 token 调用 refresh/token 可以获取新的 token
              example: ASDJFSDFKJG9fs789hFSDF==
        '401':
          description: >-
            登录失败. code 的值根据不同情况变化: 密码错误 40100+<错误次数>, 如果是连续第二次输错就是40102.
            用户连续输入3次错误密码被锁定: 40199; 用户不存在: 40200. 用户密码过期: 40210
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 204
                message: password expired
  /unsecure/login/qr/url:
    get:
      description: 获取扫码登录QR链接
      tags:
        - unsecure
      parameters:
        - in: query
          name: domain
          description: 公司域名
          required: true
          example: ilabservice
          schema:
            type: string
        - in: query
          name: region
          description: 平台环境
          required: true
          example: prod
          schema:
            type: string
      responses:
        '200':
          description: '成功, 返回生成二维码的 url, 最后一部分是标识本次登录的UUID'
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: 给二维码显示的 url 字符串
                    example: >-
                      https://ilabservice.prod.ilabservice.cloud/login/I/ASDJFSDFKJG9fs789hFSDF==
  /unsecure/login/qr/token:
    get:
      description: 获取扫码登录QR 连接
      tags:
        - unsecure
      parameters:
        - in: query
          name: uuid
          description: 标识二维码的 UUID
          required: true
          example: ASDJFSDFKJG9fs789hFSDF==
          schema:
            type: string
      responses:
        '200':
          description: '成功,返回 code 为0, data 为包含 token 的对象. 失败, code 为非0的数字, message 里为提示'
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: user access token
                  refreshToken:
                    type: string
                    description: 用这个 token 调用 refresh/token 可以获取新的 token
  /unsecure/edge/device/by/terminal/{sn}:
    get:
      description: 边缘测请求获取设备名
      tags:
        - edge
      parameters:
        - in: path
          name: sn
          description: 终端序列号
          required: true
          example: TERM001
          schema:
            type: string
        - in: query
          name: user
          required: true
          example: admin
          schema:
            type: string
        - in: query
          name: password
          required: true
          example: pwd
          schema:
            type: string
      responses:
        '200':
          description: '成功,返回 code 为0, data 为包含 token 的对象. 失败, code 为非0的数字, message 里为提示'
          content:
            application/json:
              schema:
                type: array
                description: 设备名列表
                items:
                  type: string
                example:
                  - fridge1
                  - fridge2

  /unsecure/refresh/token:
    get:
      description: >-
        用户使用 login 中得到的 refreshToken 获取新的 token 防止 token 过期带来的访问被拒. Header 中应该加入
        X-Authorization: Bearer <refreshtoken>
      tags:
        - unsecure
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: 新的 user access token
                    example: ASDJFSDFKJG9fs789hFSDF==
        '401':
          description: >-
            登录失败. code 的值根据不同情况变化: 密码错误 40100+<错误次数>, 如果是连续第二次输错就是40102.
            用户连续输入3次错误密码被锁定: 40199; 用户不存在: 40200. 用户密码过期: 40210
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 204
                message: password expired
  '/unsecure/company/{domainName}':
    get:
      tags:
        - unsecure
      description: 使用公司域名获取公司基本信息
      parameters:
        - in: path
          name: domainName
          description: company domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: company basic information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInfoLogin'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: company not found
  /unsecure/deployment/info:
    get:
      tags:
        - unsecure
      description: 查询部署环境的信息
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  deploymentType:
                    type: string
                    description: 平台部署方式
                    example: local | cloud
                  emailNotification:
                    type: boolean
                    description: 是否支持 email 推送
  '/unsecure/customer/{company_domain}/send/{media}/verification':
    post:
      tags:
        - unsecure
      description: 向需要找回密码的用户发送验证码
      parameters:
        - in: path
          name: media
          description: 发送验证码的媒介 email/mobile
          required: true
          schema:
            type: string
        - in: path
          name: company_domain
          description: 公司域名
          required: true
          schema:
            type: string
        - in: query
          name: account
          description: 'email 地址或者mobile电话号码. 如果不指定, 则使用已经绑定的账号'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeed
  '/unsecure/customer/{company_domain}/verify/{media}/verification/{code}/purpose/{purpose}':
    post:
      tags:
        - unsecure
      description: 验证收到的验证码后向用户发送密码
      parameters:
        - in: path
          name: media
          description: '收到验证码的媒介, email/mobile'
          required: true
          schema:
            type: string
        - in: path
          name: company_domain
          description: 公司域名
          required: true
          schema:
            type: string
        - in: path
          name: code
          description: 收到的验证码
          required: true
          schema:
            type: string
        - in: path
          name: purpose
          description: '验证目的, 如果是找回密码, 为findPwd'
          required: true
          schema:
            type: string
        - in: query
          name: account
          description: 'email 地址或者mobile电话号码. 如果不指定, 则使用已经绑定的账号'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeed

  /unsecure/customer/activate/company/{id}/secure/code:
    post:
      tags:
        - unsecure
      description: 激活公司获取验证码
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  example: 15511112222
                  description: mobile number
                domain:
                  type: string
                  example: domain1
                  description: 预设公司域名
      responses:
        '200':
          description: '成功, code 为0; 失败, code 为非0值, message 为提示'
  /unsecure/customer/activate/company/{id}:
    post:
      tags:
        - unsecure
      description: 激活公司
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                originalDomain:
                  type: string
                  example: ils123
                  description: 预设公司域名
                domain:
                  type: string
                  example: domain1
                  description: 用户定义公司域名
                secureCode:
                  type: string
                  example: 0877
                  description: 验证码
                user:
                  type: string
                  example: super
                  description: 公司超级管理员账号
                password:
                  type: string
                  example: abcde
                  description: 公司超级管理员密码
      responses:
        '200':
          description: '成功, code 为0; 失败, code 为非0值, message 为提示'
  '/unsecure/customer/send/verification':
    post:
      tags:
        - unsecure
      description: 向用户发送验证码
      parameters:
        - in: path
          name: code
          description: 验证码
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  example: xxx
                  description: 手机号
      responses:
        '200':
          description: succeed
  '/unsecure/customer/verify/verification/{code}':
    post:
      tags:
        - unsecure
      description: 验证验证码
      parameters:
        - in: path
          name: code
          description: 验证码
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  example: xxx
                  description: 手机号
      responses:
        '200':
          description: succeed
  /secure/customer/login/qr:
    post:
      tags:
        - user
      description: 请求服务器生成本用户的token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                uuid:
                  type: string
                  example: ASDFJSGG$TWKF==
                  description: 对应于登录二维码的 UUID
      responses:
        '200':
          description: '成功, code 为0; 失败, code 为非0值, message 为提示'
  /secure/customer/me:
    get:
      tags:
        - user
      description: '获取登录用户的信息, 注意返回值. 后端不应该把用户的敏感信息放进去'
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
    put:
      tags:
        - user
      description: '修改个人信息, 参数都是 optional'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: ilab
                  description: 姓名
                gender:
                  type: string
                  example: 男 or 女
                  description: 性别
                job:
                  type: string
                  example: 开发工程师
                  description: 职位
                jobNum:
                  type: string
                  example: 12345
                  description: 工号
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
  /secure/customer/me/avatar:
    put:
      tags:
        - user
      description: 修改个人头像
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                image:
                  type: string
                  format: binary
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  imgUrl:
                    type: string
              example:
                imgUrl: 'http://image.com/jfkjdsflasfhakslf'
  /secure/customer/me/role:
    get:
      tags:
        - user
      description: 获取登录用户的角色和权限
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  roles:
                    type: array
                    description: 权限列表
                    items:
                      $ref: '#/components/schemas/RoleWithPermission'
  '/secure/customer/send/{media}/verification':
    post:
      tags:
        - user
      description: 向用户想绑定的联系方式或者已经绑定的联系方式发送验证码
      parameters:
        - in: path
          name: media
          description: 发送验证码的媒介 email/mobile
          required: true
          schema:
            type: string
        - in: query
          name: account
          description: 'email 地址或者电话号码. 如果不指定, 则使用已经绑定的账号'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeed
  '/secure/customer/verify/{media}/verification/{code}/purpose/{purpose}':
    post:
      tags:
        - user
      description: 验证收到的验证码后绑定联系方式
      parameters:
        - in: path
          name: media
          description: '收到验证码的媒介, email/mobile'
          required: true
          schema:
            type: string
        - in: path
          name: code
          description: 收到的验证码
          required: true
          schema:
            type: string
        - in: path
          name: purpose
          description: '验证目的, 如果是绑定, 为bind'
          required: true
          schema:
            type: string
        - in: query
          name: account
          description: 'email 地址或者电话号码. 如果不指定, 则使用已经绑定的账号'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeed
  /secure/customer/company:
    get:
      tags:
        - company
      description: 获取登录用户的公司的完整信息
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
  /secure/admin/company:
    get:
      tags:
        - company
      description: 获取所有公司的基本信息
      parameters:
        - in: query
          name: limit
          description: '最大获取数量, 即页面大小'
          schema:
            type: integer
        - in: query
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          schema:
            type: integer
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    example: 12
                    description: 总数
                  list:
                    type: array
                    description: 公司基本信息列表
                    items:
                      $ref: '#/components/schemas/CompanyInfoLogin'
    post:
      tags:
        - company
      description: >-
        新建公司. 在云部署的情况下, 会输入公司的园区的 GPS 坐标, 在本地部署的情况下, 会输入公司园区背景图.
        后端的逻辑会为公司创建一个管理员账号, 密码是固定的 ilabservice; 会为公司创建一个 root location, 在云环境下会把
        GPS 坐标赋值给这个 location, location_type=map. 在本地部署下location_type=campus.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: ilab
                  description: 公司名称
                address:
                  type: string
                  example: shanghai
                  description: 公司所在地
                email:
                  type: string
                  example: xxx@ilabservice.com
                  description: 邮箱
                domainName:
                  type: string
                  example: ilab
                  description: 域名
                telephone:
                  type: string
                  example: '15164501234'
                  description: 电话
                managerName:
                  type: string
                  example: ilab
                  description: 管理员名称
                managerLoginUsername:
                  type: string
                  example: ilab
                  description: 管理员用户名
                longitude:
                  type: number
                  example: '116.403254'
                  description: 坐标
                managerId:
                  type: number
                  example: '1'
                  description: 管理员id
                locationLockedToDepartment:
                  type: number
                  example: '1'
                  description: 部门id
                latitude:
                  type: number
                  example: '39.917062'
                  description: 坐标
                extraFeasture:
                  type: array
                  items:
                    type: integer
                  example: '这里要传一个长字符串，如1,2,3,4,中间用逗号分隔'
                  description: 公司附加功能id列表 如维保 共享等
                campusImage:
                  type: string
                  format: binary
                  example: image
                  description: 背景图
              required:
                - name
                - domainName
                - managerName
                - managerLoginUserName
                - address
                - email
                - longitude
                - latitude
            encoding:
              campusImage:
                contentType: image/*
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
  '/secure/maintenance/customer/company':
    get:
      tags:
        - maintenance
      description: 获取所有客户公司的基本信息
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    example: 12
                    description: 总数
                  list:
                    type: array
                    description: 公司基本信息列表
                    items:
                      $ref: '#/components/schemas/CompanyInfoLogin'

  '/secure/admin/company/{id}/deactivate':
    post:
      tags:
        - company
      description: 根据 id 获取公司具体信息
      parameters:
        - in: path
          name: id
          required: true
          description: 公司 id
          schema:
            type: integer
      responses:
        '200':
          description: succeed

  '/secure/admin/company/{id}':
    get:
      tags:
        - company
      description: 根据 id 获取公司具体信息
      parameters:
        - in: path
          name: id
          required: true
          description: 公司 id
          schema:
            type: integer
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
    put:
      tags:
        - company
      description: 更新公司信息. 所有的请求参数都是 optional 的. 后端只会修改指定了的信息.
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: ilab
                  description: 名称
                address:
                  type: string
                  example: shanghai
                  description: 地址
                email:
                  type: string
                  example: xxx@ilabservice.com
                  description: 邮箱
                domainName:
                  type: string
                  example: ilab
                  description: 域名
                longitude:
                  type: number
                  example: '116.403254'
                  description: 坐标
                latitude:
                  type: number
                  example: '39.917062'
                  description: 坐标
                managerId:
                  type: number
                  example: '1'
                  description: 管理员id
                locationLockedToDepartment:
                  type: number
                  example: '1'
                  description: 部门
                extraFeasture:
                  type: array
                  items:
                    type: integer
                  example: '这里要传一个长字符串，如1,2,3,4,中间用逗号分隔'
                  description: 功能列表
                campusImage:
                  type: string
                  format: binary
                  example: image
                  description: 背景图
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
  '/secure/admin/company/{id}/logo':
    post:
      tags:
        - company
      description: create公司logo
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                image:
                  type: string
                  format: binary
                  example: image
                  description: 图片
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                description: 返回的是一个url
                properties:
                  url:
                    type: string
    put:
      tags:
        - company
      description: 更新公司logo
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                image:
                  type: string
                  format: binary
                  description: 返回的是一个url
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: 返回的是一个url
  /secure/admin/company/{id}/location:
    get:
      tags:
        - company
      description: |
        get location list of certain company
        * 权限: 公司管理员
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: location list
                items:
                  $ref: '#/components/schemas/LocationBasic'

  /secure/customer/company/{id}/file:
    post:
      tags:
        - company
      description: |
        上传公司文件
        * 权限：公司管理员
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: succeed
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    get:
      tags:
        - company
      description: |
        获取公司文件列表
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeed
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/company/{companyId}/file/{fileId}:
    delete:
      tags:
        - company
      description: |
        删除公司文件
        * 权限：公司管理员
      parameters:
        - in: path
          name: companyId
          description: 公司 id
          required: true
          schema:
            type: integer
        - in: path
          name: fileId
          description: 文件 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeed
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/me/modify/password:
    post:
      tags:
        - user
      description: 登录用户修改密码
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                oldPwd:
                  type: string
                  example: xxx
                  description: 旧密码
                newPwd:
                  type: string
                  example: ddd
                  description: 新密码
      responses:
        '200':
          description: succeeds
        '500':
          description: failed to update password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 305
                message: 'failed to update db, try again later'
  /secure/role:
    get:
      tags:
        - role
      description: |
        查询所有用户角色
        * 权限：
        * 1.公司管理员
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 角色列表
                items:
                  $ref: '#/components/schemas/Role'
  '/secure/admin/role/{id}':
    put:
      tags:
        - role
      description: |
        更新指定角色
        * 权限：
        * 1.公司管理员
      parameters:
        - in: path
          name: id
          description: 角色 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAndAddRole'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/admin/role:
    post:
      tags:
        - role
      description: |
        新增角色
        * 权限：
        * 1.公司管理员
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAndAddRole'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/role/{roleId}/permission':
    get:
      tags:
        - role
      description: 获取指定角色的所有权限
      parameters:
        - in: path
          name: roleId
          description: 角色 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  type: integer
                description: 权限 id 列表
                example:
                  - 3
                  - 5
                  - 6
                  - 7
    post:
      tags:
        - role
      description: 给指定角色添加1到多个权限
      parameters:
        - in: path
          name: roleId
          description: role id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
              example:
                - 3
                - 5
                - 6
                - 7
              description: 权限id的list
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/role/{roleId}/permission/delete':
    put:
      tags:
        - role
      description: 从指定角色删除1到多个权限
      parameters:
        - in: path
          name: roleId
          description: role id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
              example:
                - 3
                - 5
                - 6
                - 7
              description: 角色 id list
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/admin/permission:
    get:
      tags:
        - permission
      description: |
        获取所有数据库中现存的权限
        * 权限：
        * 1.平台管理员
        * 2.公司管理员
      parameters:
        - in: query
          name: type
          description: '权限种类, resource_role 或者 site_role, 如果不填, 后台默认为 resource_role'
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    objectType:
                      type: string
                      description: 对象类型
                      example: 'USER,COMPANY,DEPARTMENT,LOCATION,SAMPLE, DEVICE'
                    permissionList:
                      type: array
                      description: 对某种对象的所有权限
                      items:
                        $ref: '#/components/schemas/Permission'
    post:
      tags:
        - permission
      description: |
        新增一个权限
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAndAddRole'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateAndAddRole'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/permission/{id}':
    delete:
      tags:
        - permission
      description: 通过 id 删除一个权限
      parameters:
        - name: id
          in: path
          required: true
          description: 权限 id
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: >-
                  cannot delete because there are live devices using this
                  measure type
    put:
      tags:
        - permission
      description: 更新指定 id 的权限
      parameters:
        - in: path
          name: id
          description: 权限 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Permission'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/company/{id}/contract':
    get:
      tags:
        - company
      description: 查询指定公司的所有合同
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 合同列表
                items:
                  $ref: '#/components/schemas/CompanyContract'
    post:
      tags:
        - company
      description: 给指定公司添加一个合同
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyContract'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyContract'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/company/{companyId}/contract/{contractId}':
    put:
      tags:
        - company
      description: 更新一个公司的一个 contract
      parameters:
        - in: path
          name: companyId
          required: true
          schema:
            type: integer
          example: 1
          description: 公司id
        - in: path
          name: contractId
          required: true
          schema:
            type: integer
          example: 1
          description: 合同id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyContract'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/company/{id}/feature':
    get:
      tags:
        - feature
      description: 查询指定公司的所有附加功能
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 附加功能列表
                items:
                  $ref: '#/components/schemas/ProductFeature'
    post:
      tags:
        - feature
      description: 为一个公司增添一到多个产品功能
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: 附加功能 id 列表
              items:
                type: integer
      responses:
        '200':
          description: succeeds
        '404':
          description: feature not found
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/company/{id}/feature/delete':
    put:
      tags:
        - feature
      description: 从一个公司删除一到多个产品功能
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
              description: 附加功能 id 列表
      responses:
        '200':
          description: succeeds
        '404':
          description: feature not found
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/customer/department:
    get:
      tags:
        - department
      description: |
        查询登录用户公司所有部门
        * 权限：
          * 1.公司管理员可以查看所有部门
          * 2.部门管理员可以查看自己的子部门（子部门的permission_cascade为ALL或者DIRECT）
      parameters:
        - in: query
          name: followed
          description: 是否关注, 0 返回所有, 1 代表 关注, 默认为0
          required: false
          schema:
            type: integer
        - in: query
          name: offset
          description: offset = page size * page number
          required: true
          schema:
            type: integer
        - in: query
          name: limit
          description: limit = page size
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 部门列表
                items:
                  $ref: '#/components/schemas/Department'

  /secure/customer/weijian/department:
    get:
      tags:
        - Weijian
      description: |
        查询公司所有一级部门
        如果不传参数, 返回所有部门信息.
        * 权限：
          * 1.公司管理员可以查看所有部门
      parameters:
        - in: query
          name: followed
          description: 是否关注, 0 代表未关注, 1 代表 关注, 如果不传, 返回所有
          required: false
          schema:
            type: integer
      #        - in: query
      #          name: offset
      #          description: 'offset = page size * page number'
      #          required: false
      #          schema: integer
      #        - in: query
      #          name: limit
      #          description: 'limit = page size'
      #          required: false
      #          schema: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 部门列表
                items:
                  $ref: '#/components/schemas/DepartmentWithStats'

  '/secure/customer/parent/department/{deptId}':
    get:
      tags:
        - department
      description: |
        查询登录用户公司指定部门的父部门
        * 权限：
         * 1.公司管理员可以查所有部门
      parameters:
        - in: path
          name: deptId
          description: 部门 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Department'
        '404':
          description: department not found
  /secure/customer/root/department:
    get:
      tags:
        - department
      description: |
        查询登录用户公司所有root部门
        * 权限：
         * 1.公司管理员可以查所有root部门
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 部门列表
                items:
                  $ref: '#/components/schemas/Department'
    post:
      tags:
        - department
      description: |
        为登陆用户公司增添一个root部门
          * 1.只有公司管理员可以新增root部门
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Dept'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Department'
        '404':
          description: department not found
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/department/{deptId}':
    get:
      tags:
        - department
      description: |
        查询登录用户公司所有部门
        * 权限：
          * 1.公司管理员可以查看所有部门
          * 2.部门管理员可以查看自己的子部门（子部门的permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: deptId
          description: 部门 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Department'
    put:
      tags:
        - department
      description: |
        修改指定公司指定部门
        * 权限：
          * 1.公司管理员
      parameters:
        - in: path
          name: deptId
          description: 部门 id
          required: true
          schema:
            type: integer
      requestBody:
        description: 'don''t have to contain all fields, any combination is good'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Department'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Department'
    delete:
      tags:
        - department
      description: |
        登录用户删除一个本公司的部
        * 权限：
          * 1.公司管理员
      parameters:
        - in: path
          name: deptId
          description: 部门 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '404':
          description: feature not found
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/sub/department/{deptId}':
    get:
      tags:
        - department
      description: |
        查询登录用户公司某部门下的所有子部门, 包括直接和间接, 不包括自己
        * 权限：
        * 1.公司管理员查看所有的自部门
        * 2.部门管理员可以查看自己的子部门（子部门的permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: deptId
          required: true
          schema:
            type: integer
          description: 部门id
        - in: query
          name: includeParent
          required: false
          description: '返回中是否包含母部门, 1表示包含, 默认为0'
          schema:
            type: integer
          example: 0/1
        - in: query
          name: direct
          required: false
          description: '是否只查询直接的子部门, 1表示直接, 默认为0'
          schema:
            type: integer
          example: 0/1
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 部门列表
                items:
                  $ref: '#/components/schemas/Department'
  '/secure/customer/child/department/{deptId}':
    get:
      tags:
        - department
      description: |
        查询登录用户公司某部门下的所有直接子部门
        * 权限：
        * 1.公司管理员可以查看
        * 2.部门管理员可以查看自己的子部门（子部门的permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: deptId
          required: true
          schema:
            type: integer
          description: 部门id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 部门列表
                items:
                  $ref: '#/components/schemas/Department'
    post:
      tags:
        - department
      description: |
        为一个公司某个部门增添一到多个子部门
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（新增的部门一定属于该管理员所在的部门）
      parameters:
        - in: path
          name: deptId
          required: true
          schema:
            type: integer
          description: 部门id
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: 子部门 id 列表
              items:
                type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Department'
        '404':
          description: feature not found
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/customer/user:
    get:
      tags:
        - user
      description: |
        获取登录用户所在公司的所有用户, 可以用姓名，职位，手机号，部门或者角色作为条件查询
        * 权限：
        * 1.公司管理员
        * 2.部门管理员可以查看本部门和自部门的所有用户，但是子部门的的permission_cascade必须是ALL或者DIRECT
      parameters:
        - in: query
          name: limit
          description: '最大获取数量, 即页面大小'
          schema:
            type: integer
        - in: query
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          schema:
            type: integer
        - in: query
          required: false
          name: departmentId
          description: 部门 id
          schema:
            type: integer
        - in: query
          name: name
          required: false
          description: 名字
          schema:
            type: string
        - in: query
          name: job
          required: false
          description: 职位
          schema:
            type: string
        - in: query
          name: roleId
          required: false
          description: 角色
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: 总用户数
                  list:
                    type: array
                    description: 当前页用户列表
                    items:
                      $ref: '#/components/schemas/User'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    post:
      tags:
        - user
      description: |
        为公司添加一个用户
        * 权限：
        * 1.公司管理员
      requestBody:
        description: 'user object, without id'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/user/{id}':
    get:
      tags:
        - user
      description: 通过 id 查询用户
      parameters:
        - in: path
          name: id
          required: true
          description: 用户 id
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - user
      description: |
        delete user type by id. 不同类型的用户, 删除逻辑不一样, 需要考虑到相关的设备
        * 权限：
        * 1.公司管理员
      parameters:
        - in: path
          name: id
          required: true
          description: 用户 id
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: cannot delete because there are live devices
    put:
      tags:
        - user
      description: |
        更新指定用户
        * 权限：
        * 1.公司管理员可以操作该接口
      parameters:
        - in: path
          name: id
          required: true
          description: 用户 id
          schema:
            type: integer
      requestBody:
        description: 'user object, don''t have to contain all fields, any combination is good'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUser'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/customer/user/logout:
    get:
      tags:
        - user
      description: '注销当前用户. 不取消 token, 只用来记录用户的操作'
      operationId: logoutUser
      parameters: []
      responses:
        default:
          description: successful operation
  '/secure/customer/user/{user_id}/role/{role_id}':
    put:
      tags:
        - user
      description: |
        给指定用户设置一个角色
        * 权限：
        * 1.公司管理员（公司管理员只能分配level低于自己的角色给用户）
      parameters:
        - in: path
          name: user_id
          description: 用户 id
          required: true
          schema:
            type: integer
        - in: path
          name: role_id
          description: 角色 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/company/{companyId}/root/location':
    get:
      tags:
        - location
      description: |
        获取公司的最高一层位置资产
        * 权限：
        * 1.公司管理员
      parameters:
        - in: path
          name: companyId
          required: true
          schema:
            type: integer
          description: 公司id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/location/tree/{id}':
    get:
      tags:
        - location
      description: |
        获取给定 location 为 root 的 location 树
        * 权限： 所有人
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: location id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationTree'
  /secure/customer/location:
    post:
      tags:
        - location
      description: |
        新建位置资产，传递的参数实际上是两个json字符串
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                location:
                  $ref: '#/components/schemas/LocationParam'
                profileImage:
                  type: string
                  description: 背景图
                  format: binary
            encoding:
              image:
                contentType: 'image/png, image/jpeg'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/company/location:
    get:
      tags:
        - rule
      description: 获取登录用户公司的所有location，不同角色拿到的数据不同
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
  '/secure/customer/location/{id}':
    get:
      tags:
        - location
      description: >
        通过 id 查询位置资产. 在位置资产中的统计信息, 后端需要在 api 请求的处理中进行计算. 统计值只应该是由用户可见的设备统计得到的*
        权限：
          * 1.公司管理员
          * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
          * 3.设备管理员.
      parameters:
        - in: path
          name: id
          description: 位置 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    put:
      tags:
        - location
      description: |
        通过 id 修改位置资产
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: id
          description: 位置 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Location'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - location
      description: |
        通过 id 删除位置资产. 这个位置下的所有资产将被删除
        * 权限：
        * 1.公司管理员
      parameters:
        - in: path
          name: id
          description: 位置 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/location/{id}/background':
    put:
      tags:
        - location
      description: |
        修改位置资产背景图
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: id
          description: 位置 id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          image/*:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: succeed
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
  /secure/customer/location_type:
    get:
      tags:
        - location
      description: |
        查询位置类型
      parameters:
        - in: path
          name: locationId
          description: 位置 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationType'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/location/districts:
    get:
      tags:
        - location
      description: |
        查询权限内可以看到的区域
      parameters: []
      responses:
        '200':
          description: succeeds 返回区域列表
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/monitor_target_lab_device:
    post:
      tags:
        - monitor_target_lab_device
      description: |
        新建监控对象设备. 需要先在 lab_device 中新建一行, 然后对应的在monitor_target 里再建一行, 把
        ref_table_id 设置为 lab_device.id，
          查询设备的接口均可以通过名称，资产号，种类，状态，产品心，设备型号，品牌，位置来查询想要的设备.
          * 权限：
          * 1.公司管理员
          * 2.部门管理员
          * 3.设备管理员
          * 4.设备使用者
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: ilab
                  description: 设备名称/监控对象名称
                serialNumber:
                  type: string
                  example: xxxxxxxxx
                  description: 设备编号，唯一的
                model:
                  type: string
                  example: 制冷
                  description: 类型
                brand:
                  type: string
                  example: 三星
                  description: 品牌
                assetId:
                  type: string
                  example: 1
                  description: 资产
                productLine:
                  type: string
                  example: ilab
                  description: 产品线
                enableSharing:
                  type: integer
                  example: 0 共享 1 非共享
                  description: 是否共享
                leaseCause:
                  type: integer
                  example: ilab
                  description: 租赁原因
                leasePricePerHour:
                  type: number
                  example: 123
                  description: 租赁价格/每小时
                manufacture:
                  type: string
                  example: ilab
                  description: 生产厂家
                perchaseDate:
                  type: integer
                  example: 123456789
                  description: 生产日期   时间戳
                locationId:
                  type: integer
                  example: 1
                  description: 位置id
                ownerId:
                  type: integer
                  example: 1
                  description: 设备管理员Id
                operatorIdList:
                  description: 使用者ID列表
                  example:
                    - 1
                    - 2
                    - 3
                  type: array
                  items:
                    type: integer
                xPosition:
                  type: integer
                  description: '如果设备在平面图中, 为设备在图中的坐标.'
                  example: 100
                yPosition:
                  type: integer
                  example: 200
                  description: y轴
                longitude:
                  type: number
                  description: '如果设备在地图上, 为设备在地图上的 GPS. 坐标和 GPS 至少要有一个.'
                  example: 34.223
                latitude:
                  type: number
                  example: -11.44
                  description: 坐标
                image:
                  type: string
                  format: binary
                  description: 图片
                videoStreamingUrl:
                  type: string
                  example: ilabservice.com/camera/111
                  description: 视频流地址
                monitoringTargetTypeId:
                  type: integer
                  example: 1
                  description: 监控模板 ID
                deviceType:
                  type: string
                  example: fridge
                  description: 设备种类
              required:
                - name
                - serialNumber
                - assetId
                - model
            encoding:
              image:
                contentType: 'image/png, image/jpeg'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetLabDevice'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    get:
      tags:
        - monitor_target_lab_device
      description: |
        查询监控对象, 用户只能看到自己权限以内的设备.
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者（看到绑定设备）
      parameters:
        - in: query
          name: monitorTargetType
          schema:
            type: string
          example: 冷冻
          description: 设备种类
        - in: query
          name: locationId
          schema:
            type: integer
          example: 1
          description: 位置id
        - in: query
          name: productLine
          example: ilab
          description: 产品线
          schema:
            type: string
        - in: query
          name: assetId
          example: 1
          description: 编号
          schema:
            type: string
        - in: query
          name: model
          example: ilab
          description: 模型
          schema:
            type: string
        - in: query
          name: name
          example: 冰箱
          description: 设备名称
          schema:
            type: string
        - in: query
          name: brand
          description: 品牌
          example: 冰箱
          schema:
            type: string
        - in: query
          name: limit
          description: '最大获取数量, 即页面大小'
          schema:
            type: integer
        - in: query
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          schema:
            type: integer
        - in: query
          name: share
          description: '0:代表查询未共享设备，1代表查询共享设备'
          schema:
            type: integer
        - in: query
          name: clientTag
          description: '用户资产号'
          schema:
            type:  string
        - in: query
          name: serialNumber
          description: '设备序列号'
          schema:
            type:  string
        - in: query
          name: subscribe
          example: true
          required: false
          description: 过滤是否只查询不在设备服务中的设备
          schema:
            type: boolean
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: 总设备数
                  list:
                    type: array
                    description: 当前页设备列表
                    items:
                      $ref: '#/components/schemas/MonitorTargetBasic'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/monitor_target_lab_device/export:
    get:
      tags:
        - monitor_target_lab_device
      description: |
        导出设备列表, 用户只能看到自己权限以内的设备.
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者（看到绑定设备）
      parameters:
        - in: query
          name: monitorTargetType
          schema:
            type: string
          example: 冷冻
          description: 设备种类
        - in: query
          name: locationId
          schema:
            type: integer
          example: 1
          description: 位置id
        - in: query
          name: productLine
          example: ilab
          description: 产品线
          schema:
            type: string
        - in: query
          name: assetId
          example: 1
          description: 编号
          schema:
            type: string
        - in: query
          name: model
          example: ilab
          description: 模型
          schema:
            type: string
        - in: query
          name: name
          example: 冰箱
          description: 设备名称
          schema:
            type: string
        - in: query
          name: brand
          description: 品牌
          example: 冰箱
          schema:
            type: string
        - in: query
          name: limit
          description: '最大获取数量, 即页面大小'
          schema:
            type: integer
        - in: query
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          schema:
            type: integer
        - in: query
          name: share
          description: '0:代表查询未共享设备，1代表查询共享设备'
          schema:
            type: integer
        - in: query
          name: clientTag
          description: '用户资产号'
          schema:
            type:  string
        - in: query
          name: serialNumber
          description: '设备序列号'
          schema:
            type:  string
        - in: query
          name: subscribe
          example: true
          required: false
          description: 过滤是否只查询不在设备服务中的设备
          schema:
            type: boolean
      responses:
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/monitor_target_lab_device/{id}':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        通过 id 查询监控对象
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者（看到绑定设备）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetLabDevice'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    put:
      tags:
        - monitor_target_lab_device
      description: |
        通过 id 修改监控对象
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: 冰箱
                  description: 监控对象name
                model:
                  type: string
                  example: ilab
                  description: 模型
                brand:
                  type: string
                  example: 品牌
                  description: 三星
                productLine:
                  type: string
                  example: ilab
                  description: 产品线
                enableSharing:
                  type: integer
                  example: 0 共享  1 非共享
                  description: 是否共享
                leaseCause:
                  type: integer
                  example: 租赁
                  description: 租赁原因
                leasePricePerHour:
                  type: number
                  example: 123
                  description: 每小时价格
                manufacture:
                  type: string
                  example: ilab
                  description: 生产厂家
                perchaseDate:
                  type: integer
                  description: 日期
                alertPushEnabled:
                  type: integer
                  description: 报警是否推送
                xPosition:
                  type: integer
                  description: '如果设备在平面图中, 为设备在图中的坐标.'
                  example: 100
                yPosition:
                  type: integer
                  example: 200
                  description: 坐标
                longitude:
                  type: number
                  description: '如果设备在地图上, 为设备在地图上的 GPS. 坐标和 GPS 只能有一个.'
                  example: 34.223
                latitude:
                  type: number
                  example: -11.44
                  description: 坐标
                videoStreamingUrl:
                  type: string
                  example: ilabservice.com/camera/111
                  description: 视频流地址
                deviceType:
                  type: string
                  example: fridge
                  description: 设备种类
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - monitor_target_lab_device
      description: |
        通过 id 删除监控对象, 需要删除 lab_device 这个表中对应的项.
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/monitor_target_lab_device/{id}/file/{fileId}':
    delete:
      tags:
        - monitor_target_lab_device
      description: |
        删除设备文件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: fileId
          required: true
          schema:
            type: integer
          description: 设备文件id
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/admin/{userId}':
    put:
      tags:
        - monitor_target_lab_device
      description: |
        修改设备管理员
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: userId
          required: true
          schema:
            type: integer
          description: 用户id
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/user':
    post:
      tags:
        - monitor_target_lab_device
      description: |
        添加设备使用者
        * 权限：
          * 1.公司管理员
          * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
          * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: 使用者 id 列表
              items:
                type: integer
              example:
                - 3
                - 5
                - 6
                - 7
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/delete/user':
    put:
      tags:
        - monitor_target_lab_device
      description: |
        删除设备使用者
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: 使用者 id 列表
              items:
                type: integer
              example:
                - 3
                - 5
                - 6
                - 7
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/file':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        列举设备文件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 文件列表
                items:
                  $ref: '#/components/schemas/DeviceFile'
    post:
      tags:
        - monitor_target_lab_device
      description: |
        新增设备文件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadFile'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceFile'
  '/secure/customer/monitor_target_lab_device/{id}/download/file/{fileId}':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        下载设备文件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: fileId
          required: true
          schema:
            type: integer
          description: 文件id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: string
                description: 文件内容
                format: binary
  '/secure/customer/monitor_target_lab_device/{id}/image':
    put:
      tags:
        - monitor_target_lab_device
      description: |
        更换设备图
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        content:
          image/*:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  imgUrl:
                    type: string
              example:
                imgUrl: 'http://image.com/jfkjdsflasfhakslf'
  '/secure/customer/monitor_target_lab_device/{id}/measure_type':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        获取指定设备的监控参数
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 参数列表
                items:
                  $ref: '#/components/schemas/MeasureType'
  '/secure/customer/monitor_target_lab_device/{id}/measure_type/{measureTypeId}':
    post:
      tags:
        - monitor_target_lab_device
      description: |
        为指定设备添加监控参数
        * 权限：
            * 1.公司管理员
            * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
            * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: measureTypeId
          required: true
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds
    delete:
      tags:
        - monitor_target_lab_device
      description: |
        为指定设备删除监控参数
        * 权限：
          * 1.公司管理员
          * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
          * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: measureTypeId
          required: true
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/switch/owner/{oldUserId}/to/{newUserId}':
    put:
      tags:
        - monitor_target_lab_device
      description: |
        把设备管理员的设备指派给另外一个设备管理员
        * 权限：
            * 1.公司管理员
            * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: oldUserId
          description: 当前拥有设备的管理员
          required: true
          schema:
            type: integer
        - in: path
          name: newUserId
          description: 指派的设备管理员
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'succeeds, 返回转移的设备数'
          content:
            application/json:
              schema:
                type: integer
                example: 111

  '/secure/customer/activate/device/{id}':
    post:
      tags:
        - monitor_target_lab_device
      description: |
        激活设备
        * 权限
        1. 公司管理员
      parameters:
        - in: path
          name: id
          description: device id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/by/terminal/{SN}':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        根据终端 SN 获取设备
        * 权限
        1. 公司管理员
        2. 设备管理员
      parameters:
        - in: path
          name: SN
          description: 终端序列号
          required: true
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetLabDevice'

  '/secure/customer/monitor_target_lab_device/location/{id}/distribution':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        获取指定位置下的当前登录用户可见的设备的分布
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          description: 位置 ID
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                description: 按照部门和种类的设备分布情况
                properties:
                  countByDepartment:
                    type: array
                    description: 按部门设备数量统计
                    items:
                      type: object
                      properties:
                        departmentName:
                          type: string
                          example: chemistry
                          description: 部门名称
                        departmentId:
                          type: integer
                          description: 部门 ID
                        count:
                          type: integer
                          description: 设备数量
                          example: 5
                  countByType:
                    type: array
                    description: 按种类设备数量统计
                    items:
                      type: object
                      properties:
                        typeName:
                          type: string
                          example: fridge
                          description: 设备种类
                        typeId:
                          type: integer
                          description: 设备种类 ID
                        count:
                          type: integer
                          description: 设备数量
                          example: 5
  '/secure/customer/monitor_target_lab_device/{id}/user/{userId}/send/power/on':
    post:
      tags:
        - monitor_target_lab_device
      description: |
        设备通电
        * 权限
        1. 公司管理员
        2. 设备管理员
        3. 租赁双方
      parameters:
        - in: path
          name: id
          description: device id
          required: true
          schema:
            type: integer
        - in: path
          name: userId
          description: user id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/user/{userId}/send/power/off':
    post:
      tags:
        - monitor_target_lab_device
      description: |
        设备断电
        * 权限
        1. 公司管理员
        2. 设备管理员
        3. 租赁双方
      parameters:
        - in: path
          name: id
          description: device id
          required: true
          schema:
            type: integer
        - in: path
          name: userId
          description: user id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/lease/rate':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        查询共享设备的使用情况（使用次数、使用时间、使用率）
      parameters:
        - in: query
          name: deviceIds
          description: 设备id，用","隔开
          required: false
          schema:
            type: string
        - in: query
          name: startTime
          description: 开始时间
          required: true
          schema:
            type: number
        - in: query
          name: endTime
          description: 结束时间
          required: true
          schema:
            type: number
      responses:
        '200':
          description: succeeds
  '/api/v2/secure/customer/monitor_target_lab_device/monthly/report/list':
    get:
      tags:
        - monitor_target_lab_device
      description: |
        查询月报历史数据
      parameters:
        - in: query
          name: startTime
          description: 开始时间
          required: true
          schema:
            type: number
        - in: query
          name: endTime
          description: 结束时间
          required: true
          schema:
            type: number
      responses:
        '200':
          description: succeeds
  '/api/v2/secure/customer/monitor_target_lab_device/monthly/report':
    post:
      tags:
        - monitor_target_lab_device
      description: |
        生成月报
      parameters:
        - in: query
          name: offlineInfo
          description: 离线原因
          required: false
          schema:
            type: string
        - in: query
          name: startTime
          description: 开始时间
          required: true
          schema:
            type: number
        - in: query
          name: endTime
          description: 结束时间
          required: true
          schema:
            type: number
      responses:
        '200':
          description: succeeds
  '/api/v2/secure/customer/monitor_target_lab_device/monthly/report/{id}':
    put:
      tags:
        - monitor_target_lab_device
      description: |
        删除指定的月报记录
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeaseSetting'
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/lease/setting':
    put:
      tags:
        - lease
      description: |
        update设备租赁设置. 注意, 设置只能影响到之后的 lease_record. 例如, 如果修改价钱, 目前已经添加的租赁单价是不会变的.
        * 权限：
                * 1.公司管理员
                * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
                * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeaseSetting'
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/lease/open/time':
    get:
      tags:
        - lease
      description: |
        获取设备open时间
        * 权限：
          * 1.公司管理员
          * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
          * 3.设备管理员（看到绑定设备  ownerid为userid）
          * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: query
          name: startTime
          required: false
          description: '起始时间, 如果不填, 后端默认为当前时间'
          schema:
            type: integer
        - in: query
          name: endTime
          required: false
          description: '结束时间, 如果不填, 后端默认为当前时间后一个月'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds. 返回时间范围内的被占用时间段
          content:
            application/json:
              schema:
                type: array
                description: 租赁记录列表
                items:
                  $ref: '#/components/schemas/LeaseTimeSlot'
    post:
      tags:
        - lease
      description: |
        添加设备open时间
        * 权限：
            * 1.公司管理员
            * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
            * 3.设备管理员（看到绑定设备  ownerid为userid）
            * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeaseTimeSlot'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaseTimeSlot'
  '/secure/customer/monitor_target_lab_device/{id}/lease/occupied/time':
    get:
      tags:
        - lease
      description: |
        获取设备在给定时间范围内被占用的时间段.  返回值为一个数组, 每一个项是起始时间戳.
        * 权限：
            * 1.公司管理员
            * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
            * 3.设备管理员（看到绑定设备  ownerid为userid）
            * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: query
          name: startTime
          required: false
          description: '起始时间, 如果不填, 后端默认为当前时间'
          schema:
            type: integer
        - in: query
          name: endTime
          required: false
          description: '结束时间, 如果不填, 后端默认为当前时间后一个月'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds. 返回时间范围内的被占用时间段
          content:
            application/json:
              schema:
                type: array
                description: 被占用时间段
                items:
                  type: object
                  properties:
                    begin:
                      type: integer
                      example: 15423425000
                    end:
                      type: integer
                      example: 15454345300
  '/secure/customer/monitor_target_lab_device/{id}/lease/open/time/{slotId}':
    delete:
      tags:
        - lease
      description: |
        delete 设备open时间, 如果修改后的时间和现有租赁冲突, 拒绝, 返回409
        * 权限：
              * 1.公司管理员
              * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
              * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: slotId
          required: true
          schema:
            type: integer
          description: open time id
      responses:
        '200':
          description: succeeds
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: cannot delete because there are lease record inside
    put:
      tags:
        - lease
      description: |
        update 设备open时间, 如果修改后的时间和现有租赁冲突, 拒绝, 返回409
        * 权限：
              * 1.公司管理员
              * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
              * 3.设备管理员（看到绑定设备  ownerid为userid）
              * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: slotId
          required: true
          schema:
            type: integer
          description: 租赁记录id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeaseTimeSlot'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaseTimeSlot'
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: cannot delete because there are lease record inside
  '/secure/customer/lab_device/lease/condition/{condition}/relationship/{relationship}/start/{startTime}/end/{endTime}':
    get:
      tags:
        - lease
      description: |
        查询指定时间段内符合租赁条件的设备. 例如, 在2018-1-1 12点-16点之间没有被租赁的设备
        * 权限：
              * 1.公司管理员
              * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
              * 3.设备管理员（看到绑定设备  ownerid为userid）
              * 4.设备使用者
      parameters:
        - in: path
          name: condition
          description: '设备租赁 状况, 可以的值为 open, busy'
          required: true
          schema:
            type: string
        - in: path
          name: relationship
          description: '设备和用户的关系, 可以的值为  owner, user'
          required: true
          schema:
            type: string
        - in: path
          name: startTime
          description: '查询起始时间, 范围必须在 [now, now+1个月]'
          required: true
          schema:
            type: integer
        - in: path
          name: endTime
          description: '查询结束时间, 范围必须在 [now, now+1个月]'
          required: true
          schema:
            type: integer
        - in: path
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          required: true
          schema:
            type: integer
        - in: path
          name: limit
          description: '最大获取数量, 即页面大小'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 设备基本信息列表
                items:
                  $ref: '#/components/schemas/MonitorTargetBasic'
  '/secure/customer/monitor_target_lab_device/{id}/lease':
    get:
      tags:
        - lease
      description: '获取指定设备租赁历史,请求中需要指定租赁起始时间的时间范围,时间范围不能超过1年'
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: query
          name: startTime
          required: true
          schema:
            type: integer
          description: 开始时间
        - in: query
          name: endTime
          required: true
          schema:
            type: integer
          description: 结束时间
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 租赁记录列表
                items:
                  $ref: '#/components/schemas/LeaseRecord'
    post:
      tags:
        - lease
      description: |
        添加设备租赁项.
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                startTime:
                  type: integer
                  description: time Stamp
                  example: 153771840000
                endTime:
                  type: integer
                  description: time stamp
                  example: 1537718400000
                agreement:
                  type: string
                  example: ilab
                  description: 协议
                startOffsetQuarter:
                  type: integer
                  description: >-
                    起始时间对于重复时间的整点偏移量. 如果是 daily 就是0点的偏移刻钟数, 20 代表 5:00. weekly
                    就是上个周日0点开始的偏移刻钟数. 100 代表 周一1:00
                  example: 40
                endOffsetQuarter:
                  type: integer
                  example: 52
                  description: 偏移量  15分钟为一个单位
                recurrence:
                  type: string
                  example: 'dayly, weekly, weekdays'
                  description: 租赁方式
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaseRecord'
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: 'cannot add because there are conflict lease record at [time]'
  '/secure/customer/monitor_target_lab_device/{id}/lease/{leaseId}':
    delete:
      tags:
        - lease
      description: |
        删除设备租赁记录
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: leaseId
          required: true
          schema:
            type: integer
          description: 租赁记录id
      responses:
        '200':
          description: succeeds
    put:
      tags:
        - lease
      description: |
        修改设备租赁项. 注意, 如果当前租赁单价和添加时的租赁价格不同, 会使用当前价格重新计算
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: leaseId
          required: true
          schema:
            type: integer
          example: ilab
          description: 租赁记录id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                startTime:
                  type: integer
                  example: 14522110000
                  description: 开始时间
                endTime:
                  type: integer
                  example: 14522110000
                  description: 结束时间
                agreement:
                  type: string
                  example: ilab
                  description: 协议
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaseRecord'
        '409':
          description: cannot modify because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: >-
                  cannot modify because there are conflict lease record at
                  [time]
  '/secure/customer/monitor_target_lab_device/{id}/end/lease/{leaseId}':
    put:
      tags:
        - lease
      description: |
        结束 指定设备租赁
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: leaseId
          required: true
          schema:
            type: integer
          example: 1
          description: 租赁记录id
        - in: query
          name: all
          required: false
          description: if modify all
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operation:
                  type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaseRecord'
  '/secure/customer/monitor_target_lab_device/all/lease':
    get:
      tags:
        - lease
      description: |
        查询所有共享设备一定时间内的预约记录
      parameters:
        - in: query
          name: startTime
          description: 开始时间
          required: false
          schema:
            type: number
        - in: query
          name: endTime
          description: 结束时间
          required: false
          schema:
            type: number
      responses:
        '200':
          description: succeeds
  /secure/customer/sample/category:
    get:
      tags:
        - sample
      description: |
        获取该公司的样品范类
        * 权限：
        * 1.公司管理员
        * 2.部门管理员
        * 3.设备管理员
        * 4.设备使用者
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SampleCategory'
  /secure/customer/monitor_target_lab_device/sample_container:
    get:
      tags:
        - sample
      description: |
        获取所有可见设备的样品柜
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 样品柜列表
                items:
                  $ref: '#/components/schemas/SampleContainerBasic'
  '/secure/customer/monitor_target_lab_device/{id}/sample_container':
    get:
      tags:
        - sample
      description: |
        获取指定设备的样品柜
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 样品柜列表
                items:
                  $ref: '#/components/schemas/SampleContainerBasic'
    post:
      tags:
        - sample
      description: |
        为设备添加样品柜
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleContainerBasic'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleContainerBasic'
  '/secure/customer/monitor_target_lab_device/{id}/sample_container/{containerId}':
    get:
      tags:
        - sample
      description: |
        获取指定设备的指定样品柜
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleContainer'
    put:
      tags:
        - sample
      description: |
        update样品柜信息
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleContainerBasic'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleContainerBasic'
    delete:
      tags:
        - sample
      description: |
        从设备删除样品柜
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      responses:
        '200':
          description: succeeds
  /secure/customer/sample/stocking:
    get:
      tags:
        - sample
      description: |
        查询样品指定时间内的出入库情况, 返回入库/出库的样品列表. 时间跨度不超过一年.
          * 权限：
          * 1.公司管理员
          * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
      parameters:
        - in: query
          name: operation
          description: '操作类型, in, out, 其他值为非法'
          required: true
          schema:
            type: string
        - in: query
          name: deviceId
          description: 设备id
          required: false
          schema:
            type: integer
        - in: query
          name: departmentId
          description: 部门 id
          required: false
          schema:
            type: integer
        - in: query
          name: sampleTypeId
          description: ' 样品种类 id'
          required: false
          schema:
            type: integer
        - in: query
          name: startTime
          description: 开始时间
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: 结束时间
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'succeeds, 返回 instock 或者 outstock 列表'
          content:
            application/json:
              schema:
                type: object
                properties:
                  instock:
                    description: 入库样品列表
                    type: array
                    items:
                      $ref: '#/components/schemas/SampleStocking'
                  outstock:
                    description: 出库样品列表
                    type: array
                    items:
                      $ref: '#/components/schemas/SampleStocking'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/sample:
    get:
      tags:
        - sample
      description: >-
        查询用户可见的所有设备里的样品列表. 部门管理员-- 其部门里的所有设备; 设备管理员 -- 他为 owner 的所有设备. 设备使用者 --
        他为 operator 的所有设备.
      parameters:
        - in: query
          name: share
          description: '是否包括共享设备, 0 代表不包括, 不传代表1包括'
          required: false
          example: 0 | 1
          schema:
            type: integer
        - in: query
          name: deviceId
          description: 设备 Id
          required: false
          schema:
            type: integer
        - in: query
          name: nameZh
          required: false
          description: '中文名称, 模糊查询'
          schema:
            type: string
        - in: query
          name: nameEn
          description: '英文名称, 模糊查询'
          schema:
            type: integer
        - in: query
          name: brand
          description: 品牌
          required: false
          schema:
            type: string
        - in: query
          name: containerName
          description: 样品柜名称
          required: false
          schema:
            type: string
        - in: query
          name: categoryClass
          description: '样品类型, 当提供了categoryClass 时, nameZh , brand 和 nameEn 忽略'
          schema:
            type: integer
        - in: query
          name: lotNo
          description: 生产批次号
          required: false
          schema:
            type: string
        - in: query
          name: limit
          description: 分页参数
          required: false
          schema:
            type: integer
        - in: query
          name: offset
          description: 分页参数
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 当前页样品集列表
                items:
                  $ref: '#/components/schemas/SampleSetVo'
  /secure/customer/sample/export:
    get:
      tags:
        - sample
      description: '查询用户可见的所有设备里的样品列表. 下载为 excel 文件 '
      parameters:
        - in: query
          name: share
          description: '是否包括共享设备, 0 代表不包括, 不传代表1包括'
          required: false
          example: 0 | 1
          schema:
            type: integer
        - in: query
          name: deviceId
          description: 设备 Id
          required: false
          schema:
            type: integer
        - in: query
          name: nameZh
          required: false
          description: '中文名称, 模糊查询'
          schema:
            type: string
        - in: query
          name: nameEn
          description: '英文名称, 模糊查询'
          schema:
            type: integer
        - in: query
          name: brand
          description: 品牌
          required: false
          schema:
            type: string
        - in: query
          name: containerName
          description: 样品柜名称
          required: false
          schema:
            type: string
        - in: query
          name: categoryClass
          description: '样品类型, 当提供了categoryClass 时, nameZh , brand 和 nameEn 忽略'
          schema:
            type: integer
        - in: query
          name: lotNo
          description: 生产批次号
          required: false
          schema:
            type: string
        - in: query
          name: limit
          description: 分页参数
          required: false
          schema:
            type: integer
        - in: query
          name: offset
          description: 分页参数
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            multipart/form-data:
              schema:
                type: string
                description: 样品查询结果导出的 excel 文件
                format: binary
  '/secure/customer/monitor_target_lab_device/{id}/sample_container/{containerId}/location':
    post:
      tags:
        - sample
      description: |
        添加指定样品柜的层信息
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 设备ID
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleContainerLocation'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleContainerLocation'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
    delete:
      tags:
        - sample
      description: |
        删除指定样品柜的层信息
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 设备ID
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜ID
      responses:
        '200':
          description: succeeds
        '409':
          description: delete failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 50001
                message: delete failed
    put:
      tags:
        - sample
      description: |
        修改指定样品柜的层信息
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 设备ID
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleContainerLocation'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleContainerLocation'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/customer/sample/type:
    get:
      tags:
        - sample_type
      description: |
        list样品种类
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: query
          name: nameZh
          description: 中文名，模糊查询
          required: false
          example: 氢氧化钠
          schema:
            type: string
        - in: query
          name: nameEn
          description: 英文名，模糊查询
          required: false
          example: carbondioxide
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 当前页样品种类列表
                items:
                  $ref: '#/components/schemas/SampleType'
    post:
      tags:
        - sample_type
      description: |
        添加样品种类
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleType'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleType'
  '/secure/customer/sample/type/{id}':
    put:
      tags:
        - sample_type
      description: |
        update样品种
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleType'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleType'
    delete:
      tags:
        - sample_type
      description: |
        删除样品种类
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
      responses:
        '200':
          description: succeeds
  '/secure/customer/sample/type/{id}/file':
    post:
      tags:
        - sample_type
      description: 添加样品种类说明文件.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadFile'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
    get:
      tags:
        - sample_type
      description: list样品种类说明文件.可以操作样品的用户
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 样品种类文件列表
                items:
                  $ref: '#/components/schemas/File'
  '/secure/customer/sample/type/{id}/download/file/{fileId}':
    get:
      tags:
        - sample_type
      description: 下载样品种类说明文件.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
        - in: path
          name: fileId
          required: true
          schema:
            type: integer
          description: 文件id
      responses:
        '200':
          description: succeeds
          content:
            multipart/form-data:
              schema:
                type: string
                description: 文件流
                format: binary
  '/secure/customer/sample/type/{id}/file/{fileId}':
    put:
      tags:
        - sample_type
      description: 'update样品种类说明文件. 不含文件上传, 只修改文件说明，可以操作样品的用户'
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
        - in: path
          name: fileId
          required: true
          schema:
            type: integer
          description: 文件id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadFile'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
    delete:
      tags:
        - sample_type
      description: |
        删除样品种类说明文件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 样品种类id
        - in: path
          name: fileId
          required: true
          schema:
            type: integer
          description: 文件id
      responses:
        '200':
          description: succeeds
  '/secure/customer/sample_container/{containerId}/sample':
    post:
      tags:
        - sample
      description: |
        向设备的指定样品柜放入样品
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rfid:
                  type: string
                  example: a23123123
                  description: rfid  每个样品的唯一标识
                slotCode:
                  type: string
                  example: 1
                  description: 插槽代码
                slotDesc:
                  type: string
                  example: top
                  description: 插槽位置
      responses:
        '200':
          description: succeeds
    put:
      tags:
        - sample
      description: |
        从设备的指定样品柜取出样品
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rfid:
                  type: string
                  example: a123313123213
                  description: 样品的唯一标识
                slotCode:
                  type: string
                  example: 1
                  description: 插槽代码
                slotDesc:
                  type: string
                  example: top
                  description: 位置
      responses:
        '200':
          description: succeeds
  /secure/customer/marine/info/import:
    post:
      tags:
        - specimen
      description: >-
        导入航海物理信息,如果重复导入同一个航次，
        查看该航次的marine_info.id是否再specimen中，  如果在，  返回失败。  否则，删除数据库中所有对应航次的行，加入新的。
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 文件后缀必须为xls或xlsx，后缀被篡改不允许上传
      responses:
        '200':
          description: succeeds
  /secure/customer/marine/info:
    get:
      tags:
        - specimen
      description: >-
        获取最近一次导入的航次的航海物理信息
      responses:
        '200':
          description: 物理信息列表
          content:
            application/json:
              schema:
                type: array
                description: 物理信息列表
                items:
                  $ref: '#/components/schemas/MarineInfo'
  /secure/customer/voyage:
    get:
      tags:
        - specimen
      description: >-
        获取所有航次, 返回值按照时间从后到前排序
      responses:
        '200':
          description: 航次名字列表
          content:
            application/json:
              schema:
                type: array
                description: 航次列表
                items:
                  type: string
                example:
                  - china1
                  - china2
  '/secure/customer/specimen/rfid':
    get:
      tags:
        - specimen
      description: 根据航海物理信息生成样本 rfid 集, 用于批量打印二维码
      parameters:
        - in: query
          name: number
          required: true
          schema:
            type: integer
          description: rfid 条数
        - in: query
          name: marinInfoId
          required: true
          schema:
            type: integer
          description: 航海信息 id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: rfid list
                items:
                  type: string
                example:
                  - sp8324j-fdsjh2230s34-2384
                  - sp29342-12842-234

  '/secure/customer/specimen/{rfid}':
    get:
      tags:
        - specimen
      description: 通过 rfid 获取样本
      parameters:
        - in: path
          name: rfid
          required: true
          schema:
            type: string
          description: rfid

      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Specimen'
  '/secure/customer/specimen':
    get:
      tags:
        - specimen
      description: 查询样本
      parameters:
        - in:  query
          name: name
          schema:
            type: string
          description: 样本名字
        - in:  query
          name: stop
          schema:
            type: string
          description: 站
        - in:  query
          name: depth
          schema:
            type: integer
          description:  水深
        - in:  query
          name: time
          schema:
            type: integer
          description:  采集时间
        - in:  query
          name: voyage
          schema:
            type: string
          description: 航次, 如果不传查询所有航次

      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 样本列表
                items:
                  $ref: '#/components/schemas/Specimen'
  # '/secure/customer/specimen/{id}/cabinet/{cid}/stocking/{op}':
  #   post:
  #     tags:
  #       - specimen
  #     description: 样本出入库操作
  #     parameters:
  #       - in: path
  #         name: id
  #         required: true
  #         schema:
  #           type: string
  #         description: id
  #       - in: path
  #         name: cid
  #         required: true
  #         schema:
  #           type: string
  #         description: cabinet id
  #       - in: path
  #         name: op
  #         required: true
  #         schema:
  #           type: string
  #         description: 操作 in/out
  #     responses:
  #       '200':
  #         description: succeeds
  '/secure/customer/specimen/stocking':
    get:
      tags:
        - specimen
      description: 获取指定时间范围用户可见 cabinet 内样本出入库记录
      parameters:
        - in:  query
          name: startTime
          required: true
          schema:
            type: integer
          description: 时间范围起点
        - in:  query
          name: endTime
          required: true
          schema:
            type: integer
          description: 时间范围终点
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 样本列表
                items:
                  $ref: '#/components/schemas/SpecimenStocking'
  '/secure/customer/specimen/{id}':
    put:
      tags:
        - specimen
      description: modify 样本, 后端需要设置 isRecorded=true
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Specimen'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Specimen'

  /secure/customer/specimen/export:
    get:
      tags:
        - specimen
      description: '导出用户可见 cabinet 里的样本, 下载为 excel 文件 '
      parameters:
        - in: query
          name: voyage
          description: '航次, 不传则导出所有'
          required: false
          example: northpole
          schema:
            type: string

      responses:
        '200':
          description: succeeds
          content:
            multipart/form-data:
              schema:
                type: string
                description: 样本查询结果导出的 excel 文件
                format: binary

  '/secure/customer/monitor_target_lab_device/{monitorTargetId}/measure_rule':
    get:
      tags:
        - rule
      description: |
        查询指定监控对象的监控参数规则
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 规则列表
                items:
                  $ref: '#/components/schemas/MeasureRule'
    post:
      tags:
        - rule
      description: >
        添加 1个 监控参数规则到指定监控对象. body 中的 id 不需要.  sensor 字段为一个数组, 表示和这个 rule
        相关的所有sensor 的 id, 后端需要在关联表里加入对应的项

        * 权限：

        * 1.公司管理员

        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）

        * 3.设备管理员（看到绑定设备  ownerid为userid）

        * 4.设备使用者
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeasureRule'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeasureRule'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/monitor_target_lab_device/{monitorTargetId}/measure_rule/{ruleId}':
    delete:
      tags:
        - rule
      description: |
        从指定监控对象删除1个监控参数规则
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: ruleId
          required: true
          schema:
            type: integer
          description: 规则id
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
    put:
      tags:
        - rule
      description: |
        修改 1个 监控参数规则到指定监控对象
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: ruleId
          required: true
          schema:
            type: integer
          description: 规则id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeasureRule'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/sensor/type:
    get:
      tags:
        - sensor
      description: |
        查询传感器种类
        * 权限：
        * 1.平台管理员
      parameters:
        - in: query
          name: name
          required: false
          schema:
            type: string
          example: sensor
          description: sensor name
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 传感器种类列表
                items:
                  $ref: '#/components/schemas/SensorType'
  /secure/admin/sensor/type:
    post:
      tags:
        - sensor
      description: |
        新增传感器种类
        * 权限：
        * 1.平台管理员
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorType'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SensorType'
  '/secure/admin/sensor/type/{id}':
    delete:
      tags:
        - sensor
      description: |
        删除传感器种类
        * 权限：
        * 1.平台管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 传感器种类id
      responses:
        '200':
          description: succeeds
    put:
      tags:
        - sensor
      description: 修改传感器种类
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 传感器种类id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorType'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SensorType'
  '/secure/admin/sensor/type/{id}/measure/type':
    get:
      tags:
        - sensor
      description: 列举传感器种类下的所有监控参数
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 传感器种类id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 参数列表
                items:
                  $ref: '#/components/schemas/MeasureType'
  '/secure/admin/sensor/type/{id}/measure/type/{measureTypeId}':
    post:
      tags:
        - sensor
      description: 绑定传感器种类和监控参数
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 传感器种类id
        - in: path
          name: measureTypeId
          required: true
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds
    delete:
      tags:
        - sensor
      description: 解绑传感器种类和监控参数
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 传感器种类id
        - in: path
          name: measureTypeId
          required: true
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{monitorTargetId}/sensor':
    get:
      tags:
        - sensor
      description: |
        查询指定监控对象的默认传感器模板列表
        * 权限：
        * 1.公司管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 传感器列表
                items:
                  $ref: '#/components/schemas/Sensor'
    post:
      tags:
        - sensor
      description: |
        添加1个传感器到指定监控对象
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控参数id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorCreate'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sensor'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/monitor_target_lab_device/{monitorTargetId}/sensor/{id}':
    delete:
      tags:
        - sensor
      description: |
        删除指定监控对象的传感器
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: id
          description: sensor id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
    put:
      tags:
        - sensor
      description: |
        修改指定监控对象的传感器
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: path
          name: id
          description: sensor id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorCreate'
      responses:
        '200':
          description: succeeds
  '/secure/measure_type/{id}':
    get:
      tags:
        - measure_type
      description: |
        通过 id 查询监控参数(例如, 温度)
        * 权限：
        * 1.系统管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeasureType'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/measure_type:
    get:
      tags:
        - measure_type
      description: |
        获取所有监控参数
        * 权限：
        * 1.系统管理员
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 参数列表
                items:
                  $ref: '#/components/schemas/MeasureType'
  '/secure/admin/measure_type/{id}':
    delete:
      tags:
        - measure_type
      description: |
        删除指定 id 的监控参数
        * 权限：
        * 1.系统管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: >-
                  cannot delete because there are live devices using this
                  measure type
    put:
      tags:
        - measure_type
      description: |
        更新指定 id 的监控参数
        * 权限：
        * 1.系统管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 传感器种类id
      requestBody:
        description: >-
          measure type object, don't have to contain all fields, any combination
          is good
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeasureType'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/admin/measure_type:
    post:
      tags:
        - measure_type
      description: |
        新增监控参数
        * 权限：
        * 1.系统管理员
      requestBody:
        description: 'measure type object, without id'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeasureType'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeasureType'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/admin/monitor_target_type:
    get:
      tags:
        - monitor_template
      description: |
        获取所有监控模板
        * 权限：
        * 1.系统管理员
      parameters:
        - in: query
          name: limit
          description: '最大获取数量, 即页面大小'
          schema:
            type: integer
        - in: query
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    example: 12
                    description: 总数
                  list:
                    type: array
                    description: 设备种类列表
                    items:
                      $ref: '#/components/schemas/MonitorTargetType'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    post:
      tags:
        - monitor_template
      description: |
        新增监控模板. requestBody 为 multipart, 包含监控组件样图
        * 权限：
        * 1.系统管理员
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: ilab
                  description: 监控模板名称
                companyId:
                  type: integer
                  example: 1
                  description: 所属公司
                description:
                  type: string
                  example: 这是一个描述
                  description: 描述
                measureTypeIds:
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
                    - 3
                    - 4
                  description: 监控参数list
                profileImage:
                  type: string
                  format: binary
                  description: 图片
            encoding:
              profileImage:
                contentType: 'image/png, image/jpeg'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetType'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/customer/monitor_target_type:
    get:
      tags:
        - monitor_template
      description: 获取 用户可见的所有监控模板. 包括所有默认的种类和 company_id 和用户公司对应的模板.
      parameters:
        - in: query
          name: limit
          description: '最大获取数量, 即页面大小'
          schema:
            type: integer
        - in: query
          name: offset
          description: '从第几个开始查询, 即页数 x 页面大小'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 监控种类列表
                items:
                  $ref: '#/components/schemas/MonitorTargetType'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/monitor_target_type/{id}':
    get:
      tags:
        - monitor_template
      description: |
        通过 id 查询登录用户公司下的监控模板
        * 权限：
          * 1.公司管理员
          * 2.设备管理员
          * 3.部门管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控模板id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetType'
        '404':
          description: 'not found, or not belongs to this company'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/admin/monitor_target_type/{id}':
    get:
      tags:
        - monitor_template
      description: 管理员通过 id 获取监控模板
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控模板id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetType'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - monitor_template
      description: 删除监控模板 by id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控模板id
      responses:
        '200':
          description: succeeds
        '409':
          description: cannot delete because of conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 307
                message: cannot delete because there are live devices
    put:
      tags:
        - monitor_template
      description: '更新指定 id 的监控模板, 其中 measureType 中应该加上 id'
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控模板id
      requestBody:
        description: >-
          monitoring target type object, don't have to contain all fields, any
          combination is good
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAndAddMonitorTargetType'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/monitor_target_type/{id}/image':
    put:
      tags:
        - monitor_template
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 监控模板id
      requestBody:
        content:
          image/*:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  imgUrl:
                    type: string
              example:
                imgUrl: 'http://image.com/jfkjdsflasfhakslf'
  '/secure/admin/monitor_target_type/{monitorTargetTypeId}/measure_type':
    get:
      tags:
        - monitor_template
      description: 查询指定监控模板的监控参数
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 监控参数 id 列表
                items:
                  type: integer
    post:
      tags:
        - monitor_template
      description: 添加 1到多个监控参数到指定监控模板
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
              description: 监控参数id list
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/monitor_target_type/{monitorTargetTypeId}/delete/measure_type':
    put:
      tags:
        - monitor_template
      description: 从指定监控模板删除1到多个监控参数
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
              description: 监控参数id列表
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/monitor_target_type/{monitorTargetTypeId}/sensor_template':
    get:
      tags:
        - sensor
      description: 查询指定监控模板的默认传感器模板列表
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 传感器模板列表
                items:
                  $ref: '#/components/schemas/SensorTemplate'
    post:
      tags:
        - sensor
      description: 添加1个传感器模板到指定监控模板
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorTemplate'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SensorTemplate'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/monitor_target_type/{monitorTargetTypeId}/sensor_template/{id}':
    delete:
      tags:
        - sensor
      description: 删除指定监控模板的默认传感器模板
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
        - in: path
          name: id
          description: 模板 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
    put:
      tags:
        - sensor
      description: 修改指定监控模板的默认传感器模板
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
        - in: path
          name: id
          description: 模板 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorTemplate'
      responses:
        '200':
          description: succeeds
  '/secure/admin/monitor_target_type/{monitorTargetTypeId}/measure_rule':
    get:
      tags:
        - rule
      description: '查询指定监控模板的监控参数规则, Model中的 sensor字段无效.'
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 规则列表
                items:
                  $ref: '#/components/schemas/MeasureRule'
    post:
      tags:
        - rule
      description: '添加 1个 监控参数规则到指定监控模板, Model中的 sensor字段 不需要.'
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeasureRule'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeasureRule'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/monitor_target_type/{monitorTargetTypeId}/measure_rule/{ruleId}':
    delete:
      tags:
        - rule
      description: 从指定监控模板删除1个监控参数规则
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
        - in: path
          name: ruleId
          required: true
          schema:
            type: integer
          description: 规则id
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
    put:
      tags:
        - rule
      description: 修改 1个 监控参数规则到指定监控模板
      parameters:
        - in: path
          name: monitorTargetTypeId
          required: true
          schema:
            type: integer
          description: 监控模板id
        - in: path
          name: ruleId
          required: true
          schema:
            type: integer
          description: 规则id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeasureRule'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/monitor_target/{monitorTargetId}/latest/telemetry':
    get:
      tags:
        - telemetry
      description: |
        查询指定监控对象最近的监控数据
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringTargetTelemetries'
  '/secure/customer/monitor_target/latest/telemetry':
    get:
      tags:
        - telemetry
      description: |
        查询指定监控对象列表最近的监控数据
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in:  query
          name: monitorTargetIdList
          required: true
          schema:
            type: string
          example: 1,2,3
          description: 监控对象 id list
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MonitoringTargetTelemetries'
  '/secure/customer/monitor_target/{monitorTargetId}/ranged/telemetry':
    get:
      tags:
        - telemetry
      description: |
        查询指定监控对象指定时间范围内的监控数据
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: query
          name: measureTypeId
          description: '监控参数 Id, 如果没有, 则查询所有这个对象正在监控的所有参数.'
          schema:
            type: integer
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳'
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
      responses:
        '200':
          description: 'succeeds. 返回数据的时间粒度和查询的时间跨度有关, 时间跨度越大, 时间粒度越大.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringTargetTelemetries'
  '/secure/customer/monitor_target/{monitorTargetId}/ranged/aggregated/telemetry/':
    get:
      tags:
        - telemetry
      description: |
        查询指定监控对象指定时间范围内的监控数据 (每一个监控数据是某小段时间区间内的综合值)
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitorTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: query
          name: measureTypeIdList
          description: '监控参数 Id 列表, 用逗号隔开, 如果没有, 则查询所有这个对象正在监控的所有参数.'
          example: 1,2
          schema:
            type: integer
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳'
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
      responses:
        '200':
          description: 'succeeds. 返回数据的时间粒度和查询的时间跨度有关, 时间跨度越大, 时间粒度越大.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringTargetAggregatedTelemetries'
  /secure/customer/daily/alert:
    get:
      tags:
        - telemetry
      description: |
        查询日报警统计, 可以查具体设备, 也可以使某设备种类, 监控参数. 返回时间范围内每日的设备平均红黄报警数量
        对应于1.0中的"/report/daily/alert"
        * 权限：
            * 1.公司管理员
            * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
            * 3.设备管理员
      parameters:
        - in: query
          name: measureTypeId
          description: '监控参数 Id, 如果没有, 则综合所有参数.'
          schema:
            type: integer
        - in: query
          name: monitoringTargetType
          description: '设备类型, 如果没有, 则综合所有类型.'
          schema:
            type: integer
        - in: query
          name: monitoringTargetId
          description: '监控对象 Id, 如果没有, 则综合所有.'
          schema:
            type: integer
        - in: query
          name: monitoringTargetModel
          description: '监控对象型号, 如果没有, 则综合所有.'
          schema:
            type: integer
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳'
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间, 距离起始时间不能超过三个月'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDailyStats'
  /secure/customer/monitor_target/{id}/door/history:
    get:
      tags:
        - telemetry
      description: |
        获取设备门 打开历史
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: 监控对象 id
          required: true
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳'
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间, 距离起始时间不能超过三个月'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DoorOpenHistory'
  /secure/customer/statistics/monitor_target/measure_type:
    get:
      tags:
        - statistics
      description: |
        获取监控对象和监控参数
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  monitorTargetTypeSet:
                    type: array
                    description: 监控模板集合
                    items:
                      $ref: '#/components/schemas/StatsMonitorTargetType'
                  monitorTargetSet:
                    type: array
                    description: 监控对象集合
                    items:
                      $ref: '#/components/schemas/StatsMonitorTarget'
                  measureTypeSet:
                    type: array
                    items:
                      $ref: '#/components/schemas/NameAndId'
                    description: 参数name和id的集合
  /secure/customer/statistics/monitor_target/daily/alert:
    get:
      tags:
        - statistics
      description: |
        查询日均报警统计. 时间跨度最大为一年.
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
        * 参数: 监控对象或者设备种类必须至少输入一个
      parameters:
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳.'
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
        - in: query
          name: monitoringTargetType
          schema:
            type: string
          description: 设备类型
        - in: query
          name: measureTypeId
          description: 监控参数种类id
          schema:
            type: integer
        - in: query
          name: monitoringTargetId
          description: 监控对象id
          schema:
            type: integer
        - in: query
          name: alertType
          schema:
            type: string
          description: 报警类型
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  time:
                    description: '日时间序列, 格式为YYYY-MM-DD,'
                    type: array
                    example:
                      - '2018-01-01'
                      - '2018-01-02'
                    items:
                      type: string
                  alertDailyList:
                    description: '日报警序列, 按报警种类分'
                    type: array
                    items:
                      type: object
                      properties:
                        alertType:
                          type: string
                          description: '报警类型, 根据系统语言返回值不同'
                          example: red_alert | yellow_alert | offline | expired
                        alertTypeId:
                          type: integer
                          description: 报警类型Id
                        alertCount:
                          description: 日均报警数. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: integer
  /secure/customer/statistics/monitor_target/daily/telemetry:
    get:
      tags:
        - statistics
      description: |
        查询监控统计历史 日均. 时间跨度最大为一年
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: query
          name: startTime
          required: true
          description: '时间范围起始点, 格式为毫秒时间戳.'
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
        - in: query
          required: true
          name: monitoringTargetId
          description: 设备 id
          schema:
            type: integer
        - in: query
          name: measureTypeId
          schema:
            type: integer
          description: 监控参数id
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  time:
                    description: '日时间序列, 格式为YYYY-MM-DD,'
                    type: array
                    example:
                      - '2018-01-01'
                      - '2018-01-02'
                    items:
                      type: string
                  telemetryList:
                    description: '日监控值序列, 按参数种类分'
                    type: array
                    items:
                      type: object
                      properties:
                        measureType:
                          type: string
                          example: voltage
                          description: '参数类型, 根据系统语言返回值不同'
                        measureTypeId:
                          type: integer
                          description: 参数类型Id
                        measureTypeUnit:
                          type: string
                          description: 参数值单位
                          example: V
                        avgValue:
                          description: 日均参数. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: number
                        maxValue:
                          description: 日参数最大值. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: number
                        minValue:
                          description: 日参数最小值. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: number
  /secure/customer/statistics/monitor_target/hourly/telemetry:
    get:
      tags:
        - statistics
      description: |
        查询监控统计历史 时均. 时间范围最大值为一个月
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: query
          name: startTime
          required: true
          description: '时间范围起始点, 格式为毫秒时间戳.'
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
        - in: query
          name: measureTypeId
          schema:
            type: integer
          description: 监控参数id
        - in: query
          name: monitoringTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  time:
                    description: '小时时间序列, 格式为毫秒时间戳,'
                    type: array
                    example:
                      - 1356700000
                      - 1527900000
                    items:
                      type: integer
                  telemetryList:
                    description: '小时监控值序列, 按参数种类分'
                    type: array
                    items:
                      type: object
                      properties:
                        measureType:
                          type: string
                          description: '参数类型, 根据系统语言返回值不同'
                          example: voltage
                        measureTypeId:
                          type: integer
                          description: 参数类型Id
                        measureTypeUnit:
                          type: string
                          description: 参数值单位
                          example: V
                        avgValue:
                          description: 日均参数. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: number
                        maxValue:
                          description: 日参数最大值. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: number
                        minValue:
                          description: 日参数最小值. 格式为一个数组
                          type: array
                          example:
                            - 2
                            - 3
                          items:
                            type: number
  /secure/customer/statistics/monitor_target/hourly/utilization:
    get:
      tags:
        - statistics
      description: |
        查询某设备种类下所有设备的小时利用率. 时间跨度最大值为一个月
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
        * 参数
        * 1. 当选中一组设备的时候会返回每个设备的利用率序列
        * 2. 当选中一组设备种类时, 会返回每个种类的利用率序列
      parameters:
        - in: query
          name: startTime
          required: true
          description: '时间范围起始点, 格式为毫秒时间戳. '
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
        - in: query
          name: monitoringTargetIdList
          description: '监控对象id 列表, 用逗号隔开'
          example: '1,2,3'
          schema:
            type: string
        - in: query
          name: monitoringTargetTypeList
          example: 'fridge,robot'
          schema:
            type: string
          description: '设备类型列表, 用逗号隔开'
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  time:
                    description: 'hourly时间序列,'
                    type: array
                    example:
                      - 1345670000
                      - 1567800000
                    items:
                      type: integer
                  utilizationList:
                    description: '小时利用率值序列, 按设备种类'
                    type: array
                    items:
                      type: object
                      properties:
                        monitoringTargetType:
                          type: string
                          description: 设备类型
                          example: fridge
                        monitoringTarget:
                          type: string
                          description: 设备名
                          example: fridge001
                        monitoringTargetId:
                          type: integer
                          description: 设备 id
                        value:
                          description: 利用率序列
                          type: array
                          example:
                            - 0.2
                            - 0.3
                          items:
                            type: number
                        totalAvg:
                          description: 总平均利用率
                          example: 0.66
                          type: number
  /secure/customer/statistics/monitor_target/daily/utilization:
    get:
      tags:
        - statistics
      description: |
        查询某设备种类下所有设备的小时利用率的 daily 统计值. 时间范围最大为一年
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
        * 参数
        * 1. 当选中一组设备的时候会返回每个设备的利用率序列
        * 2. 当选中一组设备种类时, 会返回每个种类的利用率序列
      parameters:
        - in: query
          name: startTime
          required: true
          description: '时间范围起始点, 格式为毫秒时间戳.'
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
        - in: query
          name: monitoringTargetIdList
          description: '监控对象id 列表, 用逗号隔开'
          example: '1,2,3'
          schema:
            type: string
        - in: query
          name: monitoringTargetTypeList
          example: 'fridge,tv'
          schema:
            type: string
          description: '设备类型列表, 用逗号隔开'
        - in: query
          name: startHoursTime
          example: 28800000
          schema:
            type: integer
          description: '工作时的开始时间'
        - in: query
          name: endHoursTime
          example: 64800000
          schema:
            type: integer
          description: '工作时的结束时间'
        - in: query
          name: workDay
          example: 0
          schema:
            type: integer
          description: '工作日/自然日的判断条件   工作：0; 自然日: 1'
        - in: query
          name: workHours
          example: 0
          schema:
            type: integer
          description: '工作时的判断'
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  time:
                    description: 日时间序列
                    type: array
                    example:
                      - [[ "2019-08-01"],["2019-08-02"]]
                    items:
                      type: string
                  utilizationList:
                    description: 日利用率值序列
                    type: array
                    items:
                      type: object
                      properties:
                        monitoringTargetType:
                          type: string
                          description: 设备类型
                          example: fridge
                        monitoringTarget:
                          type: string
                          description: 设备名
                          example: fridge001
                        monitoringTargetId:
                          type: integer
                          description: 设备 id
                        value:
                          description: '日均 利用率序列, 百分比. 格式为一个数组'
                          type: array
                          example:
                            - 0.2
                            - 0.3
                          items:
                            type: number
                        totalAvg:
                          description: 总平均利用率
                          example: 0.66
                          type: number
  /secure/customer/statistics/event/status:
    get:
      tags:
        - statistics
      description: |
        查询设备事件状态统计, 时间跨度最大值为一年
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: query
          name: startTime
          required: true
          description: '时间范围起始点, 格式为毫秒时间戳. '
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
        - in: query
          name: category
          description: '事件种类, 如果不输入, 后端默认为全部'
          schema:
            type: string
          example: alert
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  recoveredCount:
                    description: 已恢复事件数
                    type: integer
                    example: 20
                  activeCount:
                    description: 当前活跃事件数
                    type: integer
                    example: 3
                  fixedCount:
                    description: 人为修复事件数
                    type: integer
                    example: 5
  '/secure/customer/monitor_target/{monitoringTargetId}/ranged/utilization':
    get:
      tags:
        - utilization
      description: |
        查询指定监控对象指定时间范围内的hourly利用率. 时间跨度不能超过60天. 对应于1.0中的 "/device/utilization"
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitoringTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳. 如果没有输入, 服务器自动选择为一周前时间.'
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: id
                  hourlyUtilizations:
                    type: array
                    description: 数据合集
                    items:
                      $ref: '#/components/schemas/HourlyUtilization'
  '/secure/customer/monitor_target/{monitoringTargetId}/yesterday/utilization':
    get:
      tags:
        - utilization
      description: |
        查询指定监控对象指定时间范围内昨日利用率. 对应于1.0中的"/device/daily/utilization"
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: path
          name: monitoringTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DailyUtilization'
  /secure/customer/user/operations:
    get:
      tags:
        - statistics
      description: '查询用户操作. 只能由部门管理员执行. 可以看到其部门内的用户的操作历史. 返回操作列表, 如果是修改操作, 需要给出操作前后的值.'
      parameters:
        - in: query
          name: operationtype
          description: '操作种类. 值为 [query, update, insert, delete]'
          schema:
            type: string
        - in: query
          name: responseCode
          description: '操作是否成功. 值为 success, 其他任何值视为失败'
          schema:
            type: string
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳. 如果没有输入, 服务器自动选择为一周前时间.'
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                description: 操作序列
                items:
                  $ref: '#/components/schemas/Operation'
  /secure/customer/event:
    get:
      tags:
        - event
      description: |
        查询各类事件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
        * 4.设备使用者
      parameters:
        - in: query
          name: monitorTarget
          required: false
          schema:
            type: string
          description: 监控对象
        - in: query
          name: monitorTargetType
          required: false
          schema:
            type: string
          description: 监控模板类型
        - in: query
          name: measureType
          description: '监控参数, 需要至少和上面两个参数中的一个搭配使用'
          required: false
          schema:
            type: string
        - in: query
          name: eventTypeId
          description: 事件类型 id
          required: false
          schema:
            type: integer
        - in: query
          name: startTime
          required: false
          schema:
            type: integer
          description: 开始时间
        - in: query
          name: endTime
          required: false
          schema:
            type: integer
          description: 结束时间
        - in: query
          name: status
          description: '状态, 如果不传, 查询全部.'
          example: 'NONE, ACKNOWLEDGED, PROCESSING, FIXED, OPEN, ACCEPTED, IGNORED, INVESTIGATED, NOTICE, INNOCENT, HEARING, PUNISH, CLOSED, ARCHIVED'
          required: false
          schema:
            type: string
        - in: query
          name: monitorTargetId
          description: 监控对象 id
          required: false
          schema:
            type: integer
        - in: query
          name: deviceType
          description:  设备种类名称
          required: false
          schema:
            type: string
        - in: query
          name: departmentId
          description:  部门 id
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    description: 总数
                  page:
                    type: integer
                    description: 总页数
                  list:
                    type: array
                    description: 数据列表
                    items:
                      $ref: '#/components/schemas/Event'
  '/secure/event/{id}/process':
    put:
      tags:
        - event
      description: |
        修改事件处理状态
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门
        * 3.设备管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件 id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: 事件处理情况
              properties:
                diagnoseReason:
                  type: string
                  description: 事件原因
                  example: router failure
                correctiveAction:
                  type: string
                  description: 处理方法
                  example: restart
                processStatus:
                  type: string
                  description: 状态
                  example: 'NONE, ACKNOWLEDGED, PROCESSING, FIXED, OPEN, ACCEPTED, IGNORED, INVESTIGATED, NOTICE, INNOCENT, HEARING, PUNISH, CLOSED, ARCHIVED'
      responses:
        '200':
          description: succeeds.
  '/secure/customer/event/{id}/history':
    get:
      tags:
        - event
      description: |
        读取事件处理状态修改的历史
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门
        * 3.设备管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件 id
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventStatusChange'

  /secure/customer/weijian/events/data:
    get:
      tags:
        - Weijian
      description: |
        查询指定时间范围内事件列表, 包括事件发生时间前后半小时的监控数据.
        事件按照时间顺序从后到前. 要求分页, 每页不能大于 10. 如果参数大于 10 最多只返回 10 个.
        如果不设置开始时间, 默认为一周前, 如果不设置结束时间, 默认为当前.
        如果 monitoringTargetId 有, 那么 departmentId 忽略.
        * 权限:
          * 所有人员
      parameters:
        - in: query
          name: monitoringTargetId
          required: false
          schema:
            type: integer
          description: 监控对象 id
        - in: query
          name: departmentId
          schema:
            type: integer
          description: 部门 id
        - in: query
          name: eventTypeId
          required: false
          schema:
            type: integer
          description: 事件种类id
          example: 1
        - in: query
          name: startTime
          required: false
          schema:
            type: integer
          description: 开始时间
        - in: query
          name: endTime
          required: false
          schema:
            type: integer
          description: 结束时间
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventWithData'


  /secure/customer/weijian/event/stats/status:
    get:
      tags:
        - Weijian
      description: |
        查询各类事件的统计, 返回值根据参数 tense 来决定, 如果是 current 就返回当前状态的统计值.
        如果是 completed 就返回已完成的统计值. 如果返回的是统计值, 前端显示主线状态.
        OPEN, ACKNOWLEDGED, ACCEPTED, INVESTIGATED, NOTICE, PUNISH, CLOSED, ARCHIVED
        * 权限：
        * 1.公司管理员

      parameters:
        - in: query
          name: startTime
          required: false
          schema:
            type: integer
          description: 起始时间戳, 如果不传, 默认为一周前
        - in: query
          name:  departmentId
          required: false
          schema:
            type: integer
          description: 部门 id, 如果不传, 查询全部
        - in: query
          name: tense
          schema:
            type: string
          required: false
          description: 时间状态, current | completed, 默认为 current

      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventStatusStats'
  /secure/event_type:
    get:
      tags:
        - event_type
      description: |
        查询事件种类
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      parameters:
        - in: query
          name: level
          required: false
          schema:
            type: integer
          description: 报警类型的level，默认0，用来区分设备报警和样品报警;样品报警为0，设备报警大于0
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                description: 事件种类列表
                items:
                  $ref: '#/components/schemas/EventType'
  /secure/event/type/count:
    get:
      tags:
        - event_type
      description: |
        统计事件种类
        * 权限：
        * 1.公司管理员
        * 2.部门管理员
        * 3.设备管理员
      parameters:
        - in: query
          name: monitoringTargetId
          required: false
          schema:
            type: integer
          description: 监控对象 id, 如果不传, 返回所有
        - in: query
          name: idList
          required: true
          schema:
            type: integer
          description:  事件种类 id 列表, 用逗号隔开
          example: 1,2,3
        - in: query
          name: startTime
          required: false
          schema:
            type: integer
          description: 开始时间戳, 如果不传, 默认为一周前
        - in: query
          name: endTime
          required: false
          schema:
            type: integer
          description: 结束时间戳, 如果不传, 默认为当前时间
      responses:
        '200':
          description: succeeds.
          content:
            application/json:
              schema:
                type: array
                description: 事件种类列表
                items:
                  $ref: '#/components/schemas/EventTypeStats'

  /secure/operating_status_model:
    get:
      tags:
        - operating_status
      description: 获取所有设备状态模型
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: 总数
                  list:
                    type: array
                    description: 模型列表
                    items:
                      $ref: '#/components/schemas/OperatingStatusModel'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/admin/operating_status_model:
    post:
      tags:
        - operating_status
      description: 新增运行状态模型
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatingStatusModel'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatingStatusModel'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/operating_status_model/{id}':
    put:
      tags:
        - operating_status
      description: 修改运行状态模型
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 运行状态模型id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatingStatusModel'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatingStatusModel'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - operating_status
      description: 删除运行状态模型
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 运行状态模型id
      responses:
        '200':
          description: succeeds
  /secure/admin/monitor_target_type/operating_status_model:
    post:
      tags:
        - operating_status
      description: 新增设备种类运行状态模型
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitorTargetTypeOperatingStatusModel'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetTypeOperatingStatusModel'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/admin/monitor_target_type/{id}/operating_status_model':
    get:
      tags:
        - operating_status
      description: 获取指定设备种类id 的运行状态模型
      parameters:
        - in: path
          name: id
          description: monitor target type id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetTypeOperatingStatusModel'
  '/secure/admin/monitor_target_type/operating_status_model/{id}':
    put:
      tags:
        - operating_status
      description: 修改设备种类运行状态模型
      parameters:
        - in: path
          name: id
          description: model id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitorTargetTypeOperatingStatusModel'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetTypeOperatingStatusModel'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - operating_status
      description: 删除设备种类运行状态模型
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: model id
      responses:
        '200':
          description: succeeds
  /secure/customer/monitor_target/operating_status_model:
    post:
      tags:
        - operating_status
      description: 新增设备运行状态模型
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitorTargetOperatingStatusModel'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetOperatingStatusModel'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/customer/monitor_target/{id}/operating_status_model':
    get:
      tags:
        - operating_status
      description: 获取指定设备id 的运行状态模型
      parameters:
        - in: path
          name: id
          description: monitor target id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                  list:
                    type: array
                    description: 模型列表
                    items:
                      $ref: '#/components/schemas/MonitorTargetOperatingStatusModel'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/monitor_target/operating_status_model/{id}':
    put:
      tags:
        - operating_status
      description: 修改指定 id 设备种类运行状态模型
      parameters:
        - in: path
          name: id
          description: model id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitorTargetOperatingStatusModel'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetOperatingStatusModel'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - operating_status
      description: 删除指定 id 设备种类运行状态模型
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: model id
      responses:
        '200':
          description: succeeds
  /secure/customer/sample/excel/check:
    post:
      tags:
        - excel
      description: >
        校验数据逻辑（如：校验excel单元格内的数据格式级类型是否合理，不同的sample的rfid是否相同等），返回值中会包含数据总条数，报错行数以及报错原因等

        * 权限：

        * 1.公司管理员

        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）

        * 3.设备管理员
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 文件后缀必须为xls或xlsx，后缀被篡改不允许上传
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/monitoring_target/{monitoringTargetId}/ranged/operating_status':
    get:
      tags:
        - operating_status
      description: >-
        查询指定监控对象指定时间范围内的运行状态. 时间跨度不能大于3小时. 返回值为一个时间序列, 值为整数. 20代表运行, 10代表待机,
        0代表停机.如果设备无状态参数, 返回为空.
      parameters:
        - in: path
          name: monitoringTargetId
          required: true
          schema:
            type: integer
          description: 运行状态模型id
        - in: query
          name: startTime
          description: '时间范围起始点, 格式为毫秒时间戳'
          required: true
          schema:
            type: integer
        - in: query
          name: endTime
          description: '时间范围结束点, 如果没有输入, 服务器自动选择为当前时间'
          schema:
            type: integer
      responses:
        '200':
          description: 'succeeds. '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringTargetOperatingStatus'
  '/secure/customer/monitoring_target/{monitoringTargetId}/latest/operating_status':
    get:
      tags:
        - operating_status
      description: >-
        查询指定监控对象最近一个运行状态. 返回值为一个长度为1的时间序列, 值为整数. 20代表运行, 10代表待机, 0代表停机.
        如果设备无状态参数, 返回为空.
      parameters:
        - in: path
          name: monitoringTargetId
          required: true
          schema:
            type: integer
          description: 监控对象id
      responses:
        '200':
          description: 'succeeds. '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitoringTargetOperatingStatus'
  /secure/customer/sample/excel/Import:
    post:
      tags:
        - excel
      description: |
        不同的角色需要有不同的校验逻辑，返回值中会包含数据总条数，添加成功行数以及失败行数，失败则会给出失败原因
        * 权限：
        * 1.公司管理员
        * 2.部门管理员子部门（子部门的permission_cascade为ALL或者DIRECT）
        * 3.设备管理员
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 文件后缀必须为xls或xlsx，后缀被篡改不允许上传
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  createCount:
                    type: integer
                    description: 通过导入 excel 新建的样品数量
                  updateCount:
                    type: integer
                    description: 通过导入 excel 更新的样品数量
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/sample/operation:
    get:
      tags:
        - sample
      description: |
        查询样品在指定时间内的入库操作记录, 支持分页, limit. offset. 时间跨度不超过1年.
        * 权限：
          * 1.公司管理员
          * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
      parameters:
        - in: query
          name: deviceId
          description: 设备id
          required: false
          schema:
            type: integer
        - in: query
          name: departmentId
          description: 部门 id
          required: false
          schema:
            type: integer
        - in: query
          name: sampleSetId
          description: ' 样品类型 id'
          required: false
          schema:
            type: integer
        - in: query
          name: startTime
          description: ' 起始时间戳'
          required: false
          schema:
            type: integer
        - in: query
          name: endTime
          description: 结束时间戳
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: 这段时间内一共有多少操作
                  operations:
                    type: array
                    description: 样品操作列表
                    items:
                      $ref: '#/components/schemas/SampleSetVo'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/sample/sample_type/count:
    get:
      tags:
        - sample
      parameters:
        - in: query
          name: sampleTypeId
          required: false
          schema:
            type: string
          example: 1
          description: 样品中类id
        - in: query
          name: category
          required: false
          schema:
            type: string
          example: 酸
          description: 类别
        - in: query
          name: departmentId
          required: false
          schema:
            type: string
          example: 1
          description: 部门id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: 总数
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/sample/rfid/{rfid}:
    get:
      tags:
        - sample
      description: |
        查询 sample 的名字, 根据 rfid
      parameters:
        - in: path
          name: rfid
          required: true
          schema:
            type: string
          example: ec90aa7975332
          description: 样品的rfid

      responses:
        '200':
          description: succeeds 返回该rfid对应的sample
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    chinse:
                      type: string
                      description: 中文名字
                    english:
                      type: string
                      description: 英文名字
                    brand:
                      type: string
                      description: 品牌
                    category:
                      type: string
                      description: 种类
                    container:
                      type: string
                      description: 柜子名称

  /secure/customer/sample/check/rfid:
    get:
      tags:
        - sample
      description: |
        校验该RFID是否存在和出入库状态
      parameters:
        - in: query
          name: rfid
          required: true
          schema:
            type: integer
          example: 7975332
          description: 样品的rfid
        - in: query
          name: operation
          required: true
          schema:
            type: string
          example: in/out
          description: 对该样品进行的操作
      responses:
        '200':
          description: succeeds 返回该rfid对应的sample
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SampleVo'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/sample/operation/in/{deviceId}/{containerId}':
    post:
      tags:
        - sample
      description: |
        批量新增入库的记录
        * 权限：
        * 1.公司管理员
        * 2.部门管理员
        * 3.设备管理员
      parameters:
        - in: path
          name: deviceId
          required: true
          schema:
            type: integer
          description: 设备id
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                rfid:
                  type: string
                  example: '223123123,12877891,812798412'
                  description: 'rfid  每个样品的唯一标识,多个用","分隔'
      responses:
        '200':
          description: succeeds
  '/secure/customer/sample/operation/out/{deviceId}/{containerId}':
    post:
      tags:
        - sample
      description: |
        批量新增出库的记录
        * 权限：
        * 1.公司管理员
        * 2.部门管理员
        * 3.设备管理员
      parameters:
        - in: path
          name: deviceId
          required: true
          schema:
            type: integer
          description: 设备id
        - in: path
          name: containerId
          required: true
          schema:
            type: integer
          description: 样品柜id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                rfid:
                  type: string
                  example: '223123123,12877891,812798412'
                  description: 'rfid  每个样品的唯一标识,多个用","分隔'
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitoring_target_lab_device/{id}/bind/media':
    get:
      tags:
        - private
      description: 为设备绑定 email/phone
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: array
                    description: email列表
                    example:
                      - aa@qq.com
                      - bb@qq.com
                    items:
                      type: string
                  phone:
                    type: array
                    description: '手机号列表, 用逗号隔开'
                    example:
                      - 13311112222
                      - 13511112222
                    items:
                      type: string
    post:
      tags:
        - private
      description: 为设备绑定 email/phone
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: array
                  description: email列表
                  example:
                    - aa@qq.com
                    - bb@qq.com
                  items:
                    type: string
                phone:
                  type: array
                  description: '手机号列表, 用逗号隔开'
                  example:
                    - 13311112222
                    - 13511112222
                  items:
                    type: string
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitoring_target_lab_device/{id}/unbind/media':
    put:
      tags:
        - private
      description: 为设备解绑 email/phone
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: array
                  description: email列表
                  example:
                    - aa@qq.com
                    - bb@qq.com
                  items:
                    type: string
                phone:
                  type: array
                  description: '手机号列表, 用逗号隔开'
                  example:
                    - 13311112222
                    - 13511112222
                  items:
                    type: string
      responses:
        '200':
          description: succeeds
  /secure/customer/send/email:
    put:
      tags:
        - private
      description: 发送 email
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: array
                  description: email列表
                  example:
                    - aa@qq.com
                    - bb@qq.com
                  items:
                    type: string
                title:
                  type: string
                  description: 邮件标题
                  example: problem fixed
                content:
                  type: string
                  description: 邮件内容
                  example: ' device fridge problem fixed'
      responses:
        '200':
          description: succeeds
  '/secure/customer/monitor_target_lab_device/{id}/tag/operating/status':
    post:
      tags:
        - private
      description: 为设备标注当前运行状态. 权限 -- 设备使用者对自己使用的设备.
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                statusLevel:
                  type: integer
                  description: '状态 level, 20为运行, 10 待机, 0 停机'
                  example: '20,10,0'
                startTime:
                  type: integer
                  description: '起始时间, 如果不传, 后端默认为当前时间'
                  example: 15672300000
                durationSeconds:
                  type: integer
                  description: 持续秒数
                  example: 60
              required:
                - statusLevel
                - durationSeconds
      responses:
        '200':
          description: succeeds
  '/secure/customer/iot_terminal/{sn}/change/sn/{newsn}':
    post:
      tags:
        - private
      description: iot_terminal 修改序列号, 只对未激活的设备有效. 权限 -- 实施工程师.
      parameters:
        - in: path
          name: sn
          description: iot terminal SN
          required: true
          schema:
            type: string
        - in: path
          name: newsn
          description: iot terminal new SN
          required: true
          schema:
            type: string
      responses:
        '200':
          description: succeeds

  '/secure/customer/monitor_target_lab_device/{id}/tag/event':
    post:
      tags:
        - private
      description: 为设备标注当前运行状态. 权限 -- 设备使用者对自己使用的设备.
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                eventType:
                  type: string
                  description: '事件种类'
                  example: 'sanitize'
                startTime:
                  type: integer
                  description: '起始时间, 如果不传, 后端默认为当前时间'
                  example: 15672300000
                durationSeconds:
                  type: integer
                  description: 持续秒数
                  example: 60
                positive:
                  type: integer
                  description: '0否定, 1 肯定'
                  example: 1 | 0
                measurement:
                  type: string
                  description: 监控参数
                  example: humidity
              required:
                - event
                - durationSeconds
                - startTime
                - positive
      responses:
        '200':
          description: succeeds

  '/secure/customer/monitor_target_lab_device/{id}/tag/operation/validity':
    post:
      tags:
        - private
      description: 为设备标注指定时间段是否为一个 operation. 权限为 super, 设备管理员, 设备使用者.
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isValid:
                  type: integer
                  description: '0 invalid, 1 valid'
                  example: '1 | 0'
                startTime:
                  type: integer
                  description: '起始时间'
                  example: 15672300000
                endTime:
                  type: integer
                  description: '结束时间'
                  example: 15672300000
                operationType:
                  type: string
                  description: '操作种类, 对应 event type'
                  example: sanitize
              required:
                - isValid
                - startTime
                - endTime
                - operationType
      responses:
        '200':
          description: succeeds
  '/secure/private/admin/event/{id}/valid/{value}':
    put:
      tags:
        - private
      description: 设置事件有效性
      parameters:
        - in: path
          name: id
          description: 事件 id
          required: true
          schema:
            type: integer
        - in: path
          name: value
          description:  有效性的值, 0,1,2,3
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
  /secure/maintenance/customer/supplier:
    get:
      tags:
        - maintenance
      description: |
        查询供应商列表
          * 权限：
          * 1.平台管理员 -- 查看管理平台签约的供应商
          * 2.公司管理员 -- 查看公司签约的供应商
      parameters:
        - in: query
          name: name
          description: 名称
          required: true
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceSupplier'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    post:
      tags:
        - maintenance
      description: |
        为一个公司添加一个供应商，这个接口所有的平台均可调用，系统逻辑会自动为登录用户所在公司添加供应商
          * 权限：
          * 1.平台管理员
          * 2.公司管理员
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenanceSupplier'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceSupplier'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'

  '/secure/maintenance/customer/supplier/{id}':
    get:
      tags:
        - maintenance
      description: |
        查询供应商详情.
          * 权限：所有能够看到供应商的人
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 供应商 id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceSupplier'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    put:
      tags:
        - maintenance
      description: |
        修改供应商，这个接口所有的平台均可调用
          * 权限：
          * 1.平台管理员
          * 2.公司管理员
      parameters:
        - in: path
          name: id
          description: 供应商 id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenanceSupplier'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceSupplier'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
    delete:
      tags:
        - maintenance
      description: |
        删除一个供应商，这个接口所有的平台均可调用
          * 权限：
          * 1.平台管理员
          * 2.公司管理员
      parameters:
        - in: path
          name: id
          description: 供应商 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'

  '/secure/maintenance/admin/supplier/{id}/company/{cid}':
    put:
      tags:
        - maintenance
      description: |
        为一个公司制定一个供应商
          * 权限：
          * 1.平台管理员
      parameters:
        - in: path
          name: id
          description: 供应商 id
          required: true
          schema:
            type: integer
        - in: path
          name: cid
          description: 公司 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  # /secure/customer/maintain/getlist:
  #   get:
  #     tags:
  #       - maintenance
  #     description: |
  #       查询维修信息列表.
  #         * 权限：
  #         * 1.平台管理员
  #         * 2.公司管理员
  #         * 3.部门管理员
  #         * 4.设备管理员
  #     responses:
  #       '200':
  #         description: succeeds
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/MaintenanceRecord'
  #       '404':
  #         description: not found
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/ErrorInfo'
  # '/secure/customer/maintain/{id}/getInfo':
  #   get:
  #     tags:
  #       - maintenance
  #     description: |
  #       维修信息详情.
  #         * 权限：所有能够看到列表的人
  #     parameters:
  #       - in: path
  #         name: id
  #         required: true
  #         schema:
  #           type: integer
  #         description: 信息 id
  #     responses:
  #       '200':
  #         description: succeeds
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/MaintenanceRecord'
  #       '404':
  #         description: not found
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/ErrorInfo'
  # '/secure/customer/maintain/{id}':
  #   put:
  #     tags:
  #       - maintenance
  #     description: |
  #       修改维修信息，这个接口所有的平台均可调用
  #         * 权限：
  #         * 1.平台管理员
  #     parameters:
  #       - in: path
  #         name: id
  #         description: 信息 id
  #         required: true
  #         schema:
  #           type: integer
  #     requestBody:
  #       required: true
  #       content:
  #         application/json:
  #           schema:
  #             $ref: '#/components/schemas/MaintenanceRecord'
  #     responses:
  #       '200':
  #         description: succeeds
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/MaintenanceRecord'
  #       '500':
  #         description: 服务器处理错误
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/ErrorInfo'
  #             example:
  #               code: 304
  #               message: 'cannot update because of db, try later'
  #   delete:
  #     tags:
  #       - maintenance
  #     description: |
  #       删除维修信息，这个接口所有的平台均可调用
  #         * 权限：
  #         * 1.平台管理员
  #     parameters:
  #       - in: path
  #         name: id
  #         description: 信息 id
  #         required: true
  #         schema:
  #           type: integer
  #     responses:
  #       '200':
  #         description: succeeds
  #       '500':
  #         description: 服务器处理错误
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/ErrorInfo'
  #             example:
  #               code: 304
  #               message: 'cannot update because of db, try later'

  /secure/maintenance/customer/maintenance:
    post:
      tags:
        - maintenance
      description: |
        请求维修服务
          * 权限：
          * 1.设备管理员
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenanceRecordCreate'
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceRecord'
    get:
      tags:
        - maintenance
      description: |
        查询维修信息列表.
          * 权限：
          * 1.平台管理员
          * 2.公司管理员
          * 3.部门管理员
          * 4.设备管理员
          * 5.维修人员, 只能看到自己隶属的 supplier 下的, 或者没有指定 supplier 的维修
      parameters:
        - name: isClosed
          in: query
          description: 是否关闭, 1 已经关闭, 0 全部, 默认为0
          schema:
            type: integer
        - name: deviceId
          in: query
          description: 设备Id
          schema:
            type: integer
        - name: startTime
          in: query
          description: 开始时间
          schema:
            type: integer
        - name: endTime
          in: query
          description: 结束时间
          schema:
            type: integer
        - name: code
          in: query
          description: 服务单号
          schema:
            type: string
        - name: type
          in: query
          description: maintain,repair
          schema:
            type: string

      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenanceRecord'
  /secure/maintenance/customer/maintenance/list:
    get:
      tags:
        - maintenance
      description: |
        根据记录状态查询维修信息列表.
          * 权限：
          * 1.平台管理员
          * 2.公司管理员
          * 3.部门管理员
          * 4.设备管理员
          * 5.维修人员, 只能看到自己隶属的 supplier 下的, 或者没有指定 supplier 的维修
      parameters:
        - name: assetId
          in: query
          description: 设备assetId
          schema:
            type: string
        - name: startTime
          in: query
          description: 开始时间
          schema:
            type: integer
        - name: endTime
          in: query
          description: 结束时间
          schema:
            type: integer
        - name: code
          in: query
          description: 服务单号
          schema:
            type: string
        - name: status
          in: query
          description: 已提出OPEN 已确认 ACK 维修中 SCHEDULED  结束FINISH
          schema:
            type: string
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenanceRecord'
  /secure/maintenance/customer/maintenance/plan_list:
    get:
      tags:
        - maintenance
      description: |
        计划服务信息：筛选字段:类型、时间（下次服务时间）
      parameters:
        - name: assetId
          in: query
          description: 资产编号
          schema:
            type: string
        - name: serviceType
          in: query
          description: 服务类型
          schema:
            type: string
        - name: startTime
          in: query
          description: 筛选开始的时间
          schema:
            type: integer
        - name: endTime
          in: query
          description: 筛选结束的时间
          schema:
            type: integer
        - name: offset
          in: query
          description: offset
          schema:
            type: integer
        - name: limit
          in: query
          description: limit
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenancePlanList'
  /secure/maintenance/customer/maintenance/plan_record:
    get:
      tags:
        - maintenance
      description: |
        获取计划维修历史 根据服务类型和时间段（结束时间）
      parameters:
        - name: assetId
          in: query
          description: 资产编号
          schema:
            type: string
        - name: serviceType
          in: query
          description: 服务类型
          schema:
            type: string
        - name: startTime
          in: query
          description: 筛选的开始时间
          schema:
            type: integer
        - name: endTime
          in: query
          description: 筛选的结束时间
          schema:
            type: integer
        - name: offset
          in: query
          description: offset
          schema:
            type: integer
        - name: limit
          in: query
          description: limit
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenanceRecordPlan'
  /secure/maintenance/customer/maintenance/plan:
    get:
      tags:
        - maintenance
      description: |
        查询设备计划维修信息.
          * 权限：
          * 1.平台管理员
          * 2.公司管理员
          * 3.部门管理员
          * 4.设备管理员
          * 5.维修人员, 只能看到自己隶属的 supplier 下的, 或者没有指定 supplier 的维修
      parameters:
        - name: assetId
          in: query
          description: 设备编号
          schema:
            type: string
        - name: name
          in: query
          description: 设备名称
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenancePlan'
    post:
      tags:
        - maintenance
      description: |
        添加计划维修信息.
          * 权限：
          * 1.公司管理员
          * 2.设备管理员
          * 3.维修人员, 只能看到自己隶属的 supplier 下的, 或者没有指定 supplier 的维修

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenancePlan'

      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenancePlan'
  /secure/maintenance/customer/maintenance/plan/{id}:
    put:
      tags:
        - maintenance
      description: |
        修改设备计划维修信息.
          * 权限：
          * 1.公司管理员
          * 2.设备管理员
          * 3.维修人员, 只能看到自己隶属的 supplier 下的, 或者没有指定 supplier 的维修
      parameters:
        - name: id
          in: path
          description: 计划 id
          required: true
          schema:
            type: integer

      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenancePlan'
    delete:
      tags:
        - maintenance
      description: |
        修改设备计划维修信息.
          * 权限：
          * 1.公司管理员
          * 3.维修人员, 只能看到自己隶属的 supplier 下的, 或者没有指定 supplier 的维修
      parameters:
        - name: id
          in: path
          description: 计划 id
          required: true
          schema:
            type: integer

      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenancePlan'
  /secure/maintenance/customer/maintenance/{id}/desc:
    put:
      tags:
        - maintenance
      description: |
        修改维修信息
          * 权限：
          * 1.设备管理员
      parameters:
        - name: id
          in: path
          description: 信息 id
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenanceRecordUserModifyInfo'
        required: true
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceRecord'
        500:
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: cannot update because of db, try later

  /secure/maintenance/customer/maintenance/{id}/maintain:
    put:
      tags:
        - maintenance
      description: |
        设置维修时间和状态
         * 权限：
         * 维修人员
      parameters:
        - name: id
          in: path
          description: 信息 id
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  description: 动作, ACK, SCHEDULE, FINISH
                time:
                  type: integer
                  description: 时间, action=schedule 的时候为预约时间, action=finish 的时候为完成时间.
                serviceTime:
                  type: string
                  description: 数组字符串

      responses:
        200:
          description: succeeds

        500:
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: cannot update because of db, try later
  /secure/maintenance/customer/maintenance/{id}/close:
    put:
      tags:
        - maintenance
      description: |
        close维修
         * 权限：
         * 设备管理员
      parameters:
        - name: id
          in: path
          description: 信息 id
          required: true
          style: simple
          explode: false
          schema:
            type: integer

      responses:
        200:
          description: succeeds

  /secure/maintenance/customer/maintenance/import:
    post:
      tags:
        - maintenance
      description: 导入报修资产信息
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                companyName:
                  type: string
                  example: 强生
                  description: 公司名称，已存在公司或要创建公司名称
                domain:
                  type: string
                  example: ilab
                  description: 公司域名，非必填
                excelFile:
                  type: string
                  format: binary
                  description: 导入文件
                language:
                  type: string
                  example: zh
                  description: 使用设备中文名称或英文名称，不区分大小写，默认中文（zh）
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportMaintenanceMap'
        400:
          description: company not exist
  /secure/maintenance/customer/maintenance/{id}/upload:
    post:
      tags:
        - maintenance
      description: |
        上传维修服务单
         * 权限：
         * 设备管理员
      parameters:
        - name: id
          in: path
          description: 信息 id
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadFile'
      responses:
        200:
          description: succeeds
  /secure/maintenance/customer/maintenance/{id}:
    get:
      tags:
        - maintenance
      description: |
        维修信息详情.
          * 权限：所有能够看到列表的人
      parameters:
        - name: id
          in: path
          description: 信息 id
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceRecord'
        404:
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - maintenance
      description: |
        删除维修信息，这个接口所有的平台均可调用
          * 权限：
          * 1.平台管理员
      parameters:
        - name: id
          in: path
          description: 信息 id
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      responses:
        200:
          description: succeeds
        500:
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: cannot update because of db, try later

  '/secure/maintenance/customer/maintainance/{id}/staff/{sid}':
    put:
      tags:
        - maintenance
      description: |
        为一个维修请求指定一个维修人员
          * 权限：
          * 1.平台管理员
      parameters:
        - in: path
          name: id
          description: 维修信息 id
          required: true
          schema:
            type: integer
        - in: path
          name: sid
          description: 维修人员 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  /secure/maintenance/customer/send/email:
    put:
      tags:
        - maintenance
      description: |
        请求维修服务
          * 权限：
          * 1.设备管理员
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sendEmail'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
  '/secure/maintenance/customer/maintenance_device':
    get:
      tags:
        - maintenance
      description: |
        查询所有设备.
          * 权限：客户公司super，供应商，维修人员
      parameters:
        - name: assetId
          in: query
          description: 设备编号
          schema:
            type: string
        - name: serialNo
          in: query
          description: 设备序列号
          schema:
            type: string
        - name: clientTag
          in: query
          description: 用户资产号
          schema:
            type: string
        - name: name
          in: query
          description: 设备名称
          schema:
            type: string
        - name: brand
          in: query
          description: 设备品牌
          schema:
            type: string
        - name: category
          in: query
          description: 设备种类
          schema:
            type: string
        - name: status
          in: query
          description: 设备状态
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenanceDevice'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    post:
      tags:
        - maintenance
      description: 新增设备
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenanceDeviceCreate'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/maintenance/customer/maintenance_device/{id}':
    get:
      tags:
        - maintenance
      description: |
        根据assetId查询设备
      parameters:
        - in: path
          name: id
          description: asseId
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaintenanceDevice'
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot update because of db, try later'
    put:
      tags:
        - maintenance
      description: 更新设备信息
      parameters:
        - in: path
          name: id
          description: asset id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaintenanceDeviceCreate'
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot put because of db, try later'
    delete:
      tags:
        - maintenance
      description: |
        根据assetId删除设备
      parameters:
        - in: path
          name: id
          description: asseId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: succeeds
        '500':
          description: 服务器处理错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                code: 304
                message: 'cannot delete because of db, try later'

  /secure/maintenance/customer/maintenance/record/export:
    get:
      tags:
        - maintenance
      description: |
        导出MaintenanceRecord到excel
      parameters:
        - in: query
          name: assetId
          description: 设备id
          required: false
          schema:
            type: string
        - in: query
          name: startTime
          description: 开始时间
          required: false
          schema:
            type: number
        - in: query
          name: endTime
          description: 结束时间
          required: false
          schema:
            type: number
        - in: query
          name: type
          description: 维修类别
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeed
        '404':
          description: not found
  '/secure/maintenance/customer/manufacture_staff/{id}/bind/company':
    put:
      tags:
        - maintenance
      description: |
        为一个维修工程师绑定公司
          * 权限：
          * 1.公司管理员
      parameters:
        - name: id
          in: path
          description: 维修人员id
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                companyIds:
                  type: array
                  items:
                    type: integer
                  description: 公司id
      responses:
        200:
          description: succeeds
  '/secure/maintenance/customer/action/password/{userId}':
    put:
      tags:
        - maintenance
      description: |
        管理员修改驻场和服务团队等的操作密码
      parameters:
        - name: userId
          in: path
          description: 被修改人userId
          required: true
          style: simple
          explode: false
          schema:
            type: integer
        - name: password
          in: path
          description: 密码
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  example: 123
                  description: 要生成的密码
      responses:
        200:
          description: succeeds
    delete:
      tags:
        - maintenance
      description: |
        删除操作密码
      parameters:
        - name: userId
          in: path
          description: 被删除人userId
          required: true
          style: simple
          explode: false
          schema:
            type: integer
        - name: password
          in: path
          description: 操作密码
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        200:
          description: succeeds

  '/secure/maintenance/customer/action/password':
    get:
      tags:
        - maintenance
      description: |
        管理员查询用户操作密码
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserActionPassword'
  '/websocket/{userId}':
    get:
      tags:
        - maintenance
      description: |
        Websocket
      parameters:
        - name: userId
          in: path
          description: 被删除人userId
          required: true
          style: simple
          explode: false
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaintenancePlanList'
  '/secure/maintenance/customer/maintenance/plan/{id}/info':
    put:
      tags:
        - maintenance
      description: 更新计划服务信息
      parameters:
        - in: path
          name: id
          description: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                cost:
                  type: string
                  example: 1
                  description: 2位小数
      responses:
        '200':
          description: succeeds
  '/customer/maintenance/device/{assetId}/info':
    put:
      tags:
        - maintenance
      description: 更新计划服务信息（修改状态、位置 通用接口）
      parameters:
        - in: path
          name: assetId
          description: assetId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  example: 运行Running
                  description: 状态
                xxPosition:
                  type: integer
                  example: 123
                  description: 横坐标
                yyPosition:
                  type: integer
                  example: 321
                  description: 纵坐标
      responses:
        '200':
          description: succeeds
  '/secure/maintenance/customer/maintenance/dashboard':
    get:
      tags:
        - maintenance
      description: |
        首页综合数据接口
        * 月度计划服务状态：按时、延期
        * 月度计划服务类型数：PM、IQ/OQ/PQ、CAL、RI

        * 设备运行Running、待机Standby、维修Repair、保养Maintain、停用Disable、报废Scrap 所占数量
        * 按照房间号分类

        * 设备总数、本月计划服务总数、本月已完成计划服务总数、本月待维修设备总数、本月已维修设备总数
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  deviceSum:
                    type: integer
                    example: 10
                    description: 设备总数
                  numOfFinishPlanThisMonth:
                    type: integer
                    example: 4
                    description: 本月已完成计划服务总数
                  numOfFinishSerThisMonth:
                    type: integer
                    example: 2
                    description: 本月已维修设备总数
                  numOfPlanThisMonth:
                    type: integer
                    example: 1
                    description: 本月待计划服务总数
                  numOfSerThisMonth:
                    type: integer
                    example: 4
                    description: 本月待维修设备总数
                  typeStatics:
                    type: array
                    items:
                      $ref: '#/components/schemas/QuantityPlanInfoType'
                  statusStatics:
                    type: object
                    $ref: '#/components/schemas/QuantityPlanInfoStatus'
                  deviceStatus:
                    type: array
                    items:
                      $ref: '#/components/schemas/QuantityStatusData'
                  devicePosition:
                    type: array
                    items:
                      $ref: ''
  '/api/v2/secure/maintenance/scrapped':
    post:
      tags:
        - maintenance
      description: 添加报废信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspAssetScrapped'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspAssetScrapped'
    put:
      tags:
        - maintenance
      description: 更新报废信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspAssetScrapped'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspAssetScrapped'
    delete:
      tags:
        - maintenance
      description: 批量删除报废信息
      parameters:
        - in: path
          name: password
          description: 操作密码
          required: true
          schema:
            type: string
        - in: path
          name: ids
          description: 放在requestBody中,id数组
          required: true
          schema:
            type: string
      #      requestBody:
      #        required: true
      #        content:
      #          application/json:
      #            type: array
      #            items:
      #              type: integer
      #            description: 编号
      responses:
        '200':
          description: succeeds
    get:
      tags:
        - maintenance
      description: |
        查询报废列表
      parameters:
        - in: path
          name: assetId
          description: 资产编号
          required: true
          schema:
            type: string
        - in: path
          name: clientTag
          description: 实际报废编号
          required: true
          schema:
            type: string
        - in: path
          name: name
          description: 名称
          required: true
          schema:
            type: string
        - in: path
          name: brand
          description: 品牌
          required: true
          schema:
            type: string
        - in: path
          name: model
          description: 模块
          required: true
          schema:
            type: string
        - in: path
          name: serialNo
          description: 单号
          required: true
          schema:
            type: string
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspAssetScrapped'

  '/api/v2/secure/maintenance/customer':
    post:
      tags:
        - maintenance
      description: 添加客户信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspCustomerInfo'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspCustomerInfo'
    put:
      tags:
        - maintenance
      description: 更新客户信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspCustomerInfo'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspCustomerInfo'
    delete:
      tags:
        - maintenance
      description: 批量删除客户信息
      parameters:
        - in: path
          name: password
          description: 操作密码
          required: true
          schema:
            type: string
        - in: path
          name: ids
          description: 放在requestBody中,id数组
          required: true
          schema:
            type: string
      #      requestBody:
      #        required: true
      #        content:
      #          application/json:
      #            type: array
      #            items:
      #              type: integer
      #            description: 编号
      responses:
        '200':
          description: succeeds
    get:
      tags:
        - maintenance
      description: |
        查询客户列表
      parameters:
        - in: path
          name: offset
          description: offset
          required: true
          schema:
            type: integer
        - in: path
          name: limit
          description: limit
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspCustomerInfo'

  '/api/v2/secure/maintenance/cycle':
    post:
      tags:
        - maintenance
      description: 添加周期服务信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspCycle'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspCycle'
    put:
      tags:
        - maintenance
      description: 更新周期服务信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspCycle'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspCycle'
    delete:
      tags:
        - maintenance
      description: 批量删除周期服务信息
      parameters:
        - in: path
          name: password
          description: 操作密码
          required: true
          schema:
            type: string
        - in: path
          name: ids
          description: 放在requestBody中,id数组
          required: true
          schema:
            type: string
      #      requestBody:
      #        required: true
      #        content:
      #          application/json:
      #            type: array
      #            items:
      #              type: integer
      #            description: 编号
      responses:
        '200':
          description: succeeds
    get:
      tags:
        - maintenance
      description: |
        查询周期列表
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspCycle'

  '/api/v2/secure/maintenance/provider':
    post:
      tags:
        - maintenance
      description: 添加服务商信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspServiceProviderExtend'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspServiceProviderExtend'
    put:
      tags:
        - maintenance
      description: 更新服务商信息
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspServiceProviderExtend'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspServiceProviderExtend'
    delete:
      tags:
        - maintenance
      description: 批量删除服务商信息
      parameters:
        - in: path
          name: password
          description: 操作密码
          required: true
          schema:
            type: string
        - in: path
          name: ids
          description: 放在requestBody中,id数组
          required: true
          schema:
            type: string
      #      requestBody:
      #        required: true
      #        content:
      #          application/json:
      #            type: array
      #            items:
      #              type: integer
      #            description: 编号
      responses:
        '200':
          description: succeeds
    get:
      tags:
        - maintenance
      description: |
        查询服务商列表
      parameters:
        - in: path
          name: offset
          description: offset
          required: true
          schema:
            type: integer
        - in: path
          name: limit
          description: limit
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspServiceProviderExtend'
  '/api/v2/secure/maintenance/provider/grade':
    get:
      tags:
        - maintenance
      description: |
        * 获取服务商列表（人员列表）
        * (category required true)
        * 只传"category"，表示查找这个类型下的所有服务商公司
        * 同时传"category"和"company"表示查找这个服务商公司下的服务人员
      parameters:
        - in: path
          name: category
          description: 服务商类型
          required: true
          schema:
            type: string
        - in: path
          name: company
          description: 服务商名称
          required: true
          schema:
            type: string
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspServiceProviderExtend'
  '/api/v2/secure/maintenance/provider/user':
    delete:
      tags:
        - maintenance
      description: 批量删除服务人员信息
      parameters:
        - in: path
          name: password
          description: 操作密码
          required: true
          schema:
            type: string
        - in: path
          name: ids
          description: 放在requestBody中,id数组
          required: true
          schema:
            type: string
      #      requestBody:
      #        required: true
      #        content:
      #          application/json:
      #            type: array
      #            items:
      #              type: integer
      #            description: 编号
      responses:
        '200':
          description: succeeds

  '/api/v2/secure/maintenance/cycle/submit':
    post:
      tags:
        - maintenance
      description: |
        勾选保存周期服务内容
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspCycleHistoryVo'
      responses:
        '200':
          description: succeeds
  '/api/v2/secure/maintenance/cycle/history/{id}':
    get:
      tags:
        - maintenance
      description: |
        历史文档 - 详情
      parameters:
        - in: path
          name: id
          description: id
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmspCycleHistoryVo'
  '/api/v2/secure/maintenance/cycle/history':
    get:
      tags:
        - maintenance
      description: |
        历史文档 - 列表
      parameters:
        - in: path
          name: startTime
          description: 时间戳
          required: true
          schema:
            type: integer
        - in: path
          name: endTime
          description: 时间戳
          required: true
          schema:
            type: integer
        - in: path
          name: domainName
          description: domainName
          required: true
          schema:
            type: string
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspCycleHistoryVo'
  '/api/v2/secure/maintenance/cycle/generate/{id}':
    get:
      tags:
        - maintenance
      description: |
        历史文档 - 生成PDF
      parameters:
        - in: path
          name: id
          description: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
  '/api/v2/secure/maintenance/download':
    get:
      tags:
        - maintenance
      description: |
        数据下载 - 获取所有字段
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AmspCycleHistoryVo'
    post:
      tags:
        - maintenance
      description: |
        数据下载文件
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmspDataDownloadVo'
      responses:
        '200':
          description: succeeds
  /secure/customer/monitor_target_lab_device/audit/lease/{id}:
    post:
      tags:
        - yskj
      description: 审核预约
      parameters:
        - in: path
          name: id
          description: leaseId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auditStatus:
                  type: integer
                  example: 1
                  description: 1审核通过 2审核不通过, 3：包括审核通过和不通过
                auditRemark:
                  type: string
                  example: ddd
                  description: 评论
      responses:
        '200':
          description: succeeds
  /secure/customer/monitor_target_lab_device/lease:
    get:
      tags:
        - yskj
      description: '修改个人信息, 参数都是 optional'
      parameters:
        - in: path
          name: userId
          description: userId
          required: true
          schema:
            type: integer
        - in: path
          name: admin
          description: admin
          required: true
          schema:
            type: integer
        - in: path
          name: status
          description: 1审核通过 2审核不通过, 3：包括审核通过和不通过
          required: true
          schema:
            type: integer
        - in: path
          name: limit
          description: 每页数量
          required: true
          schema:
            type: integer
        - in: path
          name: offset
          description: 页数
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditOrder'
  /secure/customer/monitor_target_lab_device/order/{id}:
    put:
      tags:
        - yskj
      description: 审核预约
      parameters:
        - in: path
          name: id
          description: leaseId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: integer
                  example: 1
                  description: 1审核通过 2审核不通过, 3：包括审核通过和不通过
      responses:
        '200':
          description: succeeds
  /secure/customer/audit/result:
    get:
      tags:
        - yskj
      description: 查询凭证结果
      parameters:
        - in: path
          name: bizInsId
          description: 预约id
          required: true
          schema:
            type: integer
        - in: path
          name: userId
          description: 用户id
          required: true
          schema:
            type: integer

      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CertificateInfo'
  /secure/customer/audit/info:
    get:
      tags:
        - yskj
      description: 查询预约信息
      parameters:
        - in: path
          name: bizInsId
          description: 预约id
          required: true
          schema:
            type: integer
        - in: path
          name: userId
          description: 用户id
          required: true
          schema:
            type: integer

      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditInfo'
  /secure/customer/audit/action:
    post:
      tags:
        - yskj
      description: 审核预约
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bizInsId:
                  type: integer
                  example: 1
                  description: 预约id

                userId:
                  type: integer
                  example: 1
                  description: 用户id

                auditStatus:
                  type: integer
                  example: 1
                  description: 审核状态

      responses:
        '200':
          description: succeeds

  /secure/customer/janssen/monitoring/excel/import:
    post:
      tags:
        - Janssen
      description: |
        * 权限：
        * 1.janssen超级管理员
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 文件后缀必须为xls或xlsx，后缀被篡改不允许上传
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  createCount:
                    type: integer
                    description: 通过导入 excel 设备信息
                  updateCount:
                    type: integer
                    description: 通过导入 excel 更新的设备详情
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/janssen/monitor_target_lab_device:
    get:
      tags:
        - Janssen
      description: |
        设备信息详情.
          * 权限：janssen管理员
      parameters:
        - in: path
          name: companyId
          required: true
          schema:
            type: integer
          description: janssen company id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorTargetLabDeviceJanssen'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/mobile/dashboard:
    get:
      tags:
        - mobile
      description: |
        获取首页信息.
         * 权限：所有公司用户
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileDashboard'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/category/{categoryName}:
    get:
      tags:
        - iCabinet
      description: |
        查询智能柜信息.
      parameters:
        - in: path
          name: categoryName
          description: '种类区分;ITEM_CHEMICAL_CATEGORY；'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 指定编号的种类列表
                items:
                  $ref: '#/components/schemas/CommonLookup'
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/cabinets:
    get:
      tags:
        - iCabinet
      description: |
        查询智能柜信息.
      parameters:
        - in: query
          name: name
          description: '名称'
          required: false
          schema:
            type: string
        - in: query
          name: categoryId
          description: '种类的id'
          required: false
          schema:
            type: integer
        - in: query
          name: serial_number
          description: '序列号'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 智能柜列表
                items:
                  $ref: '#/components/schemas/Cabinet'
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/cabinet:
    post:
      tags:
        - iCabinet
      description: |
        添加智能柜信息.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CabinetVo'
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/cabinet/{id}:
    put:
      tags:
        - iCabinet
      description: |
        修改智能柜信息.
      parameters:
        - in: path
          name: id
          description: 智能柜ID
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CabinetVo'
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    delete:
      tags:
        - iCabinet
      description: |
        删除智能柜信息.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 智能柜的id
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    get:
      tags:
        - iCabinet
      description: |
        获取智能柜详情.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 智能柜的id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                description: 智能柜详情
                items:
                  $ref: '#/components/schemas/CabinetVo'
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/itemtypes:
    get:
      tags:
        - iCabinet
      description: |
        查询样范类信息.
      parameters:
        - in: query
          name: nameZh
          description: '范类中文名称'
          required: false
          schema:
            type: string
        - in: query
          name: nameCn
          description: '范类英文名称'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 指定的化学品列表
                items:
                  $ref: '#/components/schemas/ItemTypeVo'
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/itemtype:
    post:
      tags:
        - iCabinet
      description: |
        添加化学品范类信息.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemType'
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/itemtype/{id}:
    delete:
      tags:
        - iCabinet
      description: |
        删除指定化学品范类信息.
      parameters:
        - in: path
          name: id
          description: 公司 id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    put:
      tags:
        - iCabinet
      description: |
        修改指定化学品信息.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 化学品的id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Item'
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/itemtype/items:
    get:
      tags:
        - iCabinet
      description: |
        查询化学品信息.
      parameters:
        - in: query
          name: lotNo
          description: '化学品的批次号;'
          required: false
          schema:
            type: string
        - in: query
          name: itemTypeId
          description: '化学品type的id;'
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 指定的化学品列表
                items:
                  $ref: '#/components/schemas/ItemTypeVo'
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/inventory/itemtype/{id}/item:
    post:
      tags:
        - iCabinet
      description: |
        添加指定化学品范类的化学品
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 化学品范类的id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Item'
      responses:
        '200':
          description: succeeds
        '404':
          description: 'not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/event/type:
    get:
      tags:
        - event_type
      description: |
        查询事件类型.
          * 权限：
          * 1. 公司管理员, 返回基本 type 和属于这个公司的 type
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventType'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    post:
      tags:
        - event_type
      description: |
        添加事件类型.
         * 权限：
         * 1.平台管理员
         * 2.公司管理员
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTypePost'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/event/type/{id}:
    delete:
      tags:
        - event_type
      description: |
        删除事件类型. 如果这个 type 下已经有 event 或者关联的 task, 不能被删除
         * 权限：
         * 1.公司管理员
         * 2.公司管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件类型id
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    put:
      tags:
        - event_type
      description: |
        修改事件类型.
         * 权限：
         * 1.平台管理员
         * 2.公司管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件类型id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTypePost'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'

  /secure/customer/task:
    get:
      tags:
        - Task
      description: |
        查询任务列表.
          * 权限：
          * 1.公司管理员
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Task'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    post:
      tags:
        - Task
      description: |
        添加事件类型.
         * 权限：
         * 1.平台管理员
         * 2.公司管理员
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskPost'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/task/{id}:
    get:
      tags:
        - Task
      description: |
        获取指定任务.
          * 权限：
          * 1.公司管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件类型id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'

    delete:
      tags:
        - Task
      description: |
        删除指定任务.
         * 权限：
         * 1.公司管理员

      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件类型id
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
    put:
      tags:
        - Task
      description: |
        修改指定任务.
         * 权限：
         * 1.公司管理员
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 事件类型id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Task'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'

  /secure/customer/event/{id}/exam/result:
    put:
      tags:
        - event
      description: |
        上传检测凭证.
         * 权限：
         * 1 公司管理员
         * 2 部门管理员
         * 3 设备管理员
         * 4 设备使用者
      parameters:
        - in: path
          name: id
          description: 检测对应的事件 id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                type:
                  type: string
                  example: chemistry, physics
                  description: 检测种类

                description:
                  type: string
                  example: 这是一个描述
                  description: 描述

                image:
                  type: string
                  format: binary
                  description: 图片
            encoding:
              profileImage:
                contentType: 'image/png, image/jpeg'
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/weijian/department/{id}/stats':
    get:
      tags:
        - Weijian
      description: >
        通过 id 查询部门的统计信息.
        权限：
          * 1.公司管理员

      parameters:
        - in: path
          name: id
          description: 部门 id
          required: true
          schema:
            type: integer
        - in: query
          name: statsDuration
          description: 统计时间范围, 取值为整数, 单位为天, 0 特殊处理, 代表所有历史.
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  event:
                    type: array
                    items:
                      $ref: '#/components/schemas/EventStats'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/weijian/stats':
    get:
      tags:
        - Weijian
      description: >
        查询全公司事件统计信息
        权限：
          * 1.公司管理员

      parameters:

        - in: query
          name: statsDuration
          description: 统计时间范围, 取值为整数, 单位为天, 0 特殊处理, 代表所有历史.
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  event:
                    type: array
                    items:
                      $ref: '#/components/schemas/EventStats'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/weijian/camera/{sn}/alarm/pic':
    get:
      tags:
        - Weijian
      description: >
        获取指定摄像头移动侦测照片集
        权限：
          * 1.公司管理员
      parameters:
        - in: path
          name: sn
          description: 摄像头序列号
          required: true
          schema:
            type: string
        - in: query
          name: startTime
          description: 查询起始时间, 默认为 30 天前 0 点
          schema:
            type: integer
        - in: query
          name: endTime
          description:  查询结束时间, 默认为今天 0 点
          schema:
            type: integer
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CameraPicture'
  '/secure/admin/private/video/upload/camera/{sn}/start/{time}/length/{length}':
    post:
      tags:
        - Weijian
      description: >
        上传移动侦测视频
        权限：
          * 1.平台管理员
      parameters:
        - in: path
          name: sn
          description: 摄像头序列号
          required: true
          schema:
            type: string
        - in: path
          name: time
          description:  视频起始时间
          required: true
          schema:
            type:  integer
        - in: path
          name: length
          description: 视频长度(秒)
          required: true
          schema:
            type:  integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: 上传完成视频地址

  /secure/customer/department/{id}/unfollow:
    delete:
      tags:
        - department
      description: |
        删除部门关注状态.
         * 权限：
         * 1.公司管理员

      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: id
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  /secure/customer/department/{id}/follow:
    post:
      tags:
        - department
      description: |
        设置部门关注状态.
         * 权限：
         * 1.公司管理员

      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 部门id
      responses:
        '200':
          description: succeeds
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
  '/secure/customer/department/{id}/file':
    post:
      tags:
        - department
      description: 添加部门文件.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 部门id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadFile'
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
    get:
      tags:
        - department
      description: |
        获取部门文件列表
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 部门 id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/File'
  '/secure/customer/department/{id}/download/file/{fileId}':
    get:
      tags:
        - department
      description: |
        下载部门文件
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: 部门 id
        - in: path
          name: fileId
          required: true
          schema:
            type: integer
          description: 文件id
      responses:
        '200':
          description: succeeds
          content:
            application/json:
              schema:
                type: string
                description: 文件内容
                format: binary
  /secure/customer/bind/wechat:
    post:
      tags:
        - user
      description: 绑定微信账号
      requestBody:
        description: 微信信息
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WechatAccount'
      responses:
        200:
          description: succeed
  /secure/customer/monitoring_target_lab_device/{id}/full/data:
    get:
      tags:
        - Show
      description: 获取设备综合数据, 包括设备信息, 10 分钟监控, 当日预约, 当周利用率
      parameters:
        - in: path
          name: id
          description: 设备 id
          required: true
          schema:
            type: string
        - in: query
          name: duration
          description: 查询实时监控数据的范围, 秒为单位, 如果不传, 默认为 600. 最大为 3600
          schema:
            type: integer
        - in: query
          name: hasProfile
          description: 是否查询设备基本信息,  如果不传, 默认值为1
          required: false
          example: 1 | 0
          schema:
            type: integer
        - in: query
          name: utilStart
          description: 利用率开始时间戳, 如果不传, 不返回利用率, 间隔不超过 1 周
          required: false
          example:  1548900000
          schema:
            type: integer
        - in: query
          name: utilEnd
          description: 利用率结束时间戳, 如果不传, 不返回利用率
          required: false
          example:  1548900000
          schema:
            type: integer
        - in: query
          name: leaseStart
          description: 查询预约起始时间戳, 如果不传, 不返回预约, 间隔不超过 1 周
          required: false
          example: 1568800000
          schema:
            type: integer
        - in: query
          name: leaseEnd
          description: 查询预约结束时间戳, 如果不传, 不返回预约
          required: false
          example: 1568800000
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                $ref: 'components/schemas/DeviceFullData'
  /secure/customer/maintenance_type:
    get:
      tags:
        - janssen-2ed
      description: 查询设备服务类型
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 设备服务类型
                items:
                  $ref: '#/components/schemas/MaintenanceType'
  /secure/customer/monitor_target_lab_device/service:
    get:
      tags:
        - janssen-2ed
      description: 查询设备服务请求
      parameters:
        - in: query
          name: serviceType
          description: 服务类型
          required: false
          example: 设备维修
          schema:
            type: string
        - in: query
          name: serviceStatus
          description: 服务状态，0：已提交待确认，1：已确认，2：已完成
          required: false
          example: 1
          schema:
            type: integer
        - in: query
          name: ownerId
          description: 申请人ID
          required: false
          example:  1
          schema:
            type: integer
        - in: query
          name: assetId
          description: 设备编号
          required: false
          example: CNJJ839274
          schema:
            type: string
        - in: query
          name: startTime
          description: 开始时间
          required: false
          example: 1568800000
          schema:
            type: integer
        - in: query
          name: endTime
          description: 结束时间
          required: false
          example: 1568800000
          schema:
            type: integer
        - in: query
          name: page
          description: 当前页码，第一页即为1
          required: true
          example: 1
          schema:
            type: integer
        - in: query
          name: size
          description: 分页大小，每页数量，默认为10
          required: true
          example: 10
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 设备服务请求列表
                items:
                  $ref: '#/components/schemas/DeviceServiceRequire'
    post:
      tags:
        - janssen-2ed
      description: 给指定设备添加服务请求
      requestBody:
        description: 设备服务请求
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceServiceRequire'
      responses:
        200:
          description: succeed
    put:
      tags:
        - janssen-2ed
      description: 给指定设备添加服务请求
      requestBody:
        description: 设备服务请求
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceServiceRequire'
      responses:
        200:
          description: succeed
  /secure/customer/assets/folder:
    get:
      tags:
        - janssen-2ed
      description: 资产文件查询
      parameters:
        - in: query
          name: folderName
          description: 文件夹编号/名称
          required: false
          example: A-01
          schema:
            type: string
        - in: query
          name: content
          description: 文件内容
          required: false
          example: Thermo冰箱说明书
          schema:
            type: string
        - in: query
          name: offset
          description: 当前页码，第一页即为0
          required: false
          example: 0
          schema:
            type: integer
        - in: query
          name: limit
          description: 分页大小，每页数量，默认为5
          required: true
          example: 5
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 资产文件列表
                items:
                  $ref: '#/components/schemas/AssetsFolder'
  /secure/customer/assets/folder/import:
    post:
      tags:
        - janssen-2ed
      description: 导入资产文件信息
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                excelFile:
                  type: string
                  format: binary
                  description: 导入文件
      responses:
        200:
          description: succeeds
  /secure/customer/assets/folder/export:
    get:
      tags:
        - janssen-2ed
      description: 导出资产文件信息
      parameters:
        - in: query
          name: folderName
          description: 资产文件编号/名称
          required: false
          schema:
            type: string
        - in: query
          name: content
          description: 资产文件内容
          required: false
          schema:
            type: string
      responses:
        200:
          description: succeeds
  /secure/customer/assets/folder/content:
    post:
      tags:
        - janssen-2ed
      description: 资产文件新增
      requestBody:
        description: 资产文件新增
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetsFolder'
      responses:
        200:
          description: succeed
  /secure/customer/assets/folder/content/{id}:
    put:
      tags:
        - janssen-2ed
      description: 资产文件内容修改
      parameters:
        - in: path
          name: id
          description: 资产文件内容ID
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetsFolder'
      responses:
        200:
          description: succeed
    delete:
      tags:
        - janssen-2ed
      description: 资产文件内容删除
      parameters:
        - in: path
          name: id
          description: 资产文件内容ID
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeed
  /secure/customer/sample_set:
    post:
      tags:
        - janssen-2ed
      description: |
        添加样品.输入的 object 里需要有 rfid 不允许添加一个独立的无关联  的样品
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleSetVo'
      responses:
        200:
          description: succeed
    put:
      tags:
        - janssen-2ed
      description: |
        添加样品.输入的 object 里需要有 rfid 不允许添加一个独立的无关联  的样品
        * 权限：
        * 1.公司管理员
        * 2.部门管理员（子部门permission_cascade为ALL或者DIRECT）
        * 3.设备管理员（看到绑定设备  ownerid为userid）
        * 4.设备使用者
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SampleSetVo'
      responses:
        200:
          description: succeed
  /secure/customer/monitor_target_lab_device/monthly/report:
    get:
      tags:
        - janssen-2ed
      description: 月报信息统计
      parameters:
        - in: query
          name: startTime
          description: 开始时间
          required: false
          example: 1568800000
          schema:
            type: integer
        - in: query
          name: endTime
          description: 结束时间
          required: false
          example: 1568800000
          schema:
            type: integer
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                type: array
                description: 设备服务请求列表
                items:
                  $ref: '#/components/schemas/deviceMonthlyReport'
  /secure/customer/power/loop:
    get:
      tags:
        - janssen-2ed
      description: 回路列表
      parameters:
        - in: query
          name: roomId
          description: 房间id
          required: false
          example: 5
          schema:
            type: integer
        - in: query
          name: loopNo
          description: 回路编号
          required: false
          example: 521-2
          schema:
            type: string
        - in: query
          name: offset
          description: 当前页码，第一页即为0
          required: false
          example: 0
          schema:
            type: integer
        - in: query
          name: limit
          description: 分页大小，每页数量，默认为5
          required: true
          example: 5
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 回路列表
                items:
                  $ref: '#/components/schemas/LoopPower'
    post:
      tags:
        - janssen-2ed
      description: 添加回路
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoopPower'
      responses:
        200:
          description: succeed
  /secure/customer/loop/{loopId}:
    put:
      tags:
        - janssen-2ed
      description: 回路修改
      parameters:
        - in: path
          name: loopId
          description: 回路ID
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoopPower'
      responses:
        200:
          description: succeed
  /secure/customer/power/loop/{loopId}:
    delete:
      tags:
        - janssen-2ed
      description: 回路删除
      parameters:
        - in: path
          name: loopId
          description: 资回路ID
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeed
  /secure/customer/power/loop/device:
    get:
      tags:
        - janssen-2ed
      description: 回路设备列表
      parameters:
        - in: query
          name: deviceNo
          description: 设备编号
          required: false
          example: CNJJ0038
          schema:
            type: string
        - in: query
          name: deviceName
          description: 设备名称
          required: false
          example: xxxxx
          schema:
            type: string
        - in: query
          name: offset
          description: 当前页码，第一页即为0
          required: false
          example: 0
          schema:
            type: integer
        - in: query
          name: limit
          description: 分页大小，每页数量，默认为5
          required: true
          example: 5
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 回路列表
                items:
                  $ref: '#/components/schemas/LoopPowerDevice'
    post:
      tags:
        - janssen-2ed
      description: 添加回路设备
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoopPowerDeviceMap'
      responses:
        200:
          description: succeed
  /secure/customer/power/loop/{loopId}/device/{deviceId}:
    put:
      tags:
        - janssen-2ed
      description: 修改回路设备
      parameters:
        - in: path
          name: loopId
          description: 回路ID
          required: true
          schema:
            type: integer
        - in: path
          name: deviceId
          description: 设备ID
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeed
    delete:
      tags:
        - janssen-2ed
      description: 删除回路设备
      parameters:
        - in: path
          name: loopId
          description: 回路ID
          required: true
          schema:
            type: integer
        - in: path
          name: deviceId
          description: 设备ID
          required: true
          schema:
            type: integer
      responses:
        200:
          description: succeed
  /secure/customer/power/loop/download:
    get:
      tags:
        - janssen-2ed
      description: 数据下载
      parameters:
        - in: query
          name: loopIdList
          description: 回路ID集合
          required: true
          schema:
            type: string
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 回路列表
                items:
                  $ref: '#/components/schemas/LoopPowerDeviceMap'
  /secure/customer/power/loop/jump/device:
    get:
      tags:
        - janssen-2ed
      description: 回路列表跳转到具体回路的设备列表
      parameters:
        - in: query
          name: deviceNo
          description: 设备编号
          required: false
          example: CNJJ0038
          schema:
            type: string
        - in: query
          name: deviceName
          description: 设备名称
          required: false
          example: xxxxx
          schema:
            type: string
        - in: query
          name: deviceType
          description: 设备类型
          required: false
          example: 冰箱
          schema:
            type: string
        - in: query
          name: loopId
          description: 回路ID
          required: true
          example: 1
          schema:
            type: integer
        - in: query
          name: offset
          description: 当前页码，第一页即为0
          required: false
          example: 0
          schema:
            type: integer
        - in: query
          name: limit
          description: 分页大小，每页数量，默认为5
          required: true
          example: 5
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: 回路列表
                items:
                  $ref: '#/components/schemas/LoopPowerDevice'
  /secure/customer/pou/stock/import:
    post:
      tags:
        - janssen-2ed
      description: 导入pou库存信息
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                excelFile:
                  type: string
                  format: binary
                  description: 导入文件
      responses:
        200:
          description: succeeds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
  /secure/customer/pou/stock/export:
    get:
      tags:
        - janssen-2ed
      description: 导出pou库存信息
      parameters:
        - in: query
          name: goodsNum
          description: 标准货号
          required: false
          schema:
            type: string
        - in: query
          name: productName
          description: 产品名称
          required: false
          schema:
            type: string
        - in: query
          name: type
          description: 分类
          required: false
          schema:
            type: string
      responses:
        200:
          description: succeeds
  /secure/customer/pou/stock:
    get:
      tags:
        - janssen-2ed
      description: pou查询
      parameters:
        - in: query
          name: goodsNum
          description: 标准货号
          required: false
          schema:
            type: string
        - in: query
          name: productName
          description: 产品名称
          required: false
          schema:
            type: string
        - in: query
          name: storehouse
          description: 库位
          required: false
          schema:
            type: string
        - in: query
          name: offset
          description: 起始页
          required: false
          example: 1
          schema:
            type: integer
        - in: query
          name: limit
          description: 分页大小，每页数量，默认为10
          required: true
          example: 10
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: pou列表
                items:
                  $ref: '#/components/schemas/PouStock'
  /secure/customer/pou/stock/service:
    get:
      tags:
        - janssen-2ed
      description: pou服务列表
      parameters:
        - in: query
          name: status
          description: pou服务状态
          required: false
          schema:
            type: string
        - in: query
          name: applyName
          description: 服务申请人
          required: false
          schema:
            type: string
        - in: query
          name: offset
          description: 起始页
          required: false
          example: 1
          schema:
            type: integer
        - in: query
          name: limit
          description: 分页大小，每页数量，默认为10
          required: true
          example: 10
          schema:
            type: integer
      responses:
        200:
          description: succeed
          content:
            application/json:
              schema:
                type: array
                description: pou列表
                items:
                  $ref: '#/components/schemas/PouService'
    post:
      tags:
        - janssen-2ed
      description: 添加pou服务
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PouService'
      responses:
        200:
          description: succeed
  /secure/customer/pou/stock/service/{id}:
    put:
      tags:
        - janssen-2ed
      description: 修改pou服务
      parameters:
        - in: path
          name: id
          description: pou服务id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PouService'
      responses:
        200:
          description: succeed

  /video/account:
    get:
      tags:
        - video-account-controller
      summary: get account list
      description: get account list, get all if companyId is omitted
      operationId: getAccountUsingGET
      parameters:
        - name: companyId
          in: query
          description: companyId
          required: false
          schema:
            type: integer
            format: int32
        - name: offset
          in: query
          description: offset
          required: false
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: limit
          required: false
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonPageResult_List_account_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
    post:
      tags:
        - video-account-controller
      summary: create account
      operationId: addAccountUsingPOST
      requestBody:
        $ref: "#/components/requestBodies/account"
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_account_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
    put:
      tags:
        - video-account-controller
      summary: update account
      operationId: updateAccountUsingPUT
      requestBody:
        $ref: "#/components/requestBodies/account"
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_account_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/account/by/company/{cid}/name/{name}":
    get:
      tags:
        - video-account-controller
      summary: get account by name
      operationId: getAccountByAccountNameUsingGET
      parameters:
        - name: cid
          in: path
          description: cid
          required: true
          schema:
            type: integer
            format: int32
        - name: name
          in: path
          description: name
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_account_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/account/transfer/from/{fid}/to/{tid}":
    post:
      tags:
        - video-account-controller
      summary: transfer cameras
      operationId: transferAccountUsingPOST
      parameters:
        - name: fid
          in: path
          description: fid
          required: true
          schema:
            type: integer
            format: int32
        - name: tid
          in: path
          description: tid
          required: true
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_List_string_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/account/{id}":
    delete:
      tags:
        - video-account-controller
      summary: delete account
      operationId: deleteAccountUsingDELETE
      parameters:
        - name: id
          in: path
          description: id
          required: true
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "204":
          description: No Content
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
  /video/camera:
    get:
      tags:
        - video-controller
      summary: query camera
      description: query camera use varies of conditions
      operationId: getCameraListUsingGET
      parameters:
        - name: companyId
          in: query
          description: companyId
          required: false
          schema:
            type: integer
            format: int32
        - name: locationId
          in: query
          description: locationId
          required: false
          schema:
            type: integer
            format: int32
        - name: accountId
          in: query
          description: accountId
          required: false
          schema:
            type: integer
            format: int32
        - name: sn
          in: query
          description: sn
          required: false
          schema:
            type: string
        - name: offset
          in: query
          description: offset
          required: false
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: limit
          required: false
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonPageResult_List_CameraSimpleVO_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
    post:
      tags:
        - video-controller
      summary: create camera
      operationId: addCameraUsingPOST
      requestBody:
        $ref: "#/components/requestBodies/camera"
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_camera_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
    put:
      tags:
        - video-controller
      summary: update camera
      operationId: updataCameraUsingPUT
      requestBody:
        $ref: "#/components/requestBodies/camera"
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_camera_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}":
    get:
      tags:
        - video-controller
      summary: get camera by SN
      operationId: getCameraUsingGET
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_camera_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
    delete:
      tags:
        - video-controller
      summary: delete camera by SN
      operationId: deleteCameraUsingDELETE
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "204":
          description: No Content
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
  "/video/camera/{sn}/motion/detection":
    get:
      tags:
        - video-controller
      summary: get camera motion detection videos
      operationId: getMotionDetectionHistoryUsingGET
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
        - name: startTime
          in: query
          description: startTime
          required: true
          schema:
            type: integer
            format: int64
        - name: endTime
          in: query
          description: endTime
          required: true
          schema:
            type: integer
            format: int64
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_List_VideoRecord_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/network/config":
    post:
      tags:
        - video-controller
      summary: set video cluster configuration of this camera
      operationId: networkConfigUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      requestBody:
        $ref: "#/components/requestBodies/CameraConfigVO"
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
    put:
      tags:
        - video-controller
      summary: set video cluster configuration of this camera
      operationId: modifyNetworkConfigUsingPUT
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      requestBody:
        $ref: "#/components/requestBodies/CameraConfigVO"
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/recording":
    get:
      tags:
        - video-controller
      summary: get camera recording list
      operationId: getRecordingHistoryUsingGET
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
        - name: startTime
          in: query
          description: startTime
          required: true
          schema:
            type: integer
            format: int64
        - name: endTime
          in: query
          description: endTime
          required: true
          schema:
            type: integer
            format: int64
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_List_VideoRecord_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/start/broadcast":
    post:
      tags:
        - video-controller
      summary: start broadcast
      operationId: startBroadcastUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_string_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/start/fulltime/recording":
    post:
      tags:
        - video-controller
      summary: start full-time recording
      operationId: startFullTimeRecordingUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/start/motion/detection":
    post:
      tags:
        - video-controller
      summary: start motion detection
      operationId: startMotionDetectionUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/start/recording":
    post:
      tags:
        - video-controller
      summary: start recording
      operationId: startRealTimeRecordingUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/stop/broadcast":
    post:
      tags:
        - video-controller
      summary: stop broadcast
      operationId: stopBroadcastUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/stop/fulltime/recording":
    post:
      tags:
        - video-controller
      summary: stop full-time recording
      operationId: stopFullTimeRecordingUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/stop/motion/detection":
    post:
      tags:
        - video-controller
      summary: stop motion detection
      operationId: stopMotionDetectionUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
  "/video/camera/{sn}/stop/recording":
    post:
      tags:
        - video-controller
      summary: stop recording
      operationId: stopRealTimeRecordingUsingPOST
      parameters:
        - name: sn
          in: path
          description: sn
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_boolean_"
        "201":
          description: Created
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found

  /video/stats/counts:
    get:
      tags:
        - video-stats-controller
      summary: get counts
      description: get camera and account counts. counts all if companyId is omitted
      operationId: getAccountCameraCountsUsingGET
      parameters:
        - name: companyId
          in: query
          description: companyId
          required: false
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/CommonResult_AccountCameraCounts_"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found



components:
  schemas:
    Interval:
      properties:
        startTime:
          type: integer
          description: start timestamp
        endTime:
          type: integer
          description: end timestamp
    DoorOpenHistory:
      properties:
        sensorName:
          type: string
          example: Door
        sensorId:
          type: integer
          example: 1
        intervals:
          type: array
          items:
            $ref: '#/components/schemas/Interval'

    AlertDailyStats:
      properties:
        meastureTypeId:
          type: integer
          example: 1
          description: 监控参数id
        monitoringTargetTypeId:
          type: integer
          example: 1
          description: 监控模板id
        monitoringTargetId:
          type: integer
          example: 1
          description: 监控对象id
        measurement:
          type: string
          description: 对参数的一个 unique 的描述
          example: TEMPORATURE
        measureTypeName:
          type: string
          example: temporature
          description: 监控种类名称如温度，湿度等
        monitoringTargetTypeName:
          type: string
          example: super fridge
          description: 设备类型名称
        monitoringTargetModel:
          type: string
          example: thermal-fr-01
          description: 监控对象
        yellowAlertCount:
          description: '日均报警数. 格式为二维数组, 第二维的每一个数组都是长度为2. 格式为[time, alertCount]'
          type: array
          items:
            type: array
            items:
              type: array
              example:
                - 15722200000
                - 12
              description: 数据列表
              items:
                type: integer
        redAlertCount:
          description: '格式为二维数组, 第二维的每一个数组都是长度为2. 格式为[time, alertCount]'
          type: array
          items:
            type: array
            items:
              type: array
              example:
                - 15722200000
                - 12
              description: 数据列表
              items:
                type: integer
    DailyUtilization:
      properties:
        totalRunningHours:
          type: number
          example: 9
          description: 运行时间
        totalIdleHours:
          type: number
          example: 5
          description: id
        powerLowerBound:
          type: number
          example: 1
          description: 最低使用
        powerUpperBound:
          type: number
          example: 550.5
          description: 最高使用
        totalConsumedEnergy:
          type: number
          example: 3333
          description: 总能耗
        mostOftenUsedHour:
          type: integer
          description: '功耗最高的小时, 整点时间戳'
          example: 1531992430000
        leastOftenUsedHour:
          type: integer
          description: '功耗最低的小时, 整点时间戳'
          example: 1531992430000
        offTimeHours:
          type: number
          description: 下班时间内运行小时数
          example: 2.2
    HourlyUtilization:
      properties:
        hourlyTime:
          type: integer
          description: 整小时时间戳
          example: 1531992400000
        runningPercentile:
          type: number
          example: 87.5
          description: 百分比
        idlePercentile:
          type: number
          example: 10.5
          description: id
    CommonLookup:
      properties:
        id:
          type: integer
          description: 整小时时间戳
          example: 1
        categoryName:
          type: string
          example: ITEM_CHEMICAL_CATEGORY
          description: 名称
        categoryDesc:
          type: string
          example: 化学品类别/柜子类别
          description: 这是一个描述
        code:
          type: string
          example: BASE
          description: 编码
        value:
          type: string
          example: Base
          description: 值
        sort_order:
          type: integer
          example: 2
          description: 排序
        create_datetime:
          type: string
          example: 2019-08-10
          description: 创建时间
        company_id:
          type: integer
          example: 2
          description: 公司id
    TelemetryTSData:
      properties:
        name:
          type: string
          description: 监控参数名字
          example: temporature
        code:
          type: string
          example: 0A
          description: 编码
        unit:
          type: string
          example: F
          description: 单位
        sensorId:
          type: integer
          example: 10
          description: 传感器id
        sensorName:
          type: string
          example: 电流 sensor
          description: 传感器名称
        measureTypeId:
          type: integer
          description: >-
            mapper table monitoring_target_measure_type_map.id, Optional.
            理论上一个设备可能有多个同样参数的 sensor
        timeSeries:
          type: array
          description: 时间list
          items:
            type: integer
          example:
            - 1531992400000
            - 1531992500000
            - 1531992600000
        valueSeries:
          type: array
          description: 值列表
          items:
            type: number
          example:
            - -23
            - -24.5
            - -23.4
    TelemetryAggregatedTSData:
      properties:
        name:
          type: string
          description: 监控参数名字
          example: temporature
        code:
          type: string
          example: 0A
          description: 编码
        unit:
          type: string
          example: F
          description: 单位
        sensorId:
          type: integer
          example: 10
          description: 传感器id
        sensorName:
          type: string
          example: 电流 sensor
          description: 传感器名称
        measureTypeId:
          type: integer
          description: >-
            mapper table monitoring_target_measure_type_map.id, Optional.
            理论上一个设备可能有多个同样参数的 sensor

        meanValueSeries:
          type: array
          description: 值列表
          items:
            type: number
          example:
            - -23
            - null
            - -23.4
        maxValueSeries:
          type: array
          description: 值列表
          items:
            type: number
          example:
            - -21
            - null
            - -16.44
        minValueSeries:
          type: array
          description: 值列表
          items:
            type: number
          example:
            - -27
            - null
            - -28.4
    MonitoringTargetTelemetries:
      properties:
        name:
          type: string
          description: 监控对象名字
          example: fridge-001
        id:
          type: string
          example: 1
          description: 监控对象 ID
        startTime:
          type: integer
          example: 1531992437393
          description: 开始时间
        endTime:
          type: integer
          example: 1531992437000
          description: 结束时间
        telemetries:
          type: array
          description: 数据合集
          items:
            $ref: '#/components/schemas/TelemetryTSData'
    MonitoringTargetAggregatedTelemetries:
      properties:
        name:
          type: string
          description: 监控对象名字
          example: fridge-001
        id:
          type: string
          example: 1
          description: 监控对象 ID
        startTime:
          type: integer
          example: 1531992437393
          description: 开始时间
        endTime:
          type: integer
          example: 1531992437000
          description: 结束时间
        timeSlots:
          type: array
          description: 时间戳列表
          items:
            type: integer
          example:
            - 1531992437000
            - 1531992438000
        telemetryAggregatedData:
          type: array
          description: 数据合集
          items:
            $ref: '#/components/schemas/TelemetryAggregatedTSData'
    MonitoringTargetOperatingStatus:
      properties:
        timeSeries:
          type: array
          description: 时间合集
          items:
            type: integer
            example: 1456928000
        valueSeries:
          type: array
          description: 数据合集
          items:
            type: integer
            example: 20
    ErrorInfo:
      properties:
        code:
          type: integer
          description: application error code
          example: 40199
        message:
          type: string
          description: error message
          example: account locked
    LoginInfo:
      properties:
        username:
          type: string
          example: username@companydomain
          description: 用户名
        password:
          type: string
          example: 123456
          description: 密码
    CompanyInfoLogin:
      properties:
        id:
          type: integer
          example: 1
          description: company id
        name:
          type: string
          description: company name
          example: Microsoft
        logo:
          type: string
          description: company logo picture url
          example: 'http://image.com/320948230957.jpg'
        address:
          type: string
          description: company address
          example: 'shanghai pudong street '
        email:
          type: string
          description: company email
          example: shipu@ilabservice.com
    Permission:
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: CREATE_USER
          description: 权限名称
        permissionType:
          type: string
          example: RESOURCES
          description: 种类
        description:
          type: string
          example: 这是一个权限藐视
          description: '一个json string, 可能包含权限的多种properties.'
        objectType:
          type: string
          example: USER
          description: 所属对象
        operation:
          type: string
          example: CREATE
          description: 允许什么样的操作
    Role:
      properties:
        id:
          type: integer
          example: 1
          description: role id 主键
        roleType:
          type: string
          description: '两种role, System和Customer, 分别代表系统定义的和用户自定义的. 目前前端暂时还不支持Customer'
          example: System/Customer
        name:
          type: string
          example: Department_Admin
          description: role name
    UpdateAndAddRole:
      properties:
        roleType:
          type: string
          description: '两种role, System和Customer, 分别代表系统定义的和用户自定义的. 目前前端暂时还不支持Customer'
          example: System/Customer
        name:
          type: string
          example: Department_Admin
          description: role name
    RoleWithPermission:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        roleType:
          type: string
          example: system
          description: '两种role, System和Customer, 分别代表系统定义的和用户自定义的. 目前前端暂时还不支持Customer'
        name:
          type: string
          example: Department_Admin
          description: role name
        permissions:
          type: array
          description: 权限合集
          items:
            $ref: '#/components/schemas/Permission'
    ProductFeature:
      type: object
      properties:
        name:
          type: string
          example: device_lease
          description: 功能名称
        id:
          type: integer
          example: 1
          description: 功能id
        description:
          type: string
          example: description
          description: 描述信息
        category:
          type: string
          example: management
          description: 类别
    Department:
      type: object
      properties:
        name:
          type: string
          example: chemistry
          description: 部门名称
        id:
          type: integer
          example: 1
          description: 主键
        description:
          type: string
          example: Chemistry department
          description: 描述
        level:
          type: integer
          example: 0为最高 数值越大level越低
          description: 部门级别
        parentId:
          type: integer
          example: 1
          description: 上级部门id
        rootLocationIdList:
          description: >-
            root locations of a department, only for
            location_locked_to_department
          type: array
          items:
            type: integer
    DepartmentWithLocationBasic:
      type: object
      properties:
        name:
          type: string
          example: chemistry
          description: 部门名称
        id:
          type: integer
          example: 1
          description: 主键
        description:
          type: string
          example: Chemistry department
          description: 描述
        level:
          type: integer
          example: 0为最高 数值越大level越低
          description: 部门级别
        parentId:
          type: integer
          example: 1
          description: 上级部门id
        rootLocation:
          $ref: '#/components/schemas/LocationBasicInfo'
    DepartmentWithStats:
      type: object
      properties:
        name:
          type: string
          example: chemistry
          description: 部门名称
        id:
          type: integer
          example: 1
          description: 主键
        description:
          type: string
          example: Chemistry department
          description: 描述
        level:
          type: integer
          example: 0为最高 数值越大level越低
          description: 部门级别
        parentId:
          type: integer
          example: 1
          description: 上级部门id
        managerName:
          type: string
          example: John
          description: 部门管理员名字
        followed:
          type: integer
          example: 0 | 1
          description: 是否被关注
        rootLocation:
          #          description: 和此部门绑定的 location
          #          type: object
          #          schema:
          $ref: '#/components/schemas/LocationWeijian'
        monitoringTargets:
          description: 统计该 department 中各种类设备的数量.
          type: array
          items:
            $ref: '#/components/schemas/MonitoringTargetCount'

    Company:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: zhejiang university
          description: 公司名称
        customerManagerName:
          type: string
          example: customer manager
          description: 管理员名称
        address:
          type: string
          example: 1 shanxi rd
          description: 地址
        latitude:
          type: string
          example: 121.612236
          description: double类型，尾数保留六位
        longitude:
          type: string
          example: 31.183767
          description: 坐标
        email:
          type: string
          example: aaa@qq.com
          description: 邮箱
        domainName:
          type: string
          example: zju
          description: 域名
        telephone:
          type: string
          example: 0571-44448888
          description: 电话
        backgroundUrl:
          type: string
          example: 'http://zj.com/image/5555.jpg'
          description: 背景图
        locationLockedToDepartment:
          type: integer
          example: 0
          description: 该位置所属部门  非必传
        locationName:
          type: string
          example: SHANGHAI
          description: 位置名称
        loginUrl:
          type: string
          example: 'http://zj.com/image/5555.jpg'
          description: 公司logo
        logo:
          type: string
          example: 'http://zj.com/image/5555.jpg'
          description: 公司logo
        managerLoginUsername:
          type: string
          example: administrator
          description: 管理员账号
        managerName:
          type: string
          example: xxx
          description: 管理员名称
        extraFeatures:
          type: array
          items:
            $ref: '#/components/schemas/ProductFeature'
          description: 功能列表
        configurationTEXT:
          type: string
          description: '内容是 json string, 里面放 {"dept_alias": "CLINIC"}'
    Dept:
      type: object
      properties:
        name:
          type: string
          example: deptA
          description: 部门名称
        description:
          type: string
          example: 描述内容，非必传
          description: 描述
        parentId:
          type: integer
          example: 非必传，不传即为root
          description: 上级部门id
    CompanyContract:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        companyId:
          type: integer
          example: 1
          description: 公司id
        startDate:
          type: integer
          example: 1531992430000
          description: 开始时间
        endDate:
          type: integer
          example: 1531992400000
          description: 结束时间
        signDate:
          type: integer
          example: 1531992000000
          description: 签订日期
        description:
          type: string
          example: yearly contract renewed every year
          description: 描述
    MonitorTargetType:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: super fridge
          description: 监控对象名称
        companyId:
          type: integer
          example: 1
          description: 公司id
        description:
          type: string
          example: fridge for -200~-100 degree
          description: 描述
        logoUrl:
          type: string
          example: 'http://image.com/fridge.jpg'
          description: 公司log
        measureTypeIds:
          type: array
          items:
            $ref: '#/components/schemas/MeasureType'
          description: 监控参数list
    UpdateAndAddMonitorTargetType:
      type: object
      properties:
        name:
          type: string
          example: super fridge
          description: 监控对象名称
        companyId:
          type: integer
          example: 1
          description: 公司id
        description:
          type: string
          example: fridge for -200~-100 degree
          description: 描述
        logoUrl:
          type: string
          example: 'http://image.com/fridge.jpg'
          description: logo
        measureTypes:
          type: array
          items:
            $ref: '#/components/schemas/MeasureType'
          description: 监控参数list
    UploadFile:
      type: object
      description: 上传文件给文件定义的属性
      properties:
        name:
          type: string
          description: 文件名
          example: dev.jpg
        type:
          type: string
          description: '文件类型: MANUAL, INSPECTION, MAINTENANCE, CERTIFICATE, SAMPLE'
          example: 'MANUAL, INSPECTION, MAINTENANCE, CERTIFICATE, SAMPLE'
        description:
          type: string
          description: 文件内容简介
          example: device maintenance 2018
        file:
          type: string
          format: binary
    File:
      type: object
      description: 'file 只在 multi-part form 上传时候有用, 其他时候不在此 object中'
      properties:
        id:
          type: integer
          description: file id
        url:
          type: string
          example: 'http://storage.azure.com/china/east/234230970.pdf'
          description: 文件路径
        fileType:
          type: string
          example: pdf
          description: 文件类型
        name:
          type: string
          example: instruction
          description: 文件名
        description:
          type: string
          example: device operation instruction
          description: 描述
        createDate:
          type: integer
          description: timestamp
          example: 153199240000
        file:
          type: string
          format: binary
    MonitorTargetLabDevice:
      type: object
      description: '设备信息, 其中包含了监控对象的信息. 大部分情况下, 每一个设备都是一个监控对象, 但是监控对象不一定是一个 lab device.'
      properties:
        id:
          type: integer
          example: 1
          description: 设备 id
        monitorTargetId:
          type: integer
          example: 1
          description: 监控对象 id.
        name:
          type: string
          example: fridge-001
          description: 监控对象名称
        deviceType:
          type: string
          example: fridge
          description: 设备种类
        brand:
          type: string
          example: Samsung
          description: 品牌
        model:
          type: string
          example: SAMS001
          description: 种类
        assetId:
          type: string
          description: 编号
          example: Dept-Chm-fr-001
        createTime:
          type: integer
          description: timestamp
          example: 1531992437393
        serialNo:
          type: string
          description: 序列号
          example: SN00999FR001
        productLine:
          type: string
          description: 产品线
          example: food-research
        purchaseDate:
          type: integer
          example: 1531992400000
          description: 购买日期
        photo:
          type: string
          example: 'http://image.com/4423423.png'
          description: 设备图
        videoStreamingUrl:
          type: string
          example: ilabservice.com/camera/111
          description: 视频流地址
        ownerId:
          type: integer
          description: 设备管理员id
        operatorList:
          description: 设备使用者列表
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: 用户名字
                example: John
              id:
                type: integer
                description: 用户 ID
                example: 100
        xCoordinate:
          type: integer
          example: 334
          description: 设备位置  x坐标
        yCoordinate:
          type: integer
          example: 555
          description: 设备位置  y坐标
        locationId:
          type: integer
          description: 位置id
        locationBackground:
          type: string
          description: 所在location的背景图
          example: 'http://image.com/bkg.jpg'
        monitorTargetTypeId:
          type: integer
          description: 监控模板id
        monitorTargetTypeName:
          type: string
          example: super fridge
          description: 监控模板名称
        measureRules:
          type: array
          items:
            $ref: '#/components/schemas/MeasureRule'
          description: 监控规则list
        files:
          type: array
          items:
            $ref: '#/components/schemas/File'
          description: 设备文件list
        enableSharing:
          type: integer
          example: 0
          description: 是否共享  0 true   1 false
        blockchainKey:
          type: string
          example: ilab
          description: 区块链
        leaseClause:
          type: string
          example: no sublease
          description: 租赁条款
        leasePrice:
          type: number
          example: 55
          description: 价格
        latestRunningStatue:
          type: integer
          example: 0
          description: 状态
        alertPushEnabled:
          type: integer
          example: 0
          description: 设备的报警推送是否被激活
        healthScore:
          type: number
          description: 健康值
        timezone:
          type: string
          description: 时区
          example: Asia/Shanghai
        clientTag:
          type: string
          description: 用户资产号
          example: PDMS-H111
    DeviceFile:
      type: object
      properties:
        id:
          type: integer
          description: 文件 id
        name:
          type: string
          example: ilab
          description: 文件名
        url:
          type: string
          example: xxx.com
          description: 文件路径
        type:
          type: string
          example: 说明文件
          description: 文件类型
        description:
          type: string
          example: 描述
          description: 描述
        createDate:
          type: integer
          example: 156300000000
          description: 创建时间
        deviceId:
          type: integer
          example: 1
          description: 设备id
    LeaseSetting:
      type: object
      properties:
        deviceId:
          type: integer
          example: 1
          description: 设备id
        leasePrice:
          type: number
          example: 55
          description: 价格
        leaseClause:
          type: string
          example: no sublease
          description: 租赁条款
        enableSharing:
          type: integer
          example: 0
          description: 是否共享
    LeaseTimeSlot:
      type: object
      properties:
        startTime:
          type: integer
          example: 1531992430000
          description: 开始时间
        endTime:
          type: integer
          example: 1531992430000
          description: 结束时间
        recurrence:
          type: string
          example: 'daily, weekly, weekdays'
          description: 设置租赁方式
        recurStart:
          type: integer
          description: >-
            if this is recurrence time, the start quarter hour offset to the
            start of the recurrence day. recurrence daily, 24 means 6am example:
            24
        recurEnd:
          type: integer
          example: 36
          description: 时间偏移量  15分钟为单位
    LeaseRecord:
      type: object
      properties:
        id:
          type: integer
        leaseeId:
          type: integer
          description: 出租人id
        leaseName:
          type: string
          example: Jesse Paul
          description: 出租人名称
        leaserId:
          type: integer
          description: 租赁者id
        leaserName:
          type: string
          example: Max Gupta
          description: 租赁者名称
        deviceId:
          type: integer
          description: 设备id
        deviceName:
          type: string
          example: fridge-001
          description: 设备名称
        startTime:
          type: integer
          example: 1531992400000
          description: 开始租赁时间
        endTime:
          type: integer
          example: 1531992800000
          description: 结束租赁时间
        agreement:
          type: string
          description: 协议
          example: ilab
        status:
          type: integer
          example: 0
          description: 租赁状态
        recurrenceId:
          type: string
          example: 1
          description: 同一批次的租赁会有同一个id  uuid生成
    SampleType:
      type: object
      description: '样品种类, 如果 departmentId 为空, 则该种类全公司可见.'
      properties:
        nameZh:
          type: string
          example: 液氮
          description: 中文名
        nameEn:
          type: string
          example: liquid nitrogeion
          description: 英文名
        description:
          type: string
          example: liquid nitrogeion
          description: 描述
        brand:
          type: string
          example: chemax
          description: 品牌
        category:
          type: string
          example: chemistry
          description: 类别
        departmentId:
          type: integer
          example: 1
          description: 部门id
        companyId:
          type: integer
          example: 1
          description: 公司id
        lowInventory:
          type: integer
          example: 200
          description: 该种类样品允许最低库存数量，低于该数量要报警
    Sample:
      type: object
      properties:
        name:
          type: string
          example: F3O4-11
          description: 样品名称
        sampleSetId:
          type: integer
          example: 3
          description: 样品集id
        containerId:
          type: integer
          example: 1
          description: 样品柜id
        deviceId:
          type: integer
          example: 1
          description: 设备id
        rfid:
          type: string
          example: 2342805980
          description: rfid， 标识该样品
        containerSlotCode:
          type: string
          example: L2S5
          description: 插槽编号
        containerSlotDesc:
          type: string
          example: level2 slot5
          description: 插槽顺序
    SampleVo:
      type: object
      properties:
        name:
          type: string
          example: F3O4-11
          description: 样品名称
        sampleSetId:
          type: integer
          example: 3
          description: 样品集id
        containerId:
          type: integer
          example: 1
          description: 样品柜id
        deviceId:
          type: integer
          example: 1
          description: 设备id
        rfid:
          type: string
          example: 2342805980
          description: rfid， 标识该样品
        containerSlotCode:
          type: string
          example: L2S5
          description: 插槽编号
        containerSlotDesc:
          type: string
          example: level2 slot5
          description: 插槽顺序
        sampleSet:
          description: 该样品所对应的样品集
          type: array
          items:
            $ref: '#/components/schemas/SampleSet'
    SampleCategory:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: category的ID
        name:
          type: string
          example: Base
          description: category名称
        description:
          type: string
          example: 描述信息
          description: 描述信息
        companyId:
          type: integer
          example: 1
          description: 公司的id
    SampleSet:
      type: object
      properties:
        sampleTypeId:
          type: integer
          example: 1
          description: 样品种类id
        nameZh:
          type: string
          example: 液氮
          description: 中文名
        nameEn:
          type: string
          example: liquid nitrogeion
          description: 英文名
        chemicalStructure:
          type: string
          example: H2O
          description: 化学分子式
        cas_no:
          type: string
          example: 11-22-3
          description: Cas 号
        cat_no:
          type: string
          example: 11-22-3
          description: Cat 号
        lot_no:
          type: string
          example: '1223456'
          description: Lot 号
        volumeSpec:
          type: string
          example: 3L
          description: 规格
        category:
          type: string
          example: acid
          description: '泛类别, 如酸或者碱性'
        expirationDate:
          type: string
          example: '2019-05-11'
          description: 保质期截止日期
        receivedDate:
          type: string
          example: '2019-01-11'
          description: 购置日期
        owner:
          type: string
          example: John
          description: 拥有者姓名
        lowInventory:
          type: integer
          example: 200
          description: 该样品集允许最低库存数量，低于该数量要报警
        brand:
          type: string
          example: chemax
          description: 品牌
        description:
          type: string
          example: >-
            {"Location (Lab No.)":"722#1-2","Owner":"hailongwang","Received
            Date":"2011-6-11"}
          description: '描述, json string, 包含样品种类的所有其他属性'
        departmentId:
          type: integer
          example: 1
          description: 部门id
        departmentName:
          type: string
          example: 研发2组
          description: 部门名称
    SampleSetVo:
      type: object
      properties:
        sampleTypeId:
          type: integer
          example: 1
          description: 样品种类id
        nameZh:
          type: string
          example: 液氮
          description: 中文名
        nameEn:
          type: string
          example: liquid nitrogeion
          description: 英文名
        chemicalStructure:
          type: string
          example: H2O
          description: 化学分子式
        cas_no:
          type: string
          example: 11-22-3
          description: Cas 号
        cat_no:
          type: string
          example: 11-22-3
          description: Cat 号
        lot_no:
          type: string
          example: '1223456'
          description: Lot 号
        volumeSpec:
          type: string
          example: 3L
          description: 规格
        category:
          type: string
          example: acid
          description: '泛类别, 如酸或者碱性'
        expirationDate:
          type: string
          example: '2019-05-11'
          description: 保质期截止日期
        receivedDate:
          type: string
          example: '2019-01-11'
          description: 购置日期
        owner:
          type: string
          example: John
          description: 拥有者姓名
        lowInventory:
          type: integer
          example: 200
          description: 该样品集允许最低库存数量，低于该数量要报警
        brand:
          type: string
          example: chemax
          description: 品牌
        description:
          type: string
          example: >-
            {"Location (Lab No.)":"722#1-2","Owner":"hailongwang","Received
            Date":"2011-6-11"}
          description: '描述, json string, 包含样品种类的所有其他属性'
        departmentId:
          type: integer
          example: 1
          description: 部门id
        departmentName:
          type: string
          example: 研发2组
          description: 部门名称
        samples:
          description: 该种类下的样品列表
          type: array
          items:
            $ref: '#/components/schemas/Sample'
    SampleStocking:
      type: object
      properties:
        name:
          type: string
          example: F3O4-11
          description: 样品名称
        sampleType:
          type: string
          example: F3O4
          description: 样品种类
        timeStamp:
          type: integer
          example: 15678224000
          description: 时间戳
        operation:
          type: string
          description: '出入库操作, in 或者 out'
          example: 'out, in'
        terminology:
          type: string
          example: weak acid
          description: 英文名称  国际标准名称
        device:
          type: string
          description: device the sample was in/out stock
          example: fridge-001
        department:
          type: string
          description: the department the sample was in/out stock
          example: lab-001
    SpecimenStocking:
      type: object
      properties:
        name:
          type: string
          example: sea-water111
          description: 样本名称
        timeStamp:
          type: integer
          example: 156782240000
          description: 时间戳
        operation:
          type: string
          description: '出入库操作, in 或者 out'
          example: 'out, in'
        cabinet:
          type: string
          description: cabinet the sample was in/out stock
          example: fridge-001
        owner:
          type: string
          description: 样本拥有者
          example: 陶哲轩
        stop:
          type: string
          description: 站位
          example: 中山站
        hazardous:
          type: boolean
          description: 是否有害
          example: true

    SampleContainer:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: container-001
          description: 样品柜名称
        device:
          type: string
          example: fridge-001
          description: 设备名称
        description:
          type: string
          example: 描述
          description: 描述
        devicePosition:
          type: string
          example: upper
          description: 柜子在设备中的位置
        serialNumber:
          type: string
          example: SC0023992
          description: 终端sn
        category:
          type: array
          description: 可存放样品的范类
          example:
            - acid
            - alkline
          items:
            type: string
        photo:
          type: string
          example: 'http://aaa.com/aaa.jpg'
          description: 图片
        deviceId:
          type: integer
          description: device id
          example: 3
        shelves:
          type: integer
          description: 样品柜的层数
          example: 4
        sampleSlots:
          type: array
          items:
            $ref: '#/components/schemas/SampleSetVo'
          description: sample_set集合
        containerLocation:
          type: array
          items:
            $ref: '#/components/schemas/SampleContainerLocation'
          description: 样品柜中的层和槽
    SampleContainerLocation:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        contationId:
          type: integer
          example: 1
          description: 样品柜ID
        parentId:
          type: integer
          example: 1
          description: 槽所对应的层ID
        tier:
          type: integer
          example: 5
          description: 层
        slot:
          type: integer
          example: 5
          description: 槽
        type:
          type: string
          example: tier/slot
          description: 类型
    SampleContainerBasic:
      type: object
      properties:
        name:
          type: string
          example: container-01
          description: 样品柜名称
        deviceId:
          type: integer
          description: device id
          example: 3
        description:
          type: string
          example: 描述
          description: 描述
        devicePosition:
          type: string
          example: upper
          description: 柜子在设备中的位置
        serialNumber:
          type: string
          example: SC00423423
          description: 终端 唯一
        photo:
          type: string
          example: 'http://aaa.com/aaa.jpg'
          description: 图片
        category:
          type: array
          description: 可存放样品的范类
          example:
            - acid
            - alkline
          items:
            type: string
    MeasureType:
      type: object
      properties:
        name:
          type: string
          example: temporature
          description: 监控参数名称
        code:
          type: string
          example: 0A
          description: 监控参数代码
        unit:
          type: string
          example: C
          description: 单位
        measurement:
          type: string
          description: '参数的英文唯一描述, 用来给前端做多语言翻译'
          example: TEMPORATURE
    UpdateUser:
      type: object
      properties:
        name:
          type: string
          example: Max Tony
          description: 姓名
        jobNumber:
          type: string
          example: 1
          description: 工号
        job:
          type: string
          example: java
          description: 职位
        gender:
          type: string
          example: girl
          description: 性别
    User:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: 主键
        username:
          type: string
          example: abc@zju
          description: 用户名
        name:
          type: string
          example: Max Tony
          description: 用户名称
        email:
          type: string
          example: max@zju.org
          description: 邮件
        mobile:
          type: string
          example: 13599990000
          description: 电话
        telephone:
          type: string
          example: 0571-44554455
          description: 座机/传呼
        gender:
          type: string
          example: M
          description: 性别
        headIcon:
          type: string
          example: 'http://image.com/me.jpg'
          description: 头像
        department:
          type: string
          example: chemistry
          description: 部门
        job:
          type: string
          example: device admin
          description: 职位
        jobNum:
          type: string
          example: DA-001
          description: 工号
        companyDomainName:
          type: string
          example: zju
          description: 域名
        bindMobile:
          type: integer
          description: 手机
        bindEmail:
          type: integer
          description: 邮箱
        alertNotificationType:
          type: integer
          description: '0 no notif, 1 mobile, 2 email, 3 both'
        latestPasswordUpdateTime:
          type: integer
          description: timestamp in ms
          example: 1531992400000
        role:
          type: string
          description: 角色
    MonitorTargetBasic:
      type: object
      description: '简化版监控对象信息, 用于列表显示, 和dashboard的图中显示'
      properties:
        id:
          type: integer
          format: int64
          description: 主键
        name:
          type: string
          example: fridge-001
          description: 监控对象名称
        deviceType:
          type: string
          example: fridge
          description: 设备种类
        monitoringTargetType:
          type: string
          example: fridge
          description: 监控模板
        photoUrl:
          type: string
          description: 图片的地址
        xCoordinate:
          type: string
          description: 'x 坐标, 在上一级的 location 的平面图中的位置'
          example: 100
        yCoordinate:
          type: string
          description: 'y 坐标, 在上一级的 location 的平面图中的位置'
          example: 23
        location:
          type: string
          example: room1-1
          description: 设备位置
        manager:
          type: string
          example: John Doe
          description: 设备管理员
        model:
          type: string
          example: GE-RSD11
          description: 种类
        alertPushEnabled:
          type: integer
          description: 是否推送报警信息  0 true   1 false
        healthScore:
          type: number
          example: 34.5
          description: 健康度
        clientTag:
          type: string
          example: TDSM-T11
          description: 用户资产号
    DeviceFullData:
      type: object
      description: 设备监控全部信息
      properties:
        deviceDetail:
          description: 设备信息
          $ref: 'components/schemas/MonitorTargetBasic'
        telemetries:
          description: 实时监控数据
          type: array
          items:
            $ref: '#/components/schemas/TelemetryTSData'
        leaseRecords:
          type: array
          description: 租赁记录列表
          items:
            $ref: '#/components/schemas/LeaseRecord'
        leaseOpenTimeSlots:
          type: array
          description: 可租赁时间
          items:
            $ref: '#/components/schemas/LeaseTimeSlot'
        hourlyUtilization:
          type: array
          description: 数据合集
          items:
            $ref: '#/components/schemas/HourlyUtilization'

    MonitorTargetLabDeviceJanssen:
      type: object
      description: '设备信息, 其中包含了监控对象的信息. 大部分情况下, 每一个设备都是一个监控对象, 但是监控对象不一定是一个 lab device.'
      properties:
        id:
          type: integer
          example: 1
          description: 设备 id
        monitorTargetId:
          type: integer
          example: 1
          description: 监控对象 id.
        name:
          type: string
          example: fridge-001
          description: 监控对象名称
        brand:
          type: string
          example: Samsung
          description: 品牌
        last_maintenance_time:
          type: integer
          example: 102312313023
          description: 上次维护时间
        maintenance_cycle:
          type: string
          example: year month day
          description: 维护周期
        model:
          type: string
          example: SAMS001
          description: 种类
        assetId:
          type: string
          description: 编号
          example: Dept-Chm-fr-001
        createTime:
          type: integer
          description: timestamp
          example: 1531992437393
        serialNo:
          type: string
          description: 序列号
          example: SN00999FR001
        productLine:
          type: string
          description: 产品线
          example: food-research
        purchaseDate:
          type: integer
          example: 1531992400000
          description: 购买日期
        photo:
          type: string
          example: 'http://image.com/4423423.png'
          description: 设备图
        ownerId:
          type: integer
          description: 设备管理员id
        operatorList:
          description: 设备使用者列表
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: 用户名字
                example: John
              id:
                type: integer
                description: 用户 ID
                example: 100
        xCoordinate:
          type: integer
          example: 334
          description: 设备位置  x坐标
        yCoordinate:
          type: integer
          example: 555
          description: 设备位置  y坐标
        locationId:
          type: integer
          description: 位置id
        locationBackground:
          type: string
          description: 所在location的背景图
          example: 'http://image.com/bkg.jpg'
        monitorTargetTypeId:
          type: integer
          description: 监控模板id
        monitorTargetTypeName:
          type: string
          example: super fridge
          description: 监控模板名称
        measureRules:
          type: array
          items:
            $ref: '#/components/schemas/MeasureRule'
          description: 监控规则list
        files:
          type: array
          items:
            $ref: '#/components/schemas/File'
          description: 设备文件list
        enableSharing:
          type: integer
          example: 0
          description: 是否共享  0 true   1 false
        blockchainKey:
          type: string
          example: ilab
          description: 区块链
        leaseClause:
          type: string
          example: no sublease
          description: 租赁条款
        leasePrice:
          type: number
          example: 55
          description: 价格
        latestRunningStatue:
          type: integer
          example: 0
          description: 状态
        alertPushEnabled:
          type: integer
          example: 0
          description: 设备的报警推送是否被激活
        healthScore:
          type: number
          description: 健康值
        timezone:
          type: string
          description: 时区
          example: Asia/Shanghai
    LocationTree:
      type: object
      description: '简略位置信息, 用于列表显示, 或者子 location 显示'
      properties:
        id:
          type: integer
        name:
          type: string
          example: 5号楼
          description: 位置名称
        locationType:
          type: string
          example: BUILDING
        xaxisCoordinate:
          type: string
          description: 'x 坐标, 在上一级的 location 的平面图中的位置'
          example: '65.2342'
        yaxisCoordinate:
          type: string
          description: 'y 坐标, 在上一级的 location 的平面图中的位置'
          example: '-122.4524'
        background:
          type: string
          description: blue print
          example: xxx.com/xxx.jpg
        childLocations:
          type: array
          description: '子 location 列表, 类型相同.'
          items:
            $ref: '#/components/schemas/LocationTree'

    LocationBasicInfo:
      type: object
      description: '简略位置信息, 用于列表显示, 或者子 location 显示'
      properties:
        id:
          type: integer
        name:
          type: string
          example: 5号楼
          description: 位置名称
        locationType:
          type: string
          example: BUILDING
        xCoordinate:
          type: string
          description: 'x 坐标, 在上一级的 location 的平面图中的位置'
          example: '65.2342'
        yCoordinate:
          type: string
          description: 'y 坐标, 在上一级的 location 的平面图中的位置'
          example: '-122.4524'
    LocationBasic:
      type: object
      description: '简略位置信息, 用于列表显示, 或者子 location 显示'
      properties:
        id:
          type: integer
        name:
          type: string
          example: 5号楼
          description: 位置名称
        locationType:
          type: string
          example: BUILDING
        xCoordinate:
          type: string
          description: 'x 坐标, 在上一级的 location 的平面图中的位置'
          example: '65.2342'
        yCoordinate:
          type: string
          description: 'y 坐标, 在上一级的 location 的平面图中的位置'
          example: '-122.4524'
        yellowAlertCountToday:
          type: integer
          example: 15
          description: 在这个location下的当前登录用户可见的设备的今日黄色报警总数
        redAlertCountToday:
          type: integer
          example: 20
          description: 在这个location下的当前登录用户可见的设备的今日红色报警总数
        onlineCount:
          type: integer
          example: 15
          description: 在这个location下的当前登录用户可见的在线设备总数
        offlineCount:
          type: integer
          example: 20
          description: 在这个location下的当前登录用户可见的离线设备总数
        deviceCount:
          type: integer
          example: 35
          description: 设备数量
    LocationParam:
      type: object
      description: loca需要传递的参数
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: building
          description: 位置名称
        parnetId:
          type: string
          example: '1'
          description: 上层位置
        isLeaf:
          type: integer
          example: 1
          description: 是否在线
        locationType:
          type: string
          example: 位置种类
          description: 种类  楼 层 室 或其他自定义的位置
        xLocation:
          type: string
          example: 123.123123
          description: 双精度小数 double
        yLocation:
          type: string
          example: 1233.3123123
          description: 双精度小数 double
        background:
          type: string
          example: xxx.com/xxx.jpg
          description: 背景图
        departmentId:
          type: integer
          example: 1
          description: 部门id，非必传
        xcoordinate:
          type: string
          example: 2312.23123123
          description: 双精度小数 double
        ycoordinate:
          type: string
          example: 231.213123123
          description: 双精度小数 double
        description:
          type: string
          description: 这是一个描述
    Location:
      type: object
      description: '位置资产, 例如, 楼, 层, 室'
      properties:
        name:
          type: string
          example: xixi campus
          description: 位置名称
        parent_id:
          type: integer
          example: 1
          description: 上层位置id
        isLeaf:
          type: boolean
          description: '是否是终端位置, 即不能再有子位置.'
        locationType:
          type: string
          description: 位置类型
          example: 'COMPANY(root only), CITY, CAMPUS, BUILDING, FLOOR, ROOM'
        description:
          type: string
          example: 描述
          description: 描述
        address:
          type: string
          example: shanghai
          description: 所在地
        xCoordinate:
          type: string
          description: 'x 坐标, 在上一级的 location 的平面图中的位置'
          example: '55.23421'
        yCoordinate:
          type: string
          description: 'y 坐标, 在上一级的 location 的平面图中的位置'
          example: '66.0742389'
        monitorTargetNum:
          type: integer
          description: 在这个location下的当前登录用户可见的设备总数
          example: 5
        yellowAlertCountToday:
          type: integer
          description: 在这个location下的当前登录用户可见的设备的今日黄色报警总数
        redAlertCountToday:
          type: integer
          description: 在这个location下的当前登录用户可见的设备的今日红色报警总数
        onlineCount:
          type: integer
          description: 在这个location下的当前登录用户可见的在线设备总数
          example: 4
        offlineCount:
          type: integer
          description: 在这个location下的当前登录用户可见的离线设备总数
          example: 1
        background:
          type: string
          description: 背景图
        departmentId:
          type: integer
          description: 所属部门id，绑定的部门可见，非必传参数
        childLocations:
          type: array
          items:
            $ref: '#/components/schemas/LocationBasic'
          description: 子location集合
        monitorTargets:
          type: array
          items:
            $ref: '#/components/schemas/MonitorTargetBasic'
          description: 该位置下的所有监控对象集合
        runningDays:
          type: integer
          description: 运行天书，从第一台设备的创建时间开始算起
        healthScore:
          type: number
          description: 健康度
        timezone:
          type: string
          description: 时区
    LocationWeijian:
      type: object
      description: '位置资产, 例如, 楼, 层, 室'
      properties:
        name:
          type: string
          example: xixi campus
          description: 位置名称
        parent_id:
          type: integer
          example: 1
          description: 上层位置id
        locationType:
          type: string
          description: 位置类型
          example: 'COMPANY(root only), CITY, CAMPUS, BUILDING, FLOOR, ROOM'
        description:
          type: string
          example: 描述
          description: 描述
        district:
          type: string
          example: 城北片
          description: 双随机片区
        address:
          type: string
          example: shanghai
          description: 所在地
        xCoordinate:
          type: string
          description: 'x 坐标, 在上一级的 location 的平面图中的位置'
          example: '55.23421'
        yCoordinate:
          type: string
          description: 'y 坐标, 在上一级的 location 的平面图中的位置'
          example: '66.0742389'
        timezone:
          type: string
          description: 时区
        eventStats:
          type: array
          items:
            $ref: '#/components/schemas/EventStats'

    LocationType:
      type: object
      description: '位置资产, 例如, 楼, 层, 室'
      properties:
        id:
          type: integer
          example: 1
          description: ID
        name:
          type: string
          example: 楼
          description: 位置类型
        description:
          type: string
          description: 描述
        level:
          type: integer
          description: 级别
          example: 12
        companyId:
          type: integer
          example: 1
          description: 公司的ID
    Specimen:
      type: object
      description: 样本数据
      properties:
        id:
          type: integer
          description: key
          example: 1
        marineInfoId:
          type: integer
          description: 航海物理信息的 id
          example: 10
        name:
          type: string
          description: 样本名称
          example: sea-water100
        type:
          type: string
          description: 样本种类
          example: sea-water
        rfid:
          type: string
          description: rfid
          example: sp238742-2384829-fshfd834
        storeEnv:
          type: string
          description: 存储条件
          example: 低温
        specification:
          type: string
          description: 规格
          example: 100ml
        owner:
          type: string
          description: 所有者
          example: 丘成桐
        hazardous:
          type: boolean
          description: 是否有害
          example: true
        containerId:
          type: integer
          description: 样本柜 id
          example: 11
        isRecorded:
          type: boolean
          description: 是否已经录入
          example: true

    MarineInfo:
      type: object
      description: 航海物理信息
      properties:
        id:
          type: integer
          description: key
          example: 1
        voyage:
          type: string
          description: 航次
          example: ca2019-1
        stop:
          type: string
          description: 站点
          example: 中山站
        longitude:
          type: number
          description: 经度
          example: 112.43234
        latitude:
          type: number
          description: 纬度
          example: 23.342
        time:
          type: integer
          description: 采样时间戳
          example: 156823400000
        depth:
          type: integer
          description: 水深
          example: 200
        description:
          type: string
          description: 其他参数构成的 json string, 前端定义显示那些内容
          example: '{"采样层次": 20, "风向": "NW", "风速": 23, "气压":"23pa"}'




    MeasureRule:
      type: object
      description: 监控参数的事件触发规则.
      properties:
        id:
          type: integer
          description: 主键
        name:
          type: string
          example: temporature upperbound
          description: 监控规则名称
        definition:
          type: string
          description: '规则描述, json string'
          example: >-
            {"type":"booleanStatement","conditions":[{"op":">","value":"100","measureTypeId":"1"},{"op":"<","value":"74","measureTypeId":"1"}]}
        purpose:
          type: integer
          description: '规则目的, 0位报警, 1为运行状态'
        eventType:
          type: integer
          description: 规则触发时产生的事件类型
        sensor:
          type: array
          items:
            type: integer
          description: '规则加载的 sensor id, 只对监控对象有效'
    Event:
      type: object
      description: 监控事件
      properties:
        id:
          type: integer
          description: 主键
        eventType:
          type: string
          description: '事件种类, 例如黄色报警'
          example: 'red_alert(红色报警), yellow_alert(黄色报警), offline(离线), expired(过期)'
        device:
          type: string
          description: 设备名
        location:
          type: string
          description: '事件发生地点, 多为设备的地点'
        count:
          type: integer
          description: '连续发生次数, 例如黄色报警连续报警次数'
        measureType:
          description: '触发事件的监控参数, 可能为多个, 依据对应的规则而定, 为 MeasureType.measurement'
          type: array
          items:
            type: string
        startTime:
          type: integer
          description: 报警开始时间
        endTime:
          type: integer
          description: 报警结束时间
        reason:
          type: string
          description: 发生原因
        correctAction:
          type: string
          description: 处理方法
        processStatus:
          type: string
          description: 处理结果
        processTime:
          type: integer
          description: 处理时间
        actions:
          type: string
          description: '类型为 TEXT, 存放 json array string.  检查结果的格式大致为 {"action": "examine", "time": 123487482000, "results": {1: 300, 2: "34%"}, "doc": ["aaaa.jpg", "bbbb.docx"]}
          此处的results字段中, key的值为measure type id'
    EventTypeStats:
      type: object
      description: count of an event type
      properties:
        id:
          type: integer
          description: event type id
        typeName:
          type: string
          example: 'operation_violation, risk_reminder, abnormal_run,offline, red_alert, yellow_alert'
          description: event type name
        count:
          type: integer
          example: 10
          description: count of the events
    EventStats:
      type: object
      description: statistics of an event type
      properties:
        typeName:
          type: string
          example: 'operation_violation, risk_reminder, abnormal_run,offline, red_alert, yellow_alert'
          description: event type name
        category:
          type: string
          example: alert
          description: event type category
        count:
          type: integer
          example: 10
          description: count of the events
    MonitoringTargetCount:
      type: object
      description: count to monitoring target by type
      properties:
        typeName:
          type: string
          example: 'x-ray machine'
          description: monitor_target type name
        typeId:
          type: integer
          example: 1
          description: monitor_target type id
        count:
          type: integer
          example: 10
          description: count of the monitor_target
    EventStatusStats:
      type: object
      description: statistics of an event status
      properties:
        status:
          type: string
          description: event status
          example: 'OPEN, CASE_FILED, HEARING_EVIDENCE, SENTENCED, SUMMON_ISSUED, ADMINISTRATIVE_PUNISHMENT, SUPERIOR_RECORDED, CLOSED, ALERT_DELAYED'
        count:
          type: integer
          example: 10
          description: count of the events
    EventWithData:
      type: object
      description: 带监控数据的事件
      properties:
        event:
          description: 事件
          $ref:  '#/components/schemas/Event'
        data:
          description: 监控数值
          $ref: '#/components/schemas/MonitoringTargetAggregatedTelemetries'

    EventStatusChange:
      type: object
      description: 事件状态变化
      properties:
        eventId:
          type: integer
          description: 事件 id
        eventType:
          type: string
          description: 事件种类
        oldStatus:
          type: string
          description: 旧状态
        newStatus:
          type: string
          description: 新状态
        timeStamp:
          type: integer
          description: 时间戳
        userId:
          type: integer
          description: 用户 id
        userName:
          type: string
          description: 用户名字
    EventType:
      type: object
      description: 事件种类
      properties:
        id:
          type: integer
          description: 主键
        name:
          type: string
          example: 黄色报警
          description: 报警类型名称
        description:
          type: string
          description: 描述
        category:
          type: string
          example: alert
          description: 报警类型 alert yellow red
        company_id:
          type: integer
          example: '1'
          description: '公司id'
        action_required:
          type: string
          description: 是否需要处理 0 | 1
    EventTypePost:
      type: object
      description: 事件种类
      properties:
        name:
          type: string
          example: 黄色报警
          description: 报警类型名称
        description:
          type: string
          description: 描述
        category:
          type: string
          example: alert
          description: 报警类型 alert yellow redenabled
        action_required:
          type: integer
          description: 是否需要处理 0 | 1
    Task:
      type: object
      description: 任务
      properties:
        id:
          type: integer
          description: 主键
        recurrence:
          type: string
          description: '默认任务周期为DAILY，三种周期分别为HOURLY，DAILY，WEEKLY '
          example: 'HOURLY | DAILY | WEEKLY | WORKDAY'
        department:
          type: string
          description: '任务所属部门名称'
          example: '科比口腔'
        enabled:
          type: string
          description: '默认为true'
        scope:
          type: string
          description: '选择设备或者部门 department，monitoring_target'
          example: 'department | monitoring_target'
        ref_id:
          type: string
          description: '设备或者部门 id'
        rules:
          type: string
          description: '任务定义, json string. '
          example: '｛event_type_list: [1,3], repeat: 2, order: 0｝'
        last_check_datetime:
          type: string
    TaskPost:
      type: object
      description: 任务
      properties:
        recurrence:
          type: string
          description: '默认任务周期为DAILY，三种周期分别为HOURLY，DAILY，WEEKLY '
          example: 'HOURLY | DAILY | WEEKLY | WORKDAY'
        enabled:
          type: string
          description: '默认为true'
        scope:
          type: string
          description: '选择设备或者部门 department，monitoring_target'
          example: 'department | monitoring_target'
        ref_id:
          type: string
          description: '设备或者部门 id'
        rules:
          type: string
          description: '任务定义, json string. '
          example: '｛event_type_list: [1,3], repeat: 2, order: 0｝'

    Operation:
      type: object
      description: 操作
      properties:
        timeStamp:
          type: integer
          example: 153023420000
          description: 写入操作发生的时间戳
        username:
          type: string
          example: abc@zju
          description: 用户名
        userDisplayName:
          type: string
          example: Max Paul
          description: 操作人姓名
        operationType:
          type: string
          example: CREATE
          description: 操作类型  create update delete insert
        url:
          type: string
          example: xx.intelab.ilabservice/api/v2/get/user
          description: 请求地址
        operationName:
          type: string
          example: CREATE_USER
          description: 操作标记，说明这个操作是干什么的
        content:
          type: string
          description: json string 修改/创建后的值
          example: '{"id":{"enValue":"11","chValue":"11"},"name":{"enValue":"ilab","chValue":"ilab"}}'
        oldContent:
          type: string
          description: 'json string, 操作之前的值, 可选'
          example: '{"id":{"enValue":"11","chValue":"11"},"name":{"enValue":"ilab","chValue":"ilab"}}'
        queryConditions:
          type: string
          description: 'json string, 操作之前的值, 可选'
          example: '{"id":{"enValue":"11","chValue":"11"},"name":{"enValue":"ilab","chValue":"ilab"}}'
    RunningStatus:
      type: object
      description: 运行状态
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          description: 运行状态名称
        level:
          type: integer
          description: 级别
    SensorTemplate:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: temporature01
          description: 传感器模版名称
        sensorType:
          type: string
          example: temporature
          description: 传感器种类
        sensorTypeId:
          type: integer
          description: 传感器种类id  主键
        terminalPort:
          type: string
          example: A
          description: 端口
        terminalPortAddr:
          type: string
          example: '0'
          description: 地址
    Sensor:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          example: temporature01
          description: 传感器名称
        sensorTypeId:
          type: integer
          description: 传感器种类id
        sensorType:
          type: string
          example: temporature
          description: 传感器种类名称
        terminalSerialNo:
          type: string
          example: T032940328
          description: 传感器终端编号  唯一
        terminalPort:
          type: string
          example: A
          description: 端口
        terminalPortAddress:
          type: string
          example: '0'
          description: 端口地址
        status:
          type: string
          example: normal|offline|alert
          description: 状态
        xPositionRatio:
          type: integer
          example: 200
          description: 在设备中的位置  x轴
        yPositionRatio:
          type: integer
          example: 220
          description: 在设备中的位置  y轴
    SensorCreate:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: temporature01
          description: 传感器名称
        sensorTypeId:
          type: integer
          example: 1
          description: 传感器种类id，sensorType的主键
        terminalSerialNo:
          type: string
          example: T032940328
          description: 终端编号  唯一
        terminalPort:
          type: string
          example: A
          description: 终端端口
        terminalPortAddress:
          type: string
          example: '0'
          description: 终端地址
        xPositionRatio:
          type: integer
          example: 200
          description: 传感器在设备中的位置  x轴
        yPositionRatio:
          type: integer
          example: 220
          description: 传感器在设备中的位置  y轴
    SensorType:
      type: object
      properties:
        name:
          type: string
          example: temporature
          description: 传感器种类名称
        description:
          type: string
          example: temporature sensor
          description: 描述该种传感器的作用
        manufacture:
          type: string
          example: ABCD
          description: 制造商
        model:
          type: string
          example: temp001
          description: 样板
        brand:
          type: string
          example: BBB
          description: 品牌
    StatsMonitorTargetType:
      type: object
      description: 统计中的监控模板
      properties:
        measureTypeIdSet:
          type: array
          items:
            type: integer
          description: 监控参数id的集合
        name:
          type: string
        id:
          type: integer
    StatsMonitorTarget:
      type: object
      description: 统计中的监控对象
      properties:
        monitorTargetTypeId:
          type: integer
          description: 监控模板id
        name:
          type: string
          description: 名称
        id:
          type: integer
    NameAndId:
      type: object
      properties:
        name:
          type: string
          description: name，如username，deptname等
        id:
          type: integer
    StatsDailyResult:
      type: object
      properties:
        aveResultList:
          type: array
          items:
            type: number
          description: 均值列表
        dateList:
          description: 时间戳列表
          type: array
          items:
            type: number
    StatsMonitorHistory:
      type: object
      properties:
        measurement:
          type: string
          example: humidity
          description: 监控参数
        dates:
          type: array
          example:
            - 15723450000
            - 15723660000
          items:
            type: integer
          description: 日期序列
        avgValue:
          type: array
          example:
            - 10
            - 11
          items:
            type: number
          description: 平均值序列
        maxValue:
          type: array
          example:
            - 15
            - 17
          items:
            type: number
          description: 最大值序列
        minValue:
          type: array
          example:
            - 9
            - 3
          items:
            type: number
          description: 最小值序列
    OperatingStatusModel:
      type: object
      properties:
        id:
          type: integer
          description: 主键
        name:
          type: string
          example: 阈值模型
          description: 运行状态模型名称   阈值模型，阈值尖刺模型，均值聚类模型
        trainingNeeded:
          type: integer
          example: 1
          description: 是否需要训练
        minTrainingPeriod:
          type: integer
          description: 最小训练周期
          example: 3600
        description:
          type: string
          example: '此模型为标准阈值判断, 不设计模型训练'
    MonitorTargetTypeOperatingStatusModel:
      type: object
      properties:
        id:
          type: integer
          description: 主键
        modelId:
          type: integer
          description: 模型种类id
        monitoringTargetTypeId:
          type: integer
          description: 监控模板id
        parameter:
          type: string
          example: '{''groupNumber'': 2, ''thresholdRules'': ''{}''}'
          description: 曲线参数
        waveLength:
          type: integer
          description: 波长
          example: 60
        modelPath:
          type: string
          example: 'http://abc.com/model.tf'
          description: 模型曲线
    MonitorTargetOperatingStatusModel:
      type: object
      properties:
        id:
          type: integer
          description: 主键
        modelId:
          type: integer
          description: 模型种类id
        monitoringTargetId:
          type: integer
          description: 监控对象id
        status:
          type: string
          example: 'init, ready, unready'
          description: 模型训练状态，init：初始状态  ready：可以使用  unready：不可使用
        parameters:
          type: string
          description: 曲线参数
        waveLength:
          type: integer
          example: 0
          description: 图形波长
        lastTrainingTime:
          type: integer
          example: 125682340000
          description: 最后一次训练时间
        lastInferenceTime:
          type: integer
          example: 12358600000
          description: 预计最后一次训练时间
        nextTrainingTime:
          type: integer
          description: 下一次训练时间
        modelPath:
          type: string
          example: 'https://abc.com/model.tf'
          description: 模型曲线
    MaintenanceStaff:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: zhangsan
          description: 姓名
        sex:
          type: string
          example: 男 或 女
          description: 性别
        supplierId:
          type: integer
          example: 1
          description: 供应商id
        age:
          type: integer
          example: 1
          description: 年龄
        telephone:
          type: string
          example: 151xxxxxxxx
          description: 电话号码
        email:
          type: string
          example: xxx@ilabservice.com
          description: 邮箱
    MaintenanceSupplier:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        name:
          type: string
          example: zhangsan
          description: 姓名
        address:
          type: string
          example: shanghai
          description: 供应商所在地
        supplierType:
          type: integer
          example: 6
          description: 1.管理平台签约供应商 2.公司签约供应商 3.零散供应商 4.政府检测机构 5.生产厂家 6.ilabservice 默认值为6
        areaExpertise:
          type: string
          example: 制冷设备，传感器
          description: 擅长领域
        score:
          type: integer
          example: 10
          description: 评分（1 - 10）
        description:
          type: string
          example: 描述
          description: 这是一个描述
        contactPerson:
          type: string
          example: zhangsan
          description: 联系人
        entryTime:
          type: integer
          example: 1234567890
          description: 入驻平台的时间
        contactPhone:
          type: string
          example: 151xxxxxxxx
          description: 联系人电话
        contactEmail:
          type: string
          example: xxx@ilabservice.com
          description: 联系人邮箱
    MaintenanceDevice:
      type: object
      properties:
        assetId:
          type: string
          example: ilab
          description: 设备编号
        clientTag:
          type: string
          example: ilab
          description: 用户编号
        name:
          type: string
          example: shanghai
          description: 设备名称
        brand:
          type: string
          example: ilab
          description: 品牌
        model:
          type: string
          example: ilab
          description: 模型
        serialNumber:
          type: string
          example: 10
          description: 设备序列号
        status:
          type: string
          example: 描述
          description: 设备状态
        category:
          type: string
          example: ilab
          description: 设备种类
        parentAsset:
          type: string
          example: ilab
          description: 设备编号
        description:
          type: string
          example: 151xxxxxxxx
          description: 备注
        location:
          type: string
          example: xxx@ilabservice.com
          description: 位置
    MaintenanceDeviceCreate:
      type: object
      properties:
        assetId:
          type: string
          example: ilab
          description: 设备编号
        clientTag:
          type: string
          example: ilab
          description: 用户编号
        name:
          type: string
          example: shanghai
          description: 设备名称
        brand:
          type: string
          example: ilab
          description: 品牌
        model:
          type: string
          example: ilab
          description: 模型
        serialNumber:
          type: string
          example: 10
          description: 设备序列号
        status:
          type: string
          example: 描述
          description: 设备状态
        category:
          type: string
          example: ilab
          description: 设备种类
        parentAsset:
          type: string
          example: ilab
          description: 设备编号
        description:
          type: string
          example: 151xxxxxxxx
          description: 备注
        locationId:
          type: integer
          example: 1
          description: 位置
        manufactureCompanyId:
          type: integer
          example: 2
          description: 操作导入的用户所在公司id
        serviceProviderId:
          type: integer
          example: 3
          description: 服务商id
        photo:
          type: string
          example: http://abc.com/photo.gif
          description: 照片
        serviceProvider:
          type: string
          example: XXX服务公司
          description: 服务商名
        campus:
          type: string
          example: XXX园区
          description: 区域
        building:
          type: string
          example: 12号楼
          description: 建筑
        floor:
          type: string
          example: 19层
          description: 楼层
        room:
          type: string
          example: 101
          description: 房间号
        location:
          type: object
          description: 地址（name用room名，必填）
          $ref: '#/components/schemas/LocationUpAndAdd'
        maintenanceSupplier:
          type: object
          description: （服务供应商，名字必填）
          $ref: '#/components/schemas/MaintenanceSupplierUpAndAdd'
        company:
          type: object
          description: 客户公司（名字必填）
          $ref: '#/components/schemas/CompanyUpAndAdd'
    LocationUpAndAdd:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: id
        name:
          type: string
          example: 405室
          description: 这里使用room的地址名
        description:
          type: string
          example: 说明
          description: location说明
        address:
          type: string
          example: 说明
          description: location说明
        timezone:
          type: string
          example: 说明
          description: location说明
        background:
          type: string
          example: https://jcrddcdiag917.blob.core.chinacloudapi.cn/company1/building/1.jpg
          description: 背景链接
        district:
          type: string
          example: 行政区
          description: 行政区
        latitude:
          type: string
          example: 31.330206
          description: 纬度
        longtitude:
          type: string
          example: 31.330206
          description: 经度
        xLocation:
          type: number
          example: 31.250522
          description: x_location
        yLocation:
          type: number
          example: 31.250522
          description: y_location
    CompanyUpAndAdd:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: id
        name:
          type: string
          example: XXX公司
          description: 公司名
        domainName:
          type: string
          example: ilabservice.com
          description: 公司域名
        address:
          type: string
          example: XX路XX号
          description: 公司地址
        email:
          type: string
          example: XX@ilabservice.com
          description: 邮箱
        telephone:
          type: string
          example: 05XX-111111
          description: 电话
        backgroundUrl:
          type: string
          example: 背景url
          description: 背景url
        logoUrl:
          type: string
          example: logo url
          description: logo url
        loginUrl:
          type: string
          example: 登录 url
          description: 登录 url
    MaintenanceSupplierUpAndAdd:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: id
        name:
          type: string
          example: XXX公司
          description: 服务商名
        supplierType:
          type: string
          example: 供应商类型(1.管理平台签约供应商 2.公司签约供应商 3.零散供应商 4.政府检测机构 5.生产厂家 6.ilabservice)
          description: 供应商类型
        address:
          type: string
          example: XX路XX号
          description: 公司地址
        areaExpertise:
          type: string
          example: 高精密仪器
          description: 擅长领域
        description:
          type: string
          example: XXX
          description: 服务商介绍
        contactPerson:
          type: string
          example: 小明
          description: 联系人
        entryTime:
          type: string
          example: 入驻时间
          description: 入驻时间
        contactPhone:
          type: string
          example: 联系人电话
          description: 联系人电话
        companyId:
          type: integer
          example: 2
          description: 公司id
        contactEmail:
          type: string
          example: 联系人邮箱
          description: 联系人邮箱


    MaintenancePlan:
      type: object
      properties:
        id:
          type: integer
          description: 主键
          example: 1
        assetId:
          type: string
          description: 设备编号
          example: ilab
        serviceType:
          type: string
          description: 服务类型
          example: 维保
        lastMaintenanaceTime:
          type: integer
          description: 上次维修时间
          example: 5240000000
        nextMaintenanceTime:
          type: integer
          description: 下次维修时间
        cycle:
          type: integer
          description: 维修周期 单位为天
          example: 30
        description:
          type: string
          description: 描述
          example: ilab
        supplier:
          type: string
          description: 供应商
          example: ilab
    MaintenancePlanList:
      type: object
      properties:
        assetId:
          type: string
          description: 设备资产编号
          example: CNTMO00000106
        deviceName:
          type: string
          description: 设备名
          example: A5
        supplierName:
          type: string
          description: 供应商
          example: ilab
        serviceType:
          type: string
          description: 服务类型
          example: 较准CAL
        cycle:
          type: integer
          description: 维护周期（月）
          example: 12
        nextServiceTime:
          type: integer
          description: 下次维修时间
        lastServiceTime:
          type: integer
          description: 完成时间
          example: 完成时间
    MaintenanceRecordPlan:
      type: object
      properties:
        assetId:
          type: string
          description: 设备资产编号
          example: CNTMO00000106
        endTime:
          type: integer
          description: 完成时间
          example: 完成时间
        code:
          type: string
          description: 报修单号
          example: CNTMO00000106-CM-20190715
        deviceName:
          type: string
          description: 设备名
          example: A5
        supplierName:
          type: string
          description: 服务商
          example: ilab
        serviceType:
          type: string
          description: 服务类型
          example: 较准CAL
        cost:
          type: integer
          description: 费用（暂无）
          example: 0
        imageUrl:
          type: string
          description: 服务报告（图片类型）
          example: "https://xx/14_maintenance_884da7a2-f41d-451a-8bb3-c95874cd6161.jpg"
        description:
          type: string
          description: 备注
    ImportMaintenanceMap:
      type: object
      properties:
        location:
          type: object
          description: 位置信息导入结果
          $ref: '#/components/schemas/ImportResult'
        supplier:
          type: object
          description: 供应商信息导入结果
          $ref: '#/components/schemas/ImportResult'
        device:
          type: object
          description: 报修设备导入结果
          $ref: '#/components/schemas/ImportResult'
        plan:
          type: object
          description: 维修计划导入结构
          $ref: '#/components/schemas/ImportResult'
    MaintenanceRecord:
      type: object
      properties:
        id:
          type: integer
          description: 主键
          example: 1
        deviceId:
          type: integer
          description: 设备id
          example: 1
        repairManId:
          type: integer
          description: 维修人员id
          example: 1
        repairManName:
          type: string
          description: 维修人员名字
          example: andy
        companyId:
          type: integer
          description: 公司 id
          example: 1
        supplierId:
          type: integer
          description: 计划维修商id
          example: 1
        requestTime:
          type: integer
          description: 请求时间
          example: 123450000
        scheduledTime:
          type: integer
          description: 预约时间
          example: 524320000
        endTime:
          type: integer
          description: 结束时间
          example: 1234567890
        faultType:
          type: string
          description: 故障类型
          example: 配件损坏
        description:
          type: string
          description: 描述
          example: 描述
        maintenanceStatus:
          type: string
          description: 已提出OPEN 已确认 ACK 维修中 SCHEDULED 维修成功 DONE 关闭 CLOSED
        files:
          type: array
          description: 维修相关文件
          items:
            $ref: '#/components/schemas/File'
    UserActionPassword:
      type: object
      properties:
        name:
          type: string
          description: 名称
          example: name
        userId:
          type: integer
          description: userId
          example: 1
        roleName:
          type: string
          description: 角色名
          example: 驻场工程师
        password:
          type: string
          description: 密码
          example: 123
    QuantityPlanInfoType:
      type: object
      properties:
        serviceType:
          type: string
          description: 服务类型
          example: name
        num:
          type: integer
          description: 数量
          example: 1
    QuantityPlanInfoStatus:
      type: object
      properties:
        onTime:
          type: integer
          description: 按时
          example: 4
        delay:
          type: integer
          description: 延时
          example: 1
    QuantityStatusData:
      type: object
      properties:
        status:
          type: string
          description: 状态
          example: 停用Disable
        num:
          type: integer
          description: 数量
          example: 1
        locationName:
          type: string
          description: 地理位置（房间）
          example: 718
    QuantitySumData:
      type: object
      properties:
        numOfSerThisMonth:
          type: integer
          description: 本月待维修设备总数
          example: 3
        deviceSum:
          type: integer
          description: 设备数量
          example: 8
        numOfPlanThisMonth:
          type: integer
          description: 本月计划服务总数
          example: 3
        numOfFinishPlanThisMonth:
          type: integer
          description: 本月已完成计划服务总数
          example: 1
        numOfFinishSerThisMonth:
          type: integer
          description: 本月已维修设备总数
          example: 1
    AmspAssetScrapped:
      type: object
      properties:
        id:
          type: integer
          description: 编号
          example: 3
        assetId:
          type: string
          description: 资产编号
          example: cba
        realAssetName:
          type: string
          description: 报废的实际资产
          example: abc
        createTime:
          type: string
          description: 时间
          example: 2019-9-21
        applicant:
          type: string
          description: 申请人
          example: 张三
        approver:
          type: string
          description: 审批人
          example: 里斯
        result:
          type: integer
          description: 结果
          example: 1
        approvalResult:
          type: integer
          description: 返回结果  0 未通过 1已通过 2其他
          example: 1
        attachment:
          type: string
          description: 上传附件
          example: url
        name:
          type: string
          description: 名称
          example: 设备名称
        serialNo:
          type: string
          description: 单号
          example: 服务单号
        clientTag:
          type: string
          description: 客户编号
          example: 客户编号
        brand:
          type: string
          description: 品牌
          example: brand
        model:
          type: string
          description: 模块
          example: 模块
    AmspCustomerInfo:
      type: object
      properties:
        id:
          type: integer
          description: 编号
          example: 3
        company:
          type: string
          description: 客户公司名
          example: cba
        name:
          type: string
          description: 客户名称
          example: abc
        phone:
          type: string
          description: 电话
          example: 12233334444
        email:
          type: string
          description: 邮箱
          example: 234@qq.com
        department:
          type: string
          description: 部门
          example: 部门
        subDepartment:
          type: string
          description: 子部门
          example: 子部门
        enabled:
          type: string
          description: Y/N
          example: Y
        remarks:
          type: string
          description: 备注
          example: 备注
    AmspCycle:
      type: object
      properties:
        id:
          type: integer
          description: 编号
          example: 3
        type:
          type: integer
          description: 周期服务类型 1周 2月 3季度 4按需
          example: 1
        content:
          type: string
          description: 内容
          example: abc
        isDelete:
          type: integer
          description: 是否删除 0未删除 1已删除
          example: 0
        group:
          type: integer
          description: 组
          example: 1
        index:
          type: integer
          description: 组内序号
          example: 1
    AmspServiceProviderExtend:
      type: object
      properties:
        id:
          type: integer
          description: 编号
          example: 1
        providerId:
          type: integer
          description: 服务商id
          example: 3
        company:
          type: string
          description: 服务商名称
          example: 服务商
        address:
          type: string
          description: 地址
          example: 地址
        category:
          type: string
          description: 类别
          example: 类别
        remark:
          type: string
          description: 备注
          example: 备注
        isDelete:
          type: integer
          description: 服务商是否删除 0未删除1已删除
          example: 0
        userId:
          type: integer
          description: 服务人员id
          example: 1
        name:
          type: string
          description: 服务人员姓名
          example: abc
        position:
          type: string
          description: 服务人员职位
          example: 工程师
        phone:
          type: string
          description: 电话
          example: 12233334444
        email:
          type: string
          description: 邮箱
          example: 242@qq.com
        enabled:
          type: string
          description: 人员是否可用
          example: Y/N
        type:
          type: string
          description: 服务人员类型
          example: 维修

    AmspCycleHistoryVo:
      type: object
      properties:
        cycleIds:
          type: array
          items:
            type: integer
          description: 编号
        files:
          type: array
          items:
            type: integer
          description: url
    AmspDataDownloadVo:
      type: object
      properties:
        amspDataNodes:
          type: object
          $ref: '#/components/schemas/AmspDataNodes'
          description: 1
        assetIds:
          type: array
          items:
            type: string
          description: url
    AmspDataNodes:
      type: object
      properties:
        key:
          type: string
          description: key
          example: key
        value:
          type: string
          description: value
          example: value
        tableName:
          type: string
          description: 所属表结构
          example: 所属表结构
        tableField:
          type: string
          description: 对应数据库字段
          example: 对应数据库字段
        descriptionField:
          type: string
          description: 对应description 字段
          example: 对应description 字段
        depth:
          type: integer
          description: depth
          example: depth
        nodes:
          type: object
          $ref: '#/components/schemas/AmspDataNodes'
          description: 子节点
          example: 子节点
    MaintenanceRecordCreate:
      type: object
      properties:
        deviceId:
          type: integer
          description: 设备id
          example: 1
        companyId:
          type: integer
          description: 公司 id
          example: 1
        requestTime:
          type: integer
          description: 请求时间
          example: 123450000
        faultType:
          type: string
          description: 故障类型
          example: 配件损坏
        description:
          type: string
          description: 描述
          example: 描述

    MaintenanceRecordUserModifyInfo:
      type: object
      properties:
        faultType:
          type: string
          description: 故障类型
          example: 配件损坏
        description:
          type: string
          description: 描述
          example: 描述

    MaintenanceRecordSupplierModifyInfo:
      type: object
      properties:
        repairManId:
          type: integer
          description: 维修人员id
          example: 1
        repairManName:
          type: string
          description: 维修人员名字
          example: andy
        supplierId:
          type: integer
          description: 计划维修商id
          example: 1
        scheduledTime:
          type: integer
          description: 预约时间
          example: 524320000
        endTime:
          type: integer
          description: 结束时间
          example: 1234567890
        faultType:
          type: string
          description: 故障类型
          example: 配件损坏
        description:
          type: string
          description: 描述
          example: 描述
        maintenanceStatus:
          type: string
          description: 已确认 ACK 维修中 SCHEDULED 维修成功 DONE

    MaintenanceRecordFull:
      type: object
      properties:
        id:
          type: integer
          description: 主键
          example: 1
        isFree:
          type: integer
          description: 本次操作是否收费 1.收费 2.免费   有免费维保次数维保不收费
          example: 1
        isUnderWarranty:
          type: integer
          description: 是否在保修期 1.是 2.否
          example: 1
        deviceId:
          type: integer
          description: 设备id
          example: 1
        repairManId:
          type: integer
          description: 维修人员id
          example: 1
        alarmPictureUrl:
          type: string
          description: 两小时内报警信息图片的url
          example: xxxxx.com
        companyId:
          type: integer
          description: 公司 id
          example: 1
        planSupplierId:
          type: integer
          description: 计划维修商id
          example: 1
        actualSupplierId:
          type: integer
          description: 实际维修商（如果是post或者put， 需要平台admin才能操作）
          example: 1
        maintenanceStaffId:
          type: integer
          description: 维修人员id
          example: 1
        startTime:
          type: integer
          description: 开始时间
          example: 1234567890
        endTime:
          type: integer
          description: 结束时间
          example: 1234567890
        faultType:
          type: string
          description: 故障类型
          example: 配件损坏
        description:
          type: string
          description: 描述
          example: 描述
        maintenanceStatus:
          type: integer
          description: 1.已提出 2.邮件已发送 3.已确认 4.维修中 5. 驳回 6.维修成功 7.维修失败 8.维修延时 9.设备报废
        price:
          type: integer
          description: 价格，实际上是一个bigdecimal，建议使用string构造器进行运算，否则会出现丢精度的问题
        paymentMethod:
          type: integer
          description: 支付方式  1.支付宝 2.微信 3.银联 4.现金
          example: 1
        paymentTime:
          type: integer
          description: 支付时间
          example: 1234567890
        reporterId:
          type: integer
          description: 报修人员id
          example: 1
    sendEmail:
      type: object
      properties:
        sub:
          type: string
          example: 主题
          description: 邮件主题
        emailContent:
          type: string
          example: '123'
          description: 邮件内容
        deviceId:
          type: integer
          example: 1
          description: 设备id
        emailFileUrl:
          type: string
          example: 'http://www.url.com'
          description: 文件路径
    DeviceContract:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 主键
        companyId:
          type: integer
          example: 1
          description: 公司id
        deviceId:
          type: integer
          example: 1
          description: 设备id
        startDate:
          type: integer
          example: 1234567890
          description: 开始时间
        endDate:
          type: integer
          example: 1234567890
          description: 合同结束时间  end_time如果为空，则为终身合同
        warrantyType:
          type: integer
          example: 1
          description: 维护类型 1.维保 2.维修 3.定期巡检 4.检测 5.其他
        description:
          type: string
          example: 描述
          description: 描述
        signDate:
          type: integer
          example: 1234567890
          description: 签订日期
    StatsHourlyUtilization:
      type: object
      properties:
        timeList:
          type: array
          items:
            type: string
          description: 日期序列 MM-dd HH
        deviceHourlyDataList:
          type: array
          items:
            type: object
            properties:
              averageUtilization:
                type: number
                description: 平均利用率
              deviceName:
                type: string
                description: 设备名称
              hourlyUtilization:
                description: 小时利用率序列
                type: array
                items:
                  type: number
        deviceTypeName:
          type: string
          description: 设备种类
    MobileDashboard:
      type: object
      properties:
        operatingDays:
          type: integer
          example: 50
          description: 设备运行天数
        deviceCount:
          type: integer
          example: 50
          description: 调用者可见设备总数
        deviceOnlineCount:
          type: integer
          example: 30
          description: 调用者可见在线设备总数
        deviceOfflineCount:
          type: integer
          example: 20
          description: 调用者可见离线设备总数
        storageSampleCount:
          type: integer
          example: 20
          description: 入库样品总数
        activeEventCount:
          type: integer
          example: 20
          description: 未处理报警
        activeRedEventCount:
          type: integer
          example: 10
          description: 未处理红色报警
        activeYellowEventCount:
          type: integer
          example: 10
          description: 未处理黄色报警
        activeMaintenanceCount:
          type: integer
          example: 20
          description: '未处理完成维修, 对应状态为 除了 已关闭 的其他'
        activeNewMaintenanceCount:
          type: integer
          example: 20
          description: '新提交维修, 对应的状态为[已提交, 已确认]'
        activeProcessingMaintenanceCount:
          type: integer
          example: 20
          description: '处理中维修, 除了[已提交, 确认, 已关闭] 的其他'
        lowInventorySampleTypeCount:
          type: integer
          example: 20
          description: 低库存样品种类数. 只有样品为公司功能才会获取
        sharedDeviceCount:
          type: integer
          example: 30
          description: '所拥有的共享设备数, 只有租赁为公司功能才获取'
        incomingLeaseRecordCount:
          type: integer
          example: 20
          description: 租赁预约数
    Cabinet:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: cabinet的id
        category_id:
          type: integer
          example: 1
          description: 种类的id
        company_id:
          type: integer
          example: 2
          description: 绑定公司的id
        name:
          type: string
          example: '521#2#易燃柜'
          description: cabinet的名称
        description:
          type: string
          example: 可存放易燃化学品
          description: 描述
        serial_number:
          type: string
          example: ecfabca16dc5
          description: 唯一标示
        brand:
          type: string
          example: Thermo Fisher
          description: 品牌
        shelveNum:
          type: integer
          example: 4
          description: 层数
    CabinetVo:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: cabinet的id
        category_id:
          type: integer
          example: 1
          description: 种类的id
        company_id:
          type: integer
          example: 2
          description: 绑定公司的id
        name:
          type: string
          example: '521#2#易燃柜'
          description: cabinet的名称
        description:
          type: string
          example: 可存放易燃化学品
          description: 描述
        serial_number:
          type: string
          example: ecfabca16dc5
          description: 唯一标示
        brand:
          type: string
          example: Thermo Fisher
          description: 品牌
        shelveNum:
          type: integer
          example: 4
          description: 层数
        ItemTypeList:
          description: 该智能柜下ItemType的列表
          type: array
          items:
            $ref: '#/components/schemas/ItemTypeVo'
    ItemType:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ItemType的id
        description:
          type: string
          example: 该类型下的样品都属于甲醇类
          description: 描述
        name_zh:
          type: string
          example: 甲醇
          description: 中文名称
        name_cn:
          type: string
          example: Methanol
          description: 英文名称
        brand:
          type: string
          example: Thermo Fisher
          description: 品牌
        chemicalStructure:
          type: string
          example: CO
          description: 化学分子式
        volumeSpec:
          type: string
          example: 4L
          description: 规格
        harardous:
          type: integer
          example: 1
          description: 1：有害；0：无害
        cat_no:
          type: string
          example: 11-22-3
          description: Cat 号
        cas_no:
          type: string
          example: 11-22-3
          description: Cas 号
        lowInventoryYellow:
          type: integer
          example: 3
          description: 黄色报警库存
        lowInventoryRed:
          type: integer
          example: 1
          description: 红色报警库存
        companyId:
          type: integer
          example: 1
          description: 公司Id
        categoryId:
          type: integer
          example: 1
          description: 种类Id
    ItemTypeVo:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ItemType的id
        description:
          type: string
          example: 该类型下的样品都属于甲醇类
          description: 描述
        name_zh:
          type: string
          example: 甲醇
          description: 中文名称
        name_cn:
          type: string
          example: Methanol
          description: 英文名称
        brand:
          type: string
          example: Thermo Fisher
          description: 品牌
        chemicalStructure:
          type: string
          example: CO
          description: 化学分子式
        volumeSpec:
          type: string
          example: 4L
          description: 规格
        harardous:
          type: integer
          example: 1
          description: 1：有害；0：无害
        cat_no:
          type: string
          example: 11-22-3
          description: Cat 号
        cas_no:
          type: string
          example: 11-22-3
          description: Cas 号
        lowInventoryYellow:
          type: integer
          example: 3
          description: 黄色报警库存
        lowInventoryRed:
          type: integer
          example: 1
          description: 红色报警库存
        companyId:
          type: integer
          example: 1
          description: 公司Id
        categoryId:
          type: integer
          example: 1
          description: 种类Id
        itemList:
          description: 该type下的化学品列表
          type: array
          items:
            $ref: '#/components/schemas/Item'
    ImportResult:
      type: object
      properties:
        total:
          type: integer
          description: 导入总数
          example: 10
        successSize:
          type: integer
          description: 导入成功总数
          example: 9
        failSize:
          type: integer
          description: 导入失败总数
          example: 1
        failDetail:
          type: array
          description: 导入失败详情
          items:
            $ref: '#/components/schemas/ImportDetail'
    ImportDetail:
      type: object
      description: 导入失败详情
      properties:
        success:
          type: boolean
          description: 是否导入成功
          example: false
        failMsg:
          type: string
          description: 导入失败原因
          example: 公司已存在
        line:
          type: integer
          description: 失败数据所在行，从0开始算
          example: 5
    Item:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: id
        itemTypeId:
          type: integer
          example: 1
          description: item_type_id的id
        statusId:
          type: integer
          example: 2
          description: 状态：0销毁，1统计，2入库，3出库
        remaingSize:
          type: integer
          example: 5
          description: 余量
        lot_no:
          type: string
          example: '1223456'
          description: Lot 号
        expirationDate:
          type: string
          example: '2019-05-11'
          description: 保质期截止日期
        receivedDate:
          type: string
          example: '2019-01-11'
          description: 购置日期
        rfid:
          type: string
          example: 2342805980
          description: rfid， 标识该样品
    WechatAccount:
      type: object
      properties:
        openid:
          type: string
          description: open ID
        nickname:
          type: string
          description: nickname
        language:
          type: string
          description: 语言
        city:
          type: string
          description: 城市
        country:
          type: string
          description: 国家
        headimgurl:
          type: string
          description: 头像 url
    CameraPicture:
      type: object
      properties:
        alarmTime:
          type: integer
          description: 时间戳
        deviceSerial:
          type: string
          description: 摄像头序列号
        alarmPicUrl:
          type: string
          description: 照片地址
        alarmVideoUrl:
          type: string
          description: 视频地址
        alarmVideoStartTime:
          type: integer
          description: 视频起始时间
        alarmVideoLength:
          type: integer
          description: 视频长度
    AuditOrder:
      type: object
      properties:
        leaseId:
          type: integer
          example: 1
          description: 租赁id
        context:
          type: string
          example: "{\"title\":\"bbb\",\"companyName\":\"aaaa\"}"
          description: 内容
        name:
          type: string
          description: 用户名称
        startTime:
          type: integer
          example: 1111111111
          description: 开始时间
        endTime:
          type: integer
          example: 11111111111
          description: 结束时间
        room:
          type: string
          example: 101
          description: 房间名称
        status:
          type: integer
          example: 1
          description: 租赁状态
        gmtCreate:
          type: integer
          example: 101111111
          description: 创建时间
    CertificateInfo:
      type: object
      properties:
        qrUrl:
          type: string
          example: https://xxxxxx.com
          description: 二维码地址
        password:
          type: string
          example: 111111#
          description: 密码
        validStartTime:
          type: integer
          example: 1567890881777
          description: 开始时间
        validEndTime:
          type: integer
          example: 274646728927
          description: 结束时间
        validStatus:
          type: integer
          example: 1
          description: 审核状态
    AuditInfo:
      type: object
      properties:
        companyName:
          type: string
          example: ilabservice
          description: 公司名称
        username:
          type: string
          example: david
          description: 用户
        userId:
          type: integer
          example: 2
          description: 用户id
        roomName:
          type: string
          example: ilab
          description: 房间名称
        startTime:
          type: integer
          example: 1111111111
          description: 开始时间
        endTime:
          type: integer
          example: 11111111111
          description: 结束时间
        status:
          type: integer
          example: 1
          description: 审核状态
    DeviceServiceRequire:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ID
        content:
          type: string
          example: 设备门松动，需要更换
          description: 服务请求内容，必传
        downtime:
          type: string
          example: "2019-8-12"
          description: 宕机时间，服务类型为“设备故障”时必传
        serviceStatus:
          type: integer
          example: 1
          description: 0：待确认，1：已确认、待实施；2：已完成
        updateTime:
          type: string
          example: "2019-8-12"
          description: 更新时间，非入参
        createTime:
          type: string
          example: "2019-8-12"
          description: 创建时间
        userId:
          type: integer
          example: 1
          description: 申请人id，非入参
        deviceId:
          type: integer
          example: 1
          description: 设备ID，必填
        serviceType:
          type: string
          example: 1
          description: 请求服务类型，必填
        assetId:
          type: string
          example: CNNJ000048
          description: 设备编号，必填
        applyName:
          type: string
          example: LiMing
          description: 申请人名称，非参数
    MaintenanceType:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ID
        name:
          type: string
          example: 设备维修
          description: 服务类型名字
        description:
          type: string
          example: 这个一个描述
          description: 描述
        createTime:
          type: string
          example: "2019-8-12"
          description: 创建时间
        companyId:
          type: integer
          example: 1
          description: 公司ID
    AssetsFolder:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ID
        name:
          type: string
          example: A-01
          description: 文件夹编号/名称
        userId:
          type: integer
          example: 1
          description: 用户ID
        createDate:
          type: string
          example: 1566379402000
          description: 创建时间戳
        updateDate:
          type: string
          example: 1566379402000
          description: 修改时间戳
        assetsFileContentsList:
          type: array
          description: 文件内容集合
          items:
            $ref: '#/components/schemas/assetsFileContentsList'
    assetsFileContentsList:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ID
        content:
          type: string
          example: Thermo冰箱说明书
          description: 文件内容
        sortNum:
          type: integer
          example: 1
          description: 文件内容序号
        folderId:
          type: integer
          example: 1
          description: 文件夹编号/名称ID
        userId:
          type: integer
          example: 1
          description: 用户ID
        createDate:
          type: string
          example: 1566803173000
          description: 文件内容创建时间
        updateDate:
          type: string
          example: 1566803173000
          description: 文件内容修改时间
    deviceMonthlyReport:
      type: object
      properties:
        deviceDataOverview:
          type: string
          example: {"totalDevice":426,"totalOffline":"15","totalEnergy":"68087.070","totalWarm":"17"}
          description: 数据总览部分
        deviceLeaseRecorde:
          type: string
          example: {"numTopTen":[{"CNJJ00128":{"Gel Image":7}},{"CNJJ00128":{"Gel Image":7}},{"CNJJ00128":{"Gel Image":7}},{"CNJJ00128":{"Gel Image":7}},{"CNJJ00128":{"Gel Image":7}}]
            ,"timeTopTen":[{"CNJJ00128":{"Gel Image":7}},{"CNJJ00128":{"Gel Image":7}},{"CNJJ00128":{"Gel Image":7}}]}
          description: 设备租赁统计
        utilizationRecorde:
          type: string
          example: ""
          description: 利用率统计
        energyRecorde:
          type: object
          example:
            - {"CNJJ00128":{"Gel Image":7}}
            - {"CNJJ01890":{"Gel Image":7}}
          description: 冰箱能耗统计
        userList:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: 用户信息
    LoopPower:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 回路ID
        loopNo:
          type: string
          example: 521-5
          description: 回路编号
        power:
          type: number
          example: 2500.23
          description: 额定功率
        threshold:
          type: number
          example: 2400.50
          description: 报警阈值
        deviceNum:
          type: integer
          example: 3
          description: 回路设备数
        currentPower:
          type: number
          example: 2200.00
          description: 回路当前功率
        maxPower:
          type: number
          example: 2300.45
          description: 回路历史最大功率
        roomName:
          type: string
          example: 521
          description: 房间编号
        roomId:
          type: integer
          example: 5
          description: 房间ID
    LoopPowerDevice:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: 设备ID
        loopId:
          type: integer
          example: 1
          description: 回路ID
        deviceNo:
          type: string
          example: CNJJ0038
          description: 设备编号
        deviceName:
          type: string
          example: xxxxxx
          description: 设备名称
        loopNo:
          type: string
          example: 521-1
          description: 回路编号
        deviceType:
          type: string
          example: 冰箱
          description: 设备类型
        currentPower:
          type: number
          example: 2356.23
          description: 当前功率
        maxPower:
          type: number
          example: 2378.36
          description: 历史最高功率
        photo:
          type: string
          example: https://xxxxx.s
          description: 设备图片链接
    LoopPowerDeviceMap:
      type: object
      properties:
        loopId:
          type: integer
          example: 1
          description: 回路ID
        deviceId:
          type: integer
          example: 1
          description: 设备id
        LoopDeviceDownLoad:
          type: array
          description: 设备下载信息
          items:
            $ref: '#/components/schemas/LoopDeviceDownLoad'
    LoopDeviceDownLoad:
      type: object
      properties:
        deviceName:
          type: string
          example: xxxx
          description: 设备名称
        currentPower:
          type: number
          example: 2368.23
          description: 设备当前功率
        maxPower:
          type: number
          example: 2456.23
          description: 设备最大功率
    PouStock:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: ID
        goodsNum:
          type: string
          example: CORN431080
          description: 标准货号
        productName:
          type: string
          example: xxxx
          description: 产品名称
        brand:
          type: string
          example: Corning
          description: 品牌
        unit:
          type: string
          example: 包
          description: 计量单位
        storehouse:
          type: string
          example: xxxx
          description: 库位
        productNum:
          type: string
          example: C00001
          description: 产品编号
        type:
          type: string
          example: POU 生物耗材
          description: 分类
    PouService:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: pou服务ID
        content:
          type: string
          example: xxx
          description: 提交服务内容
        status:
          type: string
          example: 3
          description: 服务状态
        createDate:
          type: string
          example: 1566803173000
          description: 服务创建时间
        applyName:
          type: string
          example: xxx
          description: 服务申请人

    CameraConfigVO:
      type: object
      properties:
        ip:
          type: string
        password:
          type: string
        port:
          type: integer
          format: int32
        protocol:
          type: string
        terminalSN:
          type: string
        username:
          type: string
    VideoRecord:
      type: object
      properties:
        endTime:
          type: integer
          format: int64
        image:
          type: string
          example: "https://storage.azure.cn/ilabservice/camera/CN2349829/111.jpg"
        length:
          type: integer
          format: int32
          example: 60
        startTime:
          type: integer
          format: int64
          example: 15678900000
        video:
          type: string
          example: "https://storage.azure.cn/ilabservice/camera/CN2349829/111.mp4"
    camera:
      type: object
      properties:
        accountId:
          type: integer
          format: int32
        brand:
          type: string
        companyId:
          type: integer
          format: int32
        companyName:
          type: string
          example: 衢州
        locationName:
          type: string
          example: 清洁间
        description:
          type: string
        fullTimeRecording:
          type: integer
          format: int32
        id:
          type: integer
          format: int32
        locationId:
          type: string
        model:
          type: string
        motionDetection:
          type: boolean
          example: false
        name:
          type: string
        networkConfig:
          type: string
        serialNumber:
          type: string
        status:
          type: integer
          format: int32
        streamingUrl:
          type: string
        terminalSn:
          type: string
        videoConfig:
          $ref: "#/components/schemas/CameraConfigVO"
    account:
      type: object
      properties:
        customerCompanyId:
          type: integer
          format: int32
          example: 1
        id:
          type: integer
          format: int32
          example: 1
        maxFullTimeRecording:
          type: integer
          format: int32
          example: 5
        maxRealTimeRecording:
          type: integer
          format: int32
          example: 5
        name:
          type: string
          example: "柯城区"
        parentId:
          type: integer
          format: int32
          example: 3
    AccountCameraCounts:
      type: object
      properties:
        accountCount:
          type: integer
          format: int32
        cameraCount:
          type: integer
          format: int32
    CameraSimpleVO:
      type: object
      properties:
        account:
          type: string
          example: "柯城区"
        companyId:
          type: integer
          format: int32
          example: 1
        companyName:
          type: string
          example: 衢州
        locationName:
          type: string
          example: 清洁间
        id:
          type: integer
          format: int32
          example: 1
        model:
          type: string
          example: "C202"
        motionDetection:
          type: boolean
        name:
          type: string
          example: sink
        serialNumber:
          type: string
          example: CN239482
    CommonResult_List_string_:
      type: object
      properties:
        code:
          type: string
        data:
          type: array
          items:
            type: string
        message:
          type: string
        success:
          type: boolean
    CommonResult_string_:
      type: object
      properties:
        code:
          type: string
        data:
          type: string
        message:
          type: string
        success:
          type: boolean
    CommonResult_camera_:
      type: object
      properties:
        code:
          type: string
        data:
          $ref: "#/components/schemas/camera"
        message:
          type: string
        success:
          type: boolean
    CommonResult_List_VideoRecord_:
      type: object
      properties:
        code:
          type: string
        data:
          type: array
          items:
            $ref: "#/components/schemas/VideoRecord"
        message:
          type: string
        success:
          type: boolean
    CommonResult_boolean_:
      type: object
      properties:
        code:
          type: string
        data:
          type: boolean
        message:
          type: string
        success:
          type: boolean
    CommonResult_account_:
      type: object
      properties:
        code:
          type: string
        data:
          $ref: "#/components/schemas/account"
        message:
          type: string
        success:
          type: boolean
    CommonPageResult_List_CameraSimpleVO_:
      type: object
      properties:
        code:
          type: string
        data:
          type: array
          items:
            $ref: "#/components/schemas/CameraSimpleVO"
        message:
          type: string
        pageNum:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        success:
          type: boolean
        totalCount:
          type: integer
          format: int32
    CommonPageResult_List_account_:
      type: object
      properties:
        code:
          type: string
        data:
          type: array
          items:
            $ref: "#/components/schemas/account"
        message:
          type: string
        pageNum:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        success:
          type: boolean
        totalCount:
          type: integer
          format: int32
    CommonResult_AccountCameraCounts_:
      type: object
      properties:
        code:
          type: string
        data:
          $ref: "#/components/schemas/AccountCameraCounts"
        message:
          type: string
        success:
          type: boolean

  requestBodies:
    account:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/account"
      description: account
      required: true
    camera:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/camera"
      description: camera
      required: true
    CameraConfigVO:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CameraConfigVO"
      description: camInputConfig
      required: true
