2-10 客户事件
2.10 客户事件(标准外部事件)
Topic(租户级):{tenant}/proj_{projectId}/v1-business-model-customer
Topic(租户级):{tenant}/proj_{projectId}/v1-business-model-error-customer
error标识此topic是外部业务模型事件的错误响应消息
2.10.1 客户增删改事件(s0140001)
事件定义
事件名称 | 事件类型 | 事件描述 |
---|---|---|
add | 通知型 | 客户新增事件 |
edit | 通知型 | 客户更新事件 |
delete | 通知型 | 客户删除事件 |
客户新增事件
{
"reportTs": 1661154622,
"profile": {
"poiCode": "s0140001",
"appType": "customer",
"modelId": 140001
},
"events": {
"add": {
"eventTs": 148813512323,
"eventType": 1,
"customerList"[{
"id":"来源方主键id"//对应通行证的全局唯一UserId
"projectId": "项目id",
"name": "姓名",
"phone": "10086",
"idType": 0,
"idNumber": "证件号码",
"sex": 0,
"age": "年龄",
"spaceIds": [],
"customerGradeId": null,
"customerTypeId": null,
"contractName": "紧急联系人",
"contractPhone": "紧急联系人电话",
"address": "地址",
"email": "邮箱",
"remark": "备注",
"bornDate": null,
"nativePlace": "籍贯",
"nation": "名族",
"marriage": 0,
"education": 0,
"profession": "职业",
"speciality": "特长",
"interest": "兴趣爱好",
"character": "性格",
"postalCode": "邮政编码",
"companyIds": [
"1117745722292428800"
],
"jobNum": "员工工号",
"facePhoto": "人脸识别"
}]
}
}
}
客户新增错误告警事件
{
"msgId":"hfjld729jc927894n02783n49"//建议uuid确定消息唯一性
"reportTs": 1661154622,
"profile": {
"poiCode": "s0120001",
"appType": "customer",
"modelId": 120001
},
"events": {
"add_error": {
"eventTs": 148813512323,
"eventType": 2, //2标识这是错误告警
"msg":"添加客户失败", //公共参数,数据类型:string;与api公共参数一致
"status":"CUSTOMER_ADD_ERROR",//错误码,数据类型:string;与api公共参数一致
"code":400,//错误码,默认400,数据类型:int;与api公共参数一致
"customerList"[{
"id":"来源方主键id"//对应通行证的全局唯一UserId
"projectId": "项目id",
"name": "姓名",
"phone": "10086",
"idType": 0,
"idNumber": "证件号码",
"sex": 0,
"age": "年龄",
"spaceIds": [],
"customerGradeId": null,
"customerTypeId": null,
"contractName": "紧急联系人",
"contractPhone": "紧急联系人电话",
"address": "地址",
"email": "邮箱",
"remark": "备注",
"bornDate": null,
"nativePlace": "籍贯",
"nation": "名族",
"marriage": 0,
"education": 0,
"profession": "职业",
"speciality": "特长",
"interest": "兴趣爱好",
"character": "性格",
"postalCode": "邮政编码",
"companyIds": [
"1117745722292428800"
],
"jobNum": "员工工号",
"facePhoto": "人脸识别"
}]
}
}
}
字段定义
字段名称 | 字段类型 | 字段描述 | 是否必传 | 长度 |
---|---|---|---|---|
eventType | int | 事件类型,此处默认1 | 是 | |
eventTs | long | 事件时间 | 是 | 13 |
id | string | 来源方主键id | 是 | 36 |
projectId | long | 项目id | 是 | 36 |
name | string | 姓名 | 是 | 20 |
phone | string | 电话 | 是 | 15 |
idType | int | 证件类型,0:代表空,1:身份证,2:护照,3:港澳通行证,4:其他 | 否 | 11 |
idNumber | string | 证件号码 | 否 | 45 |
sex | int | 性别,0:代表未填,1:男,2:女 | 否 | 2 |
age | int | 年龄 | 否 | 10 |
spaceIds | string[] | 所属空间 | 否 | |
customerGradeId | long | 客户级别 | 否 | 36 |
customerTypeId | long | 客户类型 | 否 | 36 |
contractName | string | 紧急联系人 | 否 | 50 |
contractPhone | string | 紧急联系人电话 | 否 | 15 |
address | string | 地址 | 否 | 50 |
email | string | 邮箱 | 否 | 50 |
remark | string | 备注 | 否 | 100 |
bornDate | long | 出生年月 | 否 | 36 |
nativePlace | string | 籍贯 | 否 | 20 |
nation | string | 名族 | 否 | 20 |
marriage | int | 婚姻,0:代表未填空,1:未婚,2:已婚,3:离婚,4:丧偶 | 否 | 2 |
education | int | 学历,0:代表未填空,1:小学,2:初中,3:中专/高中,4:专科,5:本科,6:硕士,7:博士 | 否 | 2 |
profession | string | 职业 | 否 | 20 |
speciality | string |