pushList

  1. int pushList(const PushListReq &req)

功能: 在list头部或者尾部插入数据,支持批量操作

参数:

  1. struct PushListReq
  2. {
  3. 1 require string moduleName; //模块名
  4. 2 require string mainKey; //主键
  5. 3 require vector<InsertKeyValue> data; //待插入数据
  6. 4 require bool atHead = true; //true表示插入到list头部,false表示插入尾部
  7. };
  8. struct InsertKeyValue
  9. {
  10. 1 require string mainKey; //主键
  11. 2 require map<string, UpdateValue> mpValue; //其他字段数据
  12. 3 require byte ver = 0; //数据版本号
  13. 4 require bool dirty = true; //是否设置为脏数据
  14. 5 require bool replace = false; //如果记录已存在且replace为true时则覆盖旧记录
  15. 6 require int expireTimeSecond = 0; //过期时间,0表示永不过期
  16. };

返回值

返回值 含义
ET_MODULE_NAME_INVALID 模块名错误
ET_KEY_AREA_ERR 当前key不属于本机服务,需要更新路由表重新访问
ET_FORBID_OPT 正在迁移,禁止操作
ET_SERVER_TYPE_ERR SLAVE状态下不提供接口服务
ET_PARAM_DIGITAL_ERR 字段错误,例如值为数字类型的字段包含了非数字字符
ET_PARAM_TOO_LONG 字段大小超过限制
ET_PARAM_OP_ERR op错误,只支持SET
ET_PARAM_NOT_EXIST 字段不存在
ET_KEY_INVALID mainKey无效
ET_INPUT_PARAM_ERROR mainKey为空
ET_SYS_ERR 系统异常
ET_SUCC 成功写入数据