|
@@ -4,7 +4,9 @@ import (
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
"hongze/hongze_yb/models/tables/yb_bullet_chat"
|
|
|
+ "hongze/hongze_yb/models/tables/yb_community_video"
|
|
|
"hongze/hongze_yb/models/tables/yb_config"
|
|
|
+ "hongze/hongze_yb/models/tables/yb_road_video"
|
|
|
"math/rand"
|
|
|
"time"
|
|
|
)
|
|
@@ -106,6 +108,23 @@ func CreateBulletChat(userId, primaryId, source, sourceAgent int, seconds float6
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ title := ""
|
|
|
+ if source == 1 {
|
|
|
+ vd, e := yb_community_video.GetItemById(primaryId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取视频失败, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ title = vd.Title
|
|
|
+ } else {
|
|
|
+ rv, e := yb_road_video.GetItemById(primaryId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取路演视频失败, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ title = rv.Title
|
|
|
+ }
|
|
|
+
|
|
|
nowTime := time.Now().Local()
|
|
|
bc := new(yb_bullet_chat.YbBulletChat)
|
|
|
bc.UserID = userId
|
|
@@ -113,6 +132,7 @@ func CreateBulletChat(userId, primaryId, source, sourceAgent int, seconds float6
|
|
|
bc.Content = content
|
|
|
bc.Seconds = seconds
|
|
|
bc.Color = color.Color
|
|
|
+ bc.Title = title
|
|
|
bc.Source = source
|
|
|
bc.SourceAgent = sourceAgent
|
|
|
bc.CreateTime = nowTime
|