Skip to content

Commit

Permalink
DEV UPDATE:Complete /v1/video-page
Browse files Browse the repository at this point in the history
  • Loading branch information
misakajimmy committed Mar 8, 2023
1 parent 2b48172 commit 4f9b729
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions internal/app/api/idl/eoefans_video_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type EoefansVideoPageResp struct {
Key string `json:"key"`
Name string `json:"name"`
Banners []*EoefansVideoPageBannerResp `json:"banners"`
Videos []*EoefansVideoPageVideo `json:"videos"`
Videos []*EoefansVideoPageVideo `json:"videos"`
}

type EoefansVideoPageBannerResp struct {
Expand All @@ -20,8 +20,8 @@ type EoefansVideoPageBannerResp struct {
}

type EoefansVideoPageVideoResp struct {
Video NewBilibiliVideo `json:"video"`
Rank uint `json:"rank"`
NewBilibiliVideo NewBilibiliVideo `json:"video"`
Rank uint `json:"rank"`
}

type GVA_MODEL struct {
Expand Down
5 changes: 0 additions & 5 deletions internal/repository/eoefans_video_page.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package repository

import (
"fmt"
"gorm.io/gorm"
"vlink.dev/eoefans/internal/app/api/idl"
)
Expand All @@ -22,19 +21,15 @@ func (impl *EoefansVideoPageMysqlImpl) FindAll() (list []*idl.EoefansVideoPageRe
return nil, err
}
for i := range pageList {
fmt.Println(pageList[i].Name)
var bannerList []*idl.EoefansVideoPageBannerResp
var videoList []*idl.EoefansVideoPageVideo
err = impl.tx.Table(idl.EoefansVideoPageBanner{}.TableName()).
Select("image,url,rank").
Where("eoefans_video_page_id = ?", pageList[i].ID).
Find(&bannerList).Error
fmt.Println("aaaaaaaaaaaaa")
err = impl.tx.Table(idl.EoefansVideoPageVideo{}.TableName()).
Where("eoefans_video_page_id = ?", pageList[i].ID).
Preload("NewBilibiliVideo").
//Joins("JOIN bilbil_video ON bilbil_video.id = eoefans_video_page_video.bilbil_video_id").
//Select("rank").
Find(&videoList).Error
res := idl.EoefansVideoPageResp{
Key: pageList[i].Key,
Expand Down

0 comments on commit 4f9b729

Please sign in to comment.