From 7d1ecd780c8b14d8f648020f93d640926d8c1b67 Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 29 Aug 2019 17:14:15 +0800 Subject: [PATCH] fix fwd job --- msg.go | 2 +- sql.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/msg.go b/msg.go index 1986397..f963492 100644 --- a/msg.go +++ b/msg.go @@ -26,7 +26,7 @@ func getMsgParsingRule(m *ChatWarsMessage) (*MessageParsingRule, error) { func parseSubTypeMessageGDepositAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageGDepositAck, error) { cwm := ChatWarsMessageGDepositAck{} - cwm.Item, _ = getObjItemID(``, r.ReplaceAllString(m.Text, "${Used}")) + cwm.ItemID64 = getObjItemID(``, r.ReplaceAllString(m.Text, "${Used}")) cwm.Quantity, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${Quantity}"), 10, 64) cwm.Msg = m diff --git a/sql.go b/sql.go index 9117587..741e4b4 100644 --- a/sql.go +++ b/sql.go @@ -384,6 +384,18 @@ func initDB() { failOnError(err, "initDB : create table obj_job") log.Println("initDB : obj_job created ...") + _, err = db.Exec(`CREATE VIEW obj_job_v AS + SELECT oj.obj_id + ,cost.intl_id COLLATE utf8mb4_unicode_ci AS job_type_intl_id + ,oj.payload COLLATE utf8mb4_unicode_ci AS payload + FROM obj_job oj + ,obj o + ,code_obj_sub_type cost + WHERE o.id = oj.obj_id + AND cost.id = o.obj_sub_type_id;`) + failOnError(err, "initDB : create view obj_job_v") + log.Println("initDB : obj_job_v created ...") + _, err = db.Exec(`CREATE TABLE obj_name ( obj_id BIGINT UNSIGNED NOT NULL ,name VARCHAR(80)