bag.lua 736 B

123456789101112131415161718192021222324252627
  1. local root = class("moduleBag", require("base.baseModule"))
  2. function root:ctor(uid)
  3. root.super.ctor(self, uid, "bag", "uid", true)
  4. self.uid = uid
  5. end
  6. function root:mysql_get_init_columns()
  7. return {
  8. uid = "int(11) unsigned NOT NULL",
  9. itemList = "JSON COMMENT '道具信息'",
  10. lastBid = "int(11) DEFAULT 0 COMMENT '最后使用的bid'",
  11. lastInitTime = "int(11) DEFAULT 0 COMMENT '最后初始化背包的时间戳'"
  12. }
  13. end
  14. ----------------------------------------
  15. -- 接口
  16. ----------------------------------------
  17. -- 请求获取背包信息
  18. function root:itf_get_info(role, msg)
  19. local items = self:redis_get_key_info("itemList")
  20. return code.OK, {items = items}
  21. end
  22. return root