@kalengo/tagging
v0.0.11
Published
kalengo intelligent tagging system
Downloads
17
Readme
Kalengo Intelligent Tagging System
usecase
引入标签系统SDK
const KITS = require('@kalengo/tagging')
const kits = new KITS({serverUrl: 'http://localhost:3000'})
1. 登录
await kits.login('navy', '123456')
2. 打标签
await kits.setTag('id1', '高还款意愿')
3. 查询实体标签
await kits.getTag('id1)
## API
- 登录 await kits.login('username', 'password')
- 给某个实体打标签 await kits.setTag('entityId', '高还款意愿')
- 给某个实体批量打标签 await kits.setTags('entityId', ['高还款意愿', '信誉优'])
- 根据实体Id查询标签 await kits.getTag('entityId')
- 根据实体Id删除某个标签 await kits.deleteTag('entityId', '高还款意愿')
- 查询热门标签 await kits.getHotTagByNamespace()
- 标签搜索 await kit.searchTagByNamespace('tagName')
- 设置实体命名空间 await kit.setEntityNameSpace('tagging.kalengo.com/risk')
- 获取当前实体命名空间 await kit.getEntityNameSpace('tagging.kalengo.com/risk')
- 设置实体类型命名空间 await kit.setEntityTypeNameSpace('tagging.kalengo.com/borrower')
- 获取当前实体类型命名空间 await kit.getEntityTypeNameSpace('tagging.kalengo.com/borrower')
- 获取实体命名空间下的列表 await kit.getEntityNameSpaceList('tagging.kalengo.com')
- 获取实体类型命名空间下的列表 await kit.getEntityTypeNameSpaceList('tagging.kalengo.com/personal')
- 获取某个实体已打标签和热门标签 await kit.getTagAndHotTag({entityId: '5ea560a32996b65f5c54a404',entityNsName: 'aicashnow.com/salary',entityTypeNsName: 'aicashnow.com/borrower',rankNo: 10})
- 给某个实体打标签(带命名空间) await kit.setTagsByNameSpace({'5ea560a32996b65f5c54a404', [{entityNsName: 'aicashnow.com/salary',entityTypeNsName: 'aicashnow.com/borrower'}]})
- 通过标签Id删除标签 await kit.deleteTagById({'5ea560a32996b65f5c54a404'})
- restful api 查询标签 await kit.getTagByRestful({"entityId":{"$in":["001","002"]}})
- restful api 查询标签统计 await kit.getTagStatisticsByRestful({"limit":0})
- restful api 查询命名空间标签统计 await kit.getNameSpaceTagStatisticsByRestful({"limit":0})
- restful api 查询命名空间统计 await kit.getNameSpaceByRestful({"limit":0})