safety-eval-service/docs/openapi/人员信息-人脸接口.openapi.yaml

213 lines
7.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

openapi: 3.0.3
info:
title: 人员信息-人脸接口 API
description: |
基于 `OrgPersonnel` 的人脸相关接口,包含:
- **更新人员原始人像地址**:保存人脸比对基准图 URL。
- **人脸比对**:传入待比对图片 base64服务端从人员「原始人像地址」下载并转 base64再调用底层人脸比对能力返回相似度。
## 接口一览
| 接口 | 说明 |
|------|------|
| `POST /safetyEval/org-personnel/update-origin-face` | 更新人员原始人像地址(基准图) |
| `POST /safetyEval/org-personnel/compare-face` | 人脸比对,传入图片 base64 与原始人像比对,返回相似度 |
## 错误码
| 错误码 | 说明 |
|--------|------|
| 01-05-004 | 原始人像地址为空(比对时人员未设置 originFaceUrl |
| 01-05-005 | 待比对图片 base64 为空 |
| 01-05-006 | 人脸比对失败(底层调用异常) |
**Apifox 导入**:项目设置 → 导入数据 → OpenAPI → 选择本文件。
统一前缀:`/safetyEval/org-personnel`
成功:`success=true` 且 `code="0"`
version: 1.0.0
contact:
name: safety-eval-service
servers:
- url: http://localhost:8095
description: 本地开发
- url: http://192.168.20.100:30140
description: 测试网关100
tags:
- name: 人员信息-人脸接口
description: 原始人像地址维护与人脸比对
paths:
/safetyEval/org-personnel/update-origin-face:
post:
tags: [人员信息-人脸接口]
summary: 更新人员原始人像地址
description: |
保存人员的「原始人像地址originFaceUrl作为后续人脸比对的基准图。
仅更新该字段,不影响其他人员信息。
operationId: orgPersonnelUpdateOriginFace
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrgPersonnelUpdateOriginFaceCmd'
example:
id: 10001
originFaceUrl: "https://oss.example.com/face/10001.jpg"
responses:
'200':
description: 成功(返回更新后的人员信息)
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseOrgPersonnelCO'
example:
success: true
code: "0"
message: "success"
errMessage: null
data:
id: 10001
userName: "张三"
originFaceUrl: "https://oss.example.com/face/10001.jpg"
/safetyEval/org-personnel/compare-face:
post:
tags: [人员信息-人脸接口]
summary: 人脸比对
description: |
传入待比对图片 base64imageBase64与人员 IDpersonnelId
服务端从人员「原始人像地址originFaceUrl」下载并转为 base64
再调用底层人脸比对能力返回两张人脸的相似度0~1越大越相似
operationId: orgPersonnelCompareFace
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrgPersonnelCompareFaceCmd'
example:
personnelId: 10001
imageBase64: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAABAAEBAREA/8QAFAABAAAAAAAAAAAAAAAAAAAAA//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAD8AfwD/2Q=="
responses:
'200':
description: 成功返回相似度0~1
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseBigDecimal'
example:
success: true
code: "0"
message: "success"
errMessage: null
data: 0.92
components:
schemas:
SingleResponseBase:
type: object
properties:
success: { type: boolean, example: true }
code: { type: string, example: "0" }
message: { type: string }
errMessage: { type: string }
OrgPersonnelUpdateOriginFaceCmd:
type: object
required: [id]
properties:
id:
type: integer
format: int64
description: 人员ID
example: 10001
originFaceUrl:
type: string
description: 原始人像地址(人脸比对基准图)
example: "https://oss.example.com/face/10001.jpg"
OrgPersonnelCompareFaceCmd:
type: object
required: [personnelId, imageBase64]
properties:
personnelId:
type: integer
format: int64
description: 人员ID
example: 10001
imageBase64:
type: string
description: 待比对人脸图片 base64
example: "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
OrgPersonnelCO:
type: object
properties:
id: { type: integer, format: int64 }
deptId: { type: integer, format: int64 }
postId: { type: integer, format: int64 }
userName: { type: string }
account: { type: string }
genderCode: { type: integer, format: int32 }
genderName: { type: string }
birthDate: { type: string, format: date }
joinWorkDate: { type: string, format: date }
idCardNo: { type: string }
currentAddress: { type: string }
officeAddress: { type: string }
educationCode: { type: string }
educationName: { type: string }
graduateSchool: { type: string }
major: { type: string }
basicDisciplineMajorId: { type: integer, format: int64 }
employmentStatusCode: { type: integer, format: int32 }
employmentStatusName: { type: string }
personTypeCode: { type: string }
personTypeName: { type: string }
qualScope: { type: string }
professionalLevelCode: { type: string }
professionalLevelName: { type: string }
evaluatorCertNo: { type: string }
educationTypeCode: { type: string }
educationTypeName: { type: string }
educationLevelCode: { type: string }
educationLevelName: { type: string }
titleCode: { type: string }
registerEngineerFlag: { type: integer, format: int32 }
publications: { type: string }
abilityDeclaration: { type: string }
workExperience: { type: string }
proofMaterialUrl: { type: string }
originFaceUrl: { type: string, description: 原始人像地址(人脸比对基准图) }
technicalDirectorFlag: { type: boolean }
processControlLeaderFlag: { type: boolean }
deptName: { type: string }
postName: { type: string }
certNames: { type: string }
changeCount: { type: integer, format: int32 }
resignApplyId: { type: integer, format: int64 }
resignAuditStatus: { type: integer, format: int32 }
tenantId: { type: integer, format: int64 }
SingleResponseOrgPersonnelCO:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data:
$ref: '#/components/schemas/OrgPersonnelCO'
SingleResponseBigDecimal:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data:
type: number
format: double
description: 人脸相似度0~1越大越相似
example: 0.92