rdluck 4 سال پیش
والد
کامیت
b6052eba82
2فایلهای تغییر یافته به همراه2 افزوده شده و 15 حذف شده
  1. 0 11
      controllers/video.go
  2. 2 4
      models/video.go

+ 0 - 11
controllers/video.go

@@ -102,9 +102,7 @@ func (this *VideoController) List() {
 		currentIndex = 1
 	}
 	startSize = paging.StartIndex(currentIndex, pageSize)
-	total := 0
 	resp := new(models.VideoListResp)
-	page := paging.GetPaging(currentIndex, pageSize, total)
 	var condition string
 	var pars []interface{}
 
@@ -134,7 +132,6 @@ func (this *VideoController) List() {
 		} else {
 			list := make([]*models.VideoList, 0)
 			resp.List = list
-			resp.Paging = page
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "获取成功"
@@ -157,13 +154,6 @@ func (this *VideoController) List() {
 		pars = append(pars, publishDate)
 	}
 	if status == 0 {
-		total, err = models.GetVideoListCount(condition, pars)
-		if err != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "获取数据总数失败,Err:" + err.Error()
-			return
-		}
-
 		list, err := models.GetVideoList(condition, pars, startSize, pageSize)
 		if err != nil {
 			br.Msg = "获取失败"
@@ -180,7 +170,6 @@ func (this *VideoController) List() {
 		list := make([]*models.VideoList, 0)
 		resp.List = list
 	}
-	resp.Paging = page
 	resp.Status = status
 	br.Ret = 200
 	br.Success = true

+ 2 - 4
models/video.go

@@ -2,7 +2,6 @@ package models
 
 import (
 	"rdluck_tools/orm"
-	"rdluck_tools/paging"
 	"time"
 )
 
@@ -29,11 +28,11 @@ type VideoList struct {
 	VideoUrl      string    `description:"视频地址"`
 	VideoCoverUrl string    `description:"视频封面地址"`
 	Status        int       `description:"视频状态:0:未发布,1:已发布"`
-	PublishTime   time.Time `description:"视频发布时间"`
+	PublishTime   string    `description:"视频发布时间"`
 	PlaySeconds   uint32    `description:"视频播放时长"`
 	CreateTime    time.Time `description:"视频创建时间"`
 	ModifyTime    time.Time `description:"视频修改时间"`
-	TagsName     string    `description:"标签名称"`
+	TagsName      string    `description:"标签名称"`
 }
 
 func GetVideoIdByKeyWord(tagName string) (video_id string, err error) {
@@ -74,7 +73,6 @@ func GetVideoList(condition string, pars []interface{}, startSize, pageSize int)
 }
 
 type VideoListResp struct {
-	Paging *paging.PagingItem
 	List   []*VideoList
 	Status int `description:"权限状态:0:有权限,1:无权限"`
 }