fix: adjustment directory structure

This commit is contained in:
zhangsz
2025-03-25 09:46:16 +08:00
parent e9b29a109d
commit 63ec6e5b14
167 changed files with 374 additions and 21127 deletions

35
proxy/Nmysql/alert_sms.go Normal file
View File

@@ -0,0 +1,35 @@
package Nmysql
import (
// "fmt"
l4g "proxy/logger"
)
func SetAlertSmsState2Sent(alertId int) error {
stmt, _ := MySqlDb.Prepare("update tb_sms_info set sms_state=2 where sms_alert_id=?;")
defer stmt.Close()
_, err := stmt.Exec(alertId)
if err != nil {
l4g.MysqlLog.Errorf("SetAlertSmsState2Sent err: %v", err)
return err
}
l4g.MysqlLog.Debugf("SetAlertSmsState2Sent succ!")
return nil
}
func InsertExpiredNotifySms(accountId uint32, planId uint32, expiredDate int64) error {
stmt, _ := MySqlDb.Prepare("INSERT into tb_sync_msg SET msg_type=1, acct_id=?, ofr_inst_id=?, exp_date=FROM_UNIXTIME(?), state=1;")
defer stmt.Close()
_, err := stmt.Exec(accountId, planId, expiredDate)
if err != nil {
l4g.MysqlLog.Errorf("InsertExpiredNotifySms acctId[%d], planId[%d], expiredDate[%d] err: %v", accountId, planId, expiredDate, err)
return err
}
l4g.MysqlLog.Debugf("InsertExpiredNotifySms acctId[%d], planId[%d], expiredDate[%d] succ!", accountId, planId, expiredDate)
return nil
}