This commit is contained in:
2025-02-19 11:52:46 +08:00
parent 8cf2a64bc0
commit 5e42ff9d91
5 changed files with 114 additions and 37 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"github.com/bytedance/sonic"
"go-admin/app/admin/models"
"go-admin/app/admin/service"
"go-admin/app/admin/service/dto"
@ -16,17 +15,18 @@ import (
"go-admin/pkg/utility/snowflakehelper"
"go-admin/services/binanceservice"
"go-admin/services/fileservice"
"gorm.io/driver/mysql"
"io"
"net/http"
"os"
"os/exec"
"path/filepath"
"slices"
"strconv"
"strings"
"time"
"github.com/bytedance/sonic"
"gorm.io/driver/mysql"
"github.com/shopspring/decimal"
"github.com/go-admin-team/go-admin-core/sdk"
@ -389,7 +389,7 @@ func (l ListenSymbol) Exec(arg interface{}) error {
//发送邮箱
emails := strings.Split(configResp.ConfigValue, ",")
for _, email := range emails {
emailhelper.SendNoticeEmail(email, chain, symbol.Token0Symbol+"/"+symbol.Token1Symbol, symbol.TargetToken)
emailhelper.SendNoticeEmail(email, chain, symbol.Token0Symbol+"/"+symbol.Token1Symbol, symbol.Pair)
}
// 清除数据
db.Model(&models.SpiderListenSymbol{}).Where("coin = ? AND currency = ?", symbol.Token0Symbol, symbol.Token1Symbol).Delete(&models.SpiderListenSymbol{})
@ -405,7 +405,7 @@ func (l ListenSymbol) Exec(arg interface{}) error {
func (l ListenSymbol) GetAveRequestId() (aveToken string, err error) {
execPath, err := os.Getwd()
// 获取可执行文件所在的目录
execDir := fmt.Sprintf("%s/config/ave.js", filepath.Dir(filepath.Dir(execPath)))
execDir := fmt.Sprintf("%s/config/ave.js", execPath)
_, err = os.Stat(execDir)
if err != nil {
logger.Error("可执行的js 文件不存在")