This commit is contained in:
shoopea 2019-05-10 19:33:29 +08:00
parent 805feca791
commit 239c45db8a
2 changed files with 35 additions and 0 deletions

4
def.go
View File

@ -66,6 +66,9 @@ type JobPayloadRescanMsg struct {
MsgID64 int64 `json:"msg_id"`
}
type JobPayloadRescanAllMsg struct {
}
const (
objTypeUser = 1
objTypeGuild = 2
@ -100,6 +103,7 @@ const (
objSubTypeJobWithdrawal = 604
objSubTypeJobGStock = 605
objSubTypeJobRescanMsg = 606
objSubTypeJobRescanAllMsg = 607
objSubTypeItemResource = 701
objSubTypeItemAlch = 702
objSubTypeItemMisc = 703

31
sql.go
View File

@ -1324,6 +1324,37 @@ func insertMsgAuctionAnnounce(m *ChatWarsMessageAuctionAnnounce) error {
return nil
}
func createJob(job_type_id int32, payload []byte) error {
/*
res, err := db.Exec(`INSERT INTO obj (obj_type_id, obj_sub_type_id)
VALUES (` + strconv.Itoa(objTypeMessage) + `,` + strconv.Itoa(objSubTypeMessageUnknown) + `);`)
if err != nil {
return 0, err
}
objId, err := res.LastInsertId()
if err != nil {
return 0, err
}
stmt, err := db.Prepare(`INSERT INTO obj_msg (obj_id, msg_id, chat_id, user_id, sender_user_id, date, text)
VALUES (?, ?, ?, ?, ?, ?, ?);`)
if err != nil {
return 0, err
}
defer stmt.Close()
_, err = stmt.Exec(objId, m.ID64, m.ChatID64, m.UserID64, m.SenderUserID64, m.Date, m.Text)
if err != nil {
return 0, err
}
return objId, nil
*/
return nil
}
func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) {
var (
id int32