Commit eb4b015247152707d97420abbc2973538e4948ea
1 parent
94edf97b
邮件增加 stitle
Showing
5 changed files
with
17 additions
and
5 deletions
Show diff stats
src/actions/EmailAction.lua
@@ -49,6 +49,7 @@ function _M.listRpc(agent, data) | @@ -49,6 +49,7 @@ function _M.listRpc(agent, data) | ||
49 | emailId = 0, | 49 | emailId = 0, |
50 | createtime = time, | 50 | createtime = time, |
51 | title = email.title, | 51 | title = email.title, |
52 | + stitle = email.stitle, | ||
52 | content = email.content, | 53 | content = email.content, |
53 | attachments = email.attachments | 54 | attachments = email.attachments |
54 | }) | 55 | }) |
src/models/Email.lua
@@ -9,6 +9,7 @@ Email.schema = { | @@ -9,6 +9,7 @@ Email.schema = { | ||
9 | id = {"number", 0}, -- 数据库ID | 9 | id = {"number", 0}, -- 数据库ID |
10 | emailId = {"number", 0}, -- 邮件csv ID | 10 | emailId = {"number", 0}, -- 邮件csv ID |
11 | title = {"string", ""}, -- 邮件标题 | 11 | title = {"string", ""}, -- 邮件标题 |
12 | + stitle = {"string", ""}, -- 小标题 | ||
12 | content = {"string", ""}, -- 邮件正文 | 13 | content = {"string", ""}, -- 邮件正文 |
13 | attachments = {"string", ""}, | 14 | attachments = {"string", ""}, |
14 | status = {"number", 0}, -- 邮件状态: 未读, 已读, 已领取 | 15 | status = {"number", 0}, -- 邮件状态: 未读, 已读, 已领取 |
@@ -20,6 +21,7 @@ Email.schema = { | @@ -20,6 +21,7 @@ Email.schema = { | ||
20 | function Email:data() | 21 | function Email:data() |
21 | local emailId = self:getProperty("emailId") | 22 | local emailId = self:getProperty("emailId") |
22 | local title = self:getProperty("title") | 23 | local title = self:getProperty("title") |
24 | + local stitle = self:getProperty("stitle") | ||
23 | local content = self:getProperty("content") | 25 | local content = self:getProperty("content") |
24 | local attachments = self:getProperty("attachments") | 26 | local attachments = self:getProperty("attachments") |
25 | local contentPms = self:getProperty("contentPms") | 27 | local contentPms = self:getProperty("contentPms") |
@@ -37,6 +39,10 @@ function Email:data() | @@ -37,6 +39,10 @@ function Email:data() | ||
37 | if title == "" and emailData.title ~= "" then | 39 | if title == "" and emailData.title ~= "" then |
38 | title = emailData.title | 40 | title = emailData.title |
39 | end | 41 | end |
42 | + | ||
43 | + if stitle == "" and emailData.subtitle ~= "" then | ||
44 | + stitle = emailData.subtitle | ||
45 | + end | ||
40 | 46 | ||
41 | if attachments == "" and emailData.attachment ~= "" then | 47 | if attachments == "" and emailData.attachment ~= "" then |
42 | attachments = emailData.attachment:format(table.unpack(rewardPms)) | 48 | attachments = emailData.attachment:format(table.unpack(rewardPms)) |
@@ -48,6 +54,7 @@ function Email:data() | @@ -48,6 +54,7 @@ function Email:data() | ||
48 | status = self:getProperty("status"), | 54 | status = self:getProperty("status"), |
49 | createtime = self:getProperty("createtime"), | 55 | createtime = self:getProperty("createtime"), |
50 | title = title, | 56 | title = title, |
57 | + stitle = stitle, | ||
51 | content = content, | 58 | content = content, |
52 | attachments = attachments, | 59 | attachments = attachments, |
53 | } | 60 | } |
src/rdsscripts/insertEmail.lua
@@ -5,8 +5,9 @@ local createTime = KEYS[4] | @@ -5,8 +5,9 @@ local createTime = KEYS[4] | ||
5 | local con = KEYS[5] or cmsgpack.pack({}) | 5 | local con = KEYS[5] or cmsgpack.pack({}) |
6 | local att = KEYS[6] or cmsgpack.pack({}) | 6 | local att = KEYS[6] or cmsgpack.pack({}) |
7 | local title = KEYS[7] or "" | 7 | local title = KEYS[7] or "" |
8 | -local content = KEYS[8] or "" | ||
9 | -local attachments = KEYS[9] or "" | 8 | +local stitle = KEYS[8] or "" |
9 | +local content = KEYS[9] or "" | ||
10 | +local attachments = KEYS[10] or "" | ||
10 | 11 | ||
11 | 12 | ||
12 | -- local roleInfo = redis.call("HGET", string.format("role:%d", roleId), "delete") | 13 | -- local roleInfo = redis.call("HGET", string.format("role:%d", roleId), "delete") |
@@ -29,6 +30,7 @@ redis.call("HMSET", string.format("email:%d:%d", roleId, id), | @@ -29,6 +30,7 @@ redis.call("HMSET", string.format("email:%d:%d", roleId, id), | ||
29 | "contentPms", con, | 30 | "contentPms", con, |
30 | "rewardPms", att, | 31 | "rewardPms", att, |
31 | "title", title, | 32 | "title", title, |
33 | + "stitle", stitle, | ||
32 | "content", content, | 34 | "content", content, |
33 | "attachments", attachments | 35 | "attachments", attachments |
34 | ) | 36 | ) |
src/services/globald.lua
@@ -63,6 +63,7 @@ local function mailQuene() | @@ -63,6 +63,7 @@ local function mailQuene() | ||
63 | "id", gid, | 63 | "id", gid, |
64 | "createtime", email.endTime, | 64 | "createtime", email.endTime, |
65 | "title", email.title, | 65 | "title", email.title, |
66 | + "stitle", email.stitle, | ||
66 | "content", email.content, | 67 | "content", email.content, |
67 | "attachments", email.attachments, | 68 | "attachments", email.attachments, |
68 | "endtime", email.endTime, | 69 | "endtime", email.endTime, |
@@ -73,7 +74,7 @@ local function mailQuene() | @@ -73,7 +74,7 @@ local function mailQuene() | ||
73 | redisproxy:hmset(string_format("globalEmail:%s", gid), | 74 | redisproxy:hmset(string_format("globalEmail:%s", gid), |
74 | "id", gid, | 75 | "id", gid, |
75 | "createtime", email.endTime, | 76 | "createtime", email.endTime, |
76 | - "title", email.title, | 77 | + "stitle", email.stitle, |
77 | "content", email.content, | 78 | "content", email.content, |
78 | "attachments", email.attachments, | 79 | "attachments", email.attachments, |
79 | "endtime", email.endTime, | 80 | "endtime", email.endTime, |
src/shared/redisproxy.lua
@@ -54,12 +54,13 @@ function redisproxy:insertEmail(params) | @@ -54,12 +54,13 @@ function redisproxy:insertEmail(params) | ||
54 | con = params.con or {}, | 54 | con = params.con or {}, |
55 | att = params.att or {}, | 55 | att = params.att or {}, |
56 | title = params.title or "", | 56 | title = params.title or "", |
57 | + stitle = params.stitle or "", | ||
57 | content = params.content or "", | 58 | content = params.content or "", |
58 | attachments = params.attachments or "", | 59 | attachments = params.attachments or "", |
59 | } | 60 | } |
60 | - self:runScripts("insertEmail", 9, EMAIL_LIMIT, | 61 | + self:runScripts("insertEmail", 10, EMAIL_LIMIT, |
61 | pms.roleId, pms.emailId, pms.createtime, | 62 | pms.roleId, pms.emailId, pms.createtime, |
62 | - MsgPack.pack(pms.con), MsgPack.pack(pms.att), pms.title, pms.content, pms.attachments) | 63 | + MsgPack.pack(pms.con), MsgPack.pack(pms.att), pms.title, pms.stitle, pms.content, pms.attachments) |
63 | return true | 64 | return true |
64 | end | 65 | end |
65 | 66 |