rdluck 3 years ago
parent
commit
329082a97d
4 changed files with 13 additions and 8 deletions
  1. 3 0
      models/db.go
  2. 1 0
      services/data_manage/data_ths.go
  3. 7 6
      services/data_manage/data_wind.go
  4. 2 2
      utils/constants.go

+ 3 - 0
models/db.go

@@ -3,6 +3,7 @@ package models
 import (
 	"hongze/hongze_task/models/company_approval"
 	"hongze/hongze_task/models/company_contract"
+	"hongze/hongze_task/models/data_manage"
 	"hongze/hongze_task/utils"
 	_ "github.com/go-sql-driver/mysql"
 	"time"
@@ -60,5 +61,7 @@ func init() {
 		new(CompanyPermissionLog),
 		new(company_contract.CompanyContract),
 		new(company_approval.CompanyApproval),
+		new(data_manage.EdbDataWind),
+		new(data_manage.EdbDataThs),
 	)
 }

+ 1 - 0
services/data_manage/data_ths.go

@@ -27,6 +27,7 @@ func SyncEdbDataByThs(edbInfoId int64, edbCode, startDate, endDate string) (err
 	thsUrl = fmt.Sprintf(thsUrl, edbCode, startDate, endDate)
 	utils.FileLog.Info("thsUrl:%s", thsUrl)
 	body, err := http.Get(thsUrl)
+	fmt.Println(thsUrl)
 	fmt.Println("GetEdbDataByThs body:")
 	fmt.Println(string(body))
 

+ 7 - 6
services/data_manage/data_wind.go

@@ -22,11 +22,12 @@ func SyncEdbDataByWind(edbInfoId int64, edbCode, startDate, endDate string) (err
 		}
 	}()
 
-	thsUrl := utils.Hz_Data_Url + `edbInfo/wind/?EdbCode=%s&StartDate=%s&EndDate=%s`
-	thsUrl = fmt.Sprintf(thsUrl, edbCode, startDate, endDate)
-	utils.FileLog.Info("thsUrl:%s", thsUrl)
-	body, err := http.Get(thsUrl)
-	fmt.Println("GetEdbDataByThs body:")
+	windUrl := utils.Hz_Data_Url + `edbInfo/wind/?EdbCode=%s&StartDate=%s&EndDate=%s`
+	windUrl = fmt.Sprintf(windUrl, edbCode, startDate, endDate)
+	utils.FileLog.Info("thsUrl:%s", windUrl)
+	body, err := http.Get(windUrl)
+	fmt.Println(windUrl)
+	fmt.Println("SyncEdbDataByWind body:")
 	fmt.Println(string(body))
 	utils.FileLog.Info("wind %s", string(body))
 
@@ -60,7 +61,7 @@ func SyncEdbDataByWind(edbInfoId int64, edbCode, startDate, endDate string) (err
 
 			item := new(data_manage.EdbDataWind)
 			item.EdbCode = edbCode
-			item.EdbInfoId = 0
+			item.EdbInfoId = int(edbInfoId)
 			item.CreateTime = time.Now()
 			item.ModifyTime = time.Now()
 			item.DataTime = dateTime

+ 2 - 2
utils/constants.go

@@ -21,7 +21,7 @@ const (
 const (
 	APPNAME          = "弘则-task"
 	EmailSendToUsers = "317699326@qq.com;984198890@qq.com"
-	EmailSendToMe = "317699326@qq.com"
+	EmailSendToMe    = "317699326@qq.com"
 )
 
 //手机号,电子邮箱正则
@@ -47,7 +47,7 @@ const (
 	XfSTATUS_FIRST_FRAME    = 0 //第一帧标识
 	XfSTATUS_CONTINUE_FRAME = 1 //中间帧标识
 	XfSTATUS_LAST_FRAME     = 2 //最后一帧标识
-	XfAPPID               = "5ed70e9d"
+	XfAPPID                 = "5ed70e9d"
 	XfAPIKey                = "d580509ca262e9586fb65a7064d5ce77"
 	XfAPISecret             = "a085720dc55850c720fa5576335f847a"
 	XfHostUrl               = "wss://tts-api.xfyun.cn/v2/tts"