|
@@ -3,6 +3,7 @@ package data_manage
|
|
|
import (
|
|
|
"eta/eta_api/global"
|
|
|
"eta/eta_api/utils"
|
|
|
+ "gorm.io/gorm"
|
|
|
"time"
|
|
|
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
@@ -39,6 +40,18 @@ type BaseFromYongyiIndexList struct {
|
|
|
Paging *paging.PagingItem `description:"分页数据" gorm:"-"`
|
|
|
}
|
|
|
|
|
|
+func (m *BaseFromYongyiIndexList) AfterFind(tx *gorm.DB) (err error) {
|
|
|
+ if utils.NeedDateOrTimeFormat(utils.DbDriverName) {
|
|
|
+ if m.CreateTime != "" {
|
|
|
+ m.CreateTime = utils.GormDateStrToDateTimeStr(m.CreateTime)
|
|
|
+ }
|
|
|
+ if m.ModifyTime != "" {
|
|
|
+ m.ModifyTime = utils.GormDateStrToDateTimeStr(m.ModifyTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
type YongyiSingleDataResp struct {
|
|
|
YongyiIndexId int
|
|
|
ClassifyId int
|
|
@@ -148,6 +161,21 @@ type BaseFromYongyiData struct {
|
|
|
DataTimestamp int64 `gorm:"column:data_timestamp"`
|
|
|
}
|
|
|
|
|
|
+func (m *BaseFromYongyiData) AfterFind(tx *gorm.DB) (err error) {
|
|
|
+ if utils.NeedDateOrTimeFormat(utils.DbDriverName) {
|
|
|
+ if m.CreateTime != "" {
|
|
|
+ m.CreateTime = utils.GormDateStrToDateTimeStr(m.CreateTime)
|
|
|
+ }
|
|
|
+ if m.ModifyTime != "" {
|
|
|
+ m.ModifyTime = utils.GormDateStrToDateTimeStr(m.ModifyTime)
|
|
|
+ }
|
|
|
+ if m.DataTime != "" {
|
|
|
+ m.DataTime = utils.GormDateStrToDateStr(m.DataTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
type BaseFromYongyiIndexSearchItem struct {
|
|
|
YongyiIndexId int `orm:"column(yongyi_index_id);pk" gorm:"primaryKey"`
|
|
|
ClassifyId int
|