|
|
|
@ -101,13 +101,21 @@ type liveInfo struct {
|
|
|
|
|
GoodsLists []GoodsItem `json:"goodsLists"`
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
Topic uint `json:"topic"`
|
|
|
|
|
IsFirst int `json:"isFirst"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (l *Live) Info(c *gin.Context) {
|
|
|
|
|
userId := common.GetUserId(c)
|
|
|
|
|
liveRoom := (&live2.LiveRoom{}).GetLiveByUserId(userId)
|
|
|
|
|
isFirst := 1
|
|
|
|
|
if liveRoom.Id > 0 {
|
|
|
|
|
isFirst = 0
|
|
|
|
|
}
|
|
|
|
|
liveItem := (&live2.LiveItem{}).GetLiveItemIng(userId)
|
|
|
|
|
if liveItem.Id <= 0 {
|
|
|
|
|
back.Suc(c, "", liveInfo{})
|
|
|
|
|
back.Suc(c, "", liveInfo{
|
|
|
|
|
IsFirst: isFirst,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
users, err := recook.User.GetUsers([]uint{liveItem.UserId})
|
|
|
|
@ -116,7 +124,6 @@ func (l *Live) Info(c *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
liveData := (&live2.LiveData{}).GetByLiveItemId(liveItem.Id)
|
|
|
|
|
liveRoom := (&live2.LiveRoom{}).GetLiveByUserId(liveItem.UserId)
|
|
|
|
|
|
|
|
|
|
itemGoods := (&live2.LiveGoods{}).GetGoodsByLiveItemId(liveItem.Id)
|
|
|
|
|
goodsIds := []uint{}
|
|
|
|
@ -153,6 +160,7 @@ func (l *Live) Info(c *gin.Context) {
|
|
|
|
|
GoodsLists: goodsList,
|
|
|
|
|
Topic: liveItem.Topic,
|
|
|
|
|
Title: topicInfo.Title,
|
|
|
|
|
IsFirst: isFirst,
|
|
|
|
|
}
|
|
|
|
|
back.Suc(c, "操作成功", reply)
|
|
|
|
|
}
|
|
|
|
@ -341,7 +349,7 @@ func (l *Live) LiveInfo(c *gin.Context) {
|
|
|
|
|
reply := replyLiveInfo{
|
|
|
|
|
Nickname: (*users)[0].Nickname,
|
|
|
|
|
HeadImgUrl: (*users)[0].HeadImgUrl,
|
|
|
|
|
PlayUrl: tencent.Live.GetPlayUrl(liveRoom.StreamName),
|
|
|
|
|
PlayUrl: tencent.Live.GetPlayUrl(liveRoom.StreamName, liveItem.Id),
|
|
|
|
|
GroupId: liveRoom.GroupId,
|
|
|
|
|
UserId: liveItem.UserId,
|
|
|
|
|
Id: liveItem.Id,
|
|
|
|
|