mail.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Descripttion:邮件
  3. version:
  4. Author: Neo,Huang
  5. Date: 2022-08-17 16:04:20
  6. LastEditors: Neo,Huang
  7. LastEditTime: 2022-08-20 09:42:54
  8. --]]
  9. local code = require "code"
  10. local util_mail = require("utils.util_mail")
  11. local userData = require("data.user")
  12. local root = {}
  13. -- 获取邮件信息列表
  14. function root.mail_get_info(role, msg)
  15. return role.pmail:itf_get_info(msg)
  16. end
  17. -- 读取邮件
  18. function root.mail_read(role, msg)
  19. return role.pmail:itf_read(msg)
  20. end
  21. -- 删除邮件
  22. function root.mail_del(role, msg)
  23. return role.pmail:itf_del(msg)
  24. end
  25. -- 获取邮件奖励
  26. function root.mail_get_award(role, msg)
  27. return role.pmail:itf_get_award(msg)
  28. end
  29. -- 新邮件通知
  30. function root.add_new_mail(role, msg)
  31. local uid = role.uid
  32. local id = msg.id
  33. local channel = msg.channel
  34. if id == nil then
  35. return code.PARAMTER_ERROR
  36. end
  37. if channel == nil or userData:user_is_match_channel(uid, channel) then
  38. -- 玩家新增邮件
  39. util_mail:on_new_mail(uid, id)
  40. end
  41. return code.OK
  42. end
  43. return root