fix fwd job

This commit is contained in:
shoopea 2019-08-29 17:14:15 +08:00
parent 5102375a0e
commit 7d1ecd780c
2 changed files with 13 additions and 1 deletions

2
msg.go
View File

@ -26,7 +26,7 @@ func getMsgParsingRule(m *ChatWarsMessage) (*MessageParsingRule, error) {
func parseSubTypeMessageGDepositAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageGDepositAck, error) { func parseSubTypeMessageGDepositAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageGDepositAck, error) {
cwm := ChatWarsMessageGDepositAck{} 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.Quantity, _ = strconv.ParseInt(r.ReplaceAllString(m.Text, "${Quantity}"), 10, 64)
cwm.Msg = m cwm.Msg = m

12
sql.go
View File

@ -384,6 +384,18 @@ func initDB() {
failOnError(err, "initDB : create table obj_job") failOnError(err, "initDB : create table obj_job")
log.Println("initDB : obj_job created ...") 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 ( _, err = db.Exec(`CREATE TABLE obj_name (
obj_id BIGINT UNSIGNED NOT NULL obj_id BIGINT UNSIGNED NOT NULL
,name VARCHAR(80) ,name VARCHAR(80)