Ver código fonte

Merge branch 'cygx/7.6' into debug

hsun 2 anos atrás
pai
commit
d7b18fc59e

+ 38 - 15
controllers/activity.go

@@ -5051,7 +5051,10 @@ func (this *ActivityCoAntroller) ActivityVoiceHistoryAdd() {
 		br.ErrMsg = "参数解析失败,Err:" + err.Error()
 		return
 	}
+
 	activityId := req.ActivityId
+	playSeconds := req.PlaySeconds
+
 	activityInfo, errInfo := models.GetAddActivityInfoById(activityId)
 	if activityInfo == nil {
 		br.Msg = "操作失败"
@@ -5070,21 +5073,41 @@ func (this *ActivityCoAntroller) ActivityVoiceHistoryAdd() {
 		br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
 		return
 	}
-	item := new(models.CygxActivityVoiceHistory)
-	item.UserId = uid
-	item.ActivityId = activityId
-	item.CreateTime = time.Now()
-	item.Mobile = user.Mobile
-	item.Email = user.Email
-	item.CompanyId = user.CompanyId
-	item.CompanyName = user.CompanyName
-	item.SellerName = sellerName
-	item.RealName = user.RealName
-	err = models.AddCygxActivityVoiceHistory(item)
-	if err != nil {
-		br.Msg = "操作失败"
-		br.ErrMsg = "操作失败,Err:" + err.Error()
-		return
+	item := models.CygxActivityVoiceHistory{
+		ActivityId:  activityId,
+		UserId:      uid,
+		CreateTime:  time.Now(),
+		Mobile:      user.Mobile,
+		Email:       user.Email,
+		CompanyId:   user.CompanyId,
+		CompanyName: user.CompanyName,
+		RealName:    user.RealName,
+		SellerId:    0,
+		SellerName:  sellerName,
+		PlaySeconds: playSeconds,
+		ModifyTime:  time.Now(),
+	}
+
+	if playSeconds != ""{
+		lastItem, err := models.GetLastCygxActivityVoiceHistory(activityId)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "操作失败,GetLastCygxActivityVoiceHistory Err:" + err.Error()
+			return
+		}
+		err = models.UpdateLastCygxActivityVoiceHistory(playSeconds, lastItem.Id)
+		if err != nil {
+			br.Msg = "更新失败"
+			br.ErrMsg = "更新失败,UpdateLastCygxActivityVoiceHistory Err:" + err.Error()
+			return
+		}
+	} else {
+		err = models.AddCygxActivityVoiceHistory(&item)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "操作失败,Err:" + err.Error()
+			return
+		}
 	}
 	br.Ret = 200
 	br.Success = true

+ 61 - 0
controllers/home.go

@@ -1,6 +1,8 @@
 package controllers
 
 import (
+	"encoding/json"
+	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
@@ -560,3 +562,62 @@ func (this *HomeController) ListHomeArtAndChart() {
 	br.Msg = "获取成功"
 	br.Data = resp
 }
+
+// @Title 首页/搜索头部导航接口
+// @Description 首页/搜索头部导航接口
+// @Param   SearchPage  query  int  false  "是否为搜索页面"
+// @Success 200 {object} models.HomeListResp
+// @router /header_tab [get]
+func (this *HomeController) HeaderTab() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+	searchPage, _ := this.GetInt("SearchPage")
+
+	key := models.HomeHeaderTabConfigKey
+	conf, e := models.GetConfigByCode(key)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取首页头部导航失败, Err: " + e.Error()
+		return
+	}
+	if conf.ConfigValue == "" {
+		br.Msg = "获取失败"
+		br.ErrMsg = "首页头部导航配置值有误"
+		return
+	}
+
+	list := make([]*models.HomeHeaderTab, 0)
+	if e = json.Unmarshal([]byte(conf.ConfigValue), &list); e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "首页头部导航配置值解析失败, Err: " + e.Error()
+		return
+	}
+	// 搜索页
+	resp := make([]*models.HomeHeaderTab, 0)
+	if searchPage == 1 {
+		for i := range list {
+			if list[i].Name == "最新" {
+				continue
+			}
+			list[i].Name = fmt.Sprint("搜", list[i].Name)
+			resp = append(resp, list[i])
+		}
+	} else {
+		resp = list
+	}
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 146 - 0
controllers/micro_roadshow.go

@@ -0,0 +1,146 @@
+package controllers
+
+import (
+	"encoding/json"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"hongze/hongze_cygx/models"
+	"hongze/hongze_cygx/services"
+	"hongze/hongze_cygx/utils"
+	"time"
+)
+
+// 微路演
+type MicroRoadShowController struct {
+	BaseAuthController
+}
+
+// @Title 微路演列表
+// @Description 微路演列表接口
+// @Param   PageSize		query	int		true	"每页数据条数"
+// @Param   CurrentIndex	query	int		true	"当前页页码,从1开始"
+// @Param   KeyWord			query	string	false	"搜索关键词"
+// @Param   AudioId			query	int		false	"音频ID"
+// @Param   VideoId			query	int		false	"视频ID"
+// @Success 200 {object} models.HomeListResp
+// @router /list [get]
+func (this *MicroRoadShowController) List() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	keywords := this.GetString("KeyWord")
+	audioId, _ := this.GetInt("AudioId")
+	videoId, _ := this.GetInt("VideoId")
+
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+
+	list, total, e := services.GetMicroRoadShowPageList(pageSize, currentIndex, audioId, videoId, keywords)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
+		return
+	}
+
+	resp := new(models.MicroRoadShowListResp)
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp.List = list
+	resp.Paging = page
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// @Title 记录用户浏览音频回放接口
+// @Description 记录用户浏览音频回放接口
+// @Param	request	body models.ActivityIdRep true "type json string"
+// @Success Ret=200 {object} models.AppointmentResp
+// @router /videoHistory/add [post]
+func (this *MicroRoadShowController) VideoHistoryAdd() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+	uid := user.UserId
+	var req models.AddVideoHistoryReq
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+
+	videoId := req.VideoId
+	playSeconds := req.PlaySeconds
+
+	var sellerName string
+	sellerName, err = models.GetCompanySellerName(user.CompanyId)
+	if err != nil {
+		br.Msg = "报名失败!"
+		br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
+		return
+	}
+	item := models.CygxMicroRoadshowVideoHistory{
+		VideoId:     videoId,
+		UserId:      uid,
+		Mobile:      user.Mobile,
+		Email:       user.Email,
+		CompanyId:   user.CompanyId,
+		CompanyName: user.CompanyName,
+		RealName:    user.RealName,
+		SellerName:  sellerName,
+		PlaySeconds: playSeconds,
+		CreateTime:  time.Now(),
+		ModifyTime:  time.Now(),
+	}
+
+	if playSeconds != ""{
+		lastItem, err := models.GetLastCygxMicroRoadshowVideoHistory(videoId)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "操作失败,GetLastCygxMicroRoadshowVideoHistory Err:" + err.Error()
+			return
+		}
+		err = models.UpdateLastCygxActivityVoiceHistory(playSeconds, lastItem.Id)
+		if err != nil {
+			br.Msg = "更新失败"
+			br.ErrMsg = "更新失败,UpdateLastCygxActivityVoiceHistory Err:" + err.Error()
+			return
+		}
+	} else {
+		err = models.AddCygxMicroRoadshowVideoHistory(&item)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "操作失败,Err:" + err.Error()
+			return
+		}
+	}
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "操作成功"
+	return
+}

+ 1 - 0
models/activity.go

@@ -75,6 +75,7 @@ type Activity struct {
 }
 type ActivityIdRep struct {
 	ActivityId int `description:"活动id"`
+	PlaySeconds string `description:"播放时长"`
 }
 
 type ActivitySingnupRep struct {

+ 18 - 1
models/activity_voice_history.go

@@ -15,7 +15,10 @@ type CygxActivityVoiceHistory struct {
 	CompanyId   int       `description:"公司id"`
 	CompanyName string    `description:"公司名称"`
 	RealName    string    `description:"用户实际名称"`
-	SellerName  string    `description:"所属销售"`
+	SellerId        int       `description:"所属销售id"`
+	SellerName      string    `description:"所属销售"`
+	PlaySeconds     string    `description:"播放时间 单位s"`
+	ModifyTime      time.Time `description:"视频修改时间"`
 }
 
 //添加
@@ -24,3 +27,17 @@ func AddCygxActivityVoiceHistory(item *CygxActivityVoiceHistory) (err error) {
 	_, err = o.Insert(item)
 	return
 }
+
+func GetLastCygxActivityVoiceHistory(activityId int) (item *CygxActivityVoiceHistory, err error) {
+	o := orm.NewOrm()
+	sql := ` SELECT * FROM cygx_activity_voice_history WHERE activity_id=? ORDER BY create_time DESC limit 1 `
+	err = o.Raw(sql, activityId).QueryRow(&item)
+	return
+}
+
+func UpdateLastCygxActivityVoiceHistory(playSeconds string, lastId int) (err error) {
+	o := orm.NewOrm()
+	sql := ` UPDATE cygx_activity_voice_history SET play_seconds =? WHERE id=? `
+	_, err = o.Raw(sql, playSeconds, lastId).Exec()
+	return
+}

+ 10 - 0
models/config.go

@@ -5,6 +5,11 @@ import (
 	"time"
 )
 
+var (
+	HomeHeaderTabConfigKey              = "home_header_tab"
+	MicroRoadShowListDataRatioConfigKey = "micro_roadshow_list_data_ratio"
+)
+
 type CygxConfig struct {
 	ConfigId    int    `json:"-" orm:"column(config_id);pk"`
 	ConfigCode  string `json:"-"`
@@ -63,3 +68,8 @@ func GetHotSearch() (permission string, err error) {
 	err = o.Raw(sql).QueryRow(&permission)
 	return
 }
+
+type HomeHeaderTab struct {
+	Id   int    `description:"导航ID"`
+	Name string `description:"导航名称"`
+}

+ 123 - 0
models/micro_roadshow.go

@@ -0,0 +1,123 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"time"
+)
+
+// MicroRoadShowListResp 微路演列表响应体
+type MicroRoadShowListResp struct {
+	Paging *paging.PagingItem
+	List   []*MicroRoadShowPageList
+}
+
+// MicroRoadShowPageList 微路演列表
+type MicroRoadShowPageList struct {
+	Id                  int    `description:"音视频ID"`
+	Title               string `description:"标题"`
+	ResourceUrl         string `description:"链接"`
+	Type                int    `description:"类型: 1-音频; 2-视频"`
+	PublishTime         string `description:"发布时间"`
+	BackgroundImg       string `description:"背景图"`
+	ChartPermissionId   int    `description:"行业ID"`
+	ChartPermissionName string `description:"行业名称"`
+	PlaySeconds         string `description:"音视频时长"`
+	//AuthOk              bool   `description:"是否有权限"`
+}
+
+// GetMicroRoadShowAudioPageList 获取微路演音频列表-分页
+func GetMicroRoadShowAudioPageList(startSize, pageSize int, condition string, pars []interface{}) (total int, list []*MicroRoadShowPageList, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+				a.activity_voice_id AS id,
+				a.voice_name AS title,
+				a.voice_url AS resource_url,
+				1 AS type,
+				b.activity_time AS publish_time,
+				b.chart_permission_id,
+				b.chart_permission_name,
+				a.voice_play_seconds AS play_seconds
+			FROM
+				cygx_activity_voice AS a
+			JOIN cygx_activity AS b ON a.activity_id = b.activity_id `
+	if condition != `` {
+		sql += condition
+	}
+	sql += ` ORDER BY publish_time DESC`
+
+	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
+	err = o.Raw(totalSql, pars).QueryRow(&total)
+	if err != nil {
+		return
+	}
+
+	sql += ` LIMIT ?,?`
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
+	return
+}
+
+// GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
+func GetMicroRoadShowVideoPageList(startSize, pageSize int, condition string, pars []interface{}) (total int, list []*MicroRoadShowPageList, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+				video_id AS id,
+				video_name AS title,
+				video_url AS resource_url,
+				2 AS type,
+				publish_date AS publish_time,
+				chart_permission_id,
+				chart_permission_name,
+				video_duration AS play_seconds
+			FROM
+				cygx_micro_roadshow_video
+			WHERE
+				publish_status = 1 `
+	if condition != `` {
+		sql += condition
+	}
+	sql += ` ORDER BY publish_time DESC`
+
+	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
+	err = o.Raw(totalSql, pars).QueryRow(&total)
+	if err != nil {
+		return
+	}
+
+	sql += ` LIMIT ?,?`
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
+	return
+}
+
+type AddVideoHistoryReq struct {
+	VideoId int  `description:"视频ID"`
+	PlaySeconds string `description:"播放时长"`
+}
+
+type CygxMicroRoadshowVideoHistory struct {
+	Id          int       `orm:"column(id);pk"description:"微路演视频浏览记录表id"`
+	VideoId     int       `description:"微路演视频id"`
+	UserId      int       `description:"用户id"`
+	Mobile      string    `description:"手机号"`
+	Email       string    `description:"邮箱"`
+	CompanyId   int       `description:"公司Id"`
+	CompanyName string    `description:"公司名称"`
+	RealName    string    `description:"用户实际名称"`
+	SellerName  string    `description:"所属销售"`
+	PlaySeconds string    `description:"播放时间 单位s"`
+	CreateTime  time.Time `description:"视频创建时间"`
+	ModifyTime  time.Time `description:"视频修改时间"`
+}
+
+func GetLastCygxMicroRoadshowVideoHistory(videoId int) (item *CygxMicroRoadshowVideoHistory, err error) {
+	o := orm.NewOrm()
+	sql := ` SELECT * FROM cygx_micro_roadshow_video_history WHERE video_id=? ORDER BY create_time DESC limit 1 `
+	err = o.Raw(sql, videoId).QueryRow(&item)
+	return
+}
+
+func AddCygxMicroRoadshowVideoHistory(item *CygxMicroRoadshowVideoHistory) (err error) {
+	o := orm.NewOrm()
+	_, err = o.Insert(item)
+	return
+}

+ 18 - 0
routers/commentsRouter.go

@@ -628,6 +628,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:HomeController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:HomeController"],
+        beego.ControllerComments{
+            Method: "HeaderTab",
+            Router: `/header_tab`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:HomeController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:HomeController"],
         beego.ControllerComments{
             Method: "ListHome",
@@ -637,6 +646,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:MicroRoadShowController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:MicroRoadShowController"],
+        beego.ControllerComments{
+            Method: "List",
+            Router: `/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportBillboardController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportBillboardController"],
         beego.ControllerComments{
             Method: "FllowList",

+ 5 - 0
routers/router.go

@@ -124,6 +124,11 @@ func init() {
 				&controllers.BaseHtgjController{},
 			),
 		),
+		web.NSNamespace("/micro_roadshow",
+			web.NSInclude(
+				&controllers.MicroRoadShowController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }

+ 164 - 0
services/micro_roadshow.go

@@ -0,0 +1,164 @@
+package services
+
+import (
+	"errors"
+	"hongze/hongze_cygx/models"
+	"hongze/hongze_cygx/utils"
+	"math"
+	"strconv"
+	"strings"
+	"sync"
+)
+
+// GetMicroRoadShowPageList 获取微路演列表
+func GetMicroRoadShowPageList(pageSize, currentIndex, audioId, videoId int, keywords string) (respList []*models.MicroRoadShowPageList, total int, err error) {
+	var e error
+	// 根据每页数据量获取音视频配比
+	audioRatio, videoRatio, audioPageNum, videoPageNum, sliceNum, e := getMicroRoadShowDataRatio(pageSize)
+	if e != nil {
+		err = errors.New("获取微路演列表数据音视频配比失败, Err: " + e.Error())
+		return
+	}
+
+	audioTotal := 0
+	videoTotal := 0
+	audioList := make([]*models.MicroRoadShowPageList, 0)
+	videoList := make([]*models.MicroRoadShowPageList, 0)
+	if keywords != "" {
+		keywords = "%" + keywords + "%"
+	}
+	// 查询指定音频/视频时, 调整比例为1方便后面组合数据
+	if audioId > 0 || videoId > 0 {
+		audioRatio = 1
+		videoRatio = 1
+	}
+
+	wg := sync.WaitGroup{}
+
+	wg.Add(2)
+
+	// 分页查询音频
+	go func() {
+		defer wg.Done()
+		// 如果筛选条件为指定视频ID则不做音频查询
+		if videoId > 0 {
+			return
+		}
+		var audioCond string
+		var audioPars []interface{}
+		if keywords != "" {
+			audioCond += ` AND a.voice_name LIKE ? OR b.label LIKE ?`
+			audioPars = append(audioPars, keywords, keywords)
+		}
+		if audioId > 0 {
+			audioCond += ` AND a.activity_voice_id = ?`
+			audioPars = append(audioPars, audioId)
+		}
+		audioStartSize := 0
+		if currentIndex > 1 {
+			audioStartSize = (currentIndex - 1) * audioPageNum
+		}
+		audioTotal, audioList, e = models.GetMicroRoadShowAudioPageList(audioStartSize, audioPageNum, audioCond, audioPars)
+	}()
+
+	// 分页查询视频
+	go func() {
+		defer wg.Done()
+		// 如果筛选条件为指定音频ID则不做视频查询
+		if audioId > 0 {
+			return
+		}
+		var videoCond string
+		var videoPars []interface{}
+		if keywords != "" {
+			videoCond += ` AND video_name LIKE ?`
+			videoPars = append(videoPars, keywords)
+		}
+		if videoId > 0 {
+			videoCond += ` AND video_id = ?`
+			videoPars = append(videoPars, videoId)
+		}
+		videoStartSize := 0
+		if currentIndex > 1 {
+			videoStartSize = (currentIndex - 1) * videoPageNum
+		}
+		videoTotal, videoList, e = models.GetMicroRoadShowVideoPageList(videoStartSize, audioPageNum, videoCond, videoPars)
+	}()
+
+	wg.Wait()
+
+	if e != nil {
+		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
+		return
+	}
+
+	// 按比例组合列表
+	audioLen := len(audioList)
+	videoLen := len(videoList)
+	for i := 0; i < sliceNum; i++ {
+		// 音频
+		a := i * audioRatio		// 0 4 8 12
+		oa := a + audioRatio	// 4 8 12 16
+		if oa <= audioLen {
+			for k1 := a; k1 < oa; k1++ {
+				respList = append(respList, audioList[k1])
+			}
+		}
+		// 视频
+		b := i * videoRatio		// 0 1 2 3
+		ob := b + videoRatio	// 1 2 3 4
+		if ob <= videoLen {
+			for k2 := b; k2 < ob; k2++ {
+				respList = append(respList, videoList[k2])
+			}
+		}
+	}
+	total = audioTotal + videoTotal
+	return
+}
+
+// getMicroRoadShowDataRatio 获取微路演列表数据音视频配比
+func getMicroRoadShowDataRatio(pageSize int) (audioRatio, videoRatio, audioPageNum, videoPageNum, sliceNum int, err error) {
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	key := models.MicroRoadShowListDataRatioConfigKey
+	config, e := models.GetConfigByCode(key)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("获取微路演列表数据量配置失败, Err: " + e.Error())
+		return
+	}
+
+	// 默认音频视频展示比例为4:1
+	ratio := "4:1"
+	if config != nil {
+		ratio = config.ConfigValue
+	}
+	ratioArr := strings.Split(ratio, ":")
+	if len(ratioArr) != 2 {
+		err = errors.New("微路演列表数据量配比有误")
+		return
+	}
+	audioRatio, e = strconv.Atoi(ratioArr[0])
+	if e != nil {
+		err = errors.New("微路演列表数据量配比有误")
+		return
+	}
+	videoRatio, e = strconv.Atoi(ratioArr[1])
+	if e != nil {
+		err = errors.New("微路演列表数据量配比有误")
+		return
+	}
+	totalRatio := audioRatio + videoRatio
+	if totalRatio == 0 {
+		err = errors.New("微路演列表数据量配比有误")
+		return
+	}
+
+	// 每比率对应数量(向上取整)
+	sliceNum = int(math.Ceil(float64(pageSize) / float64(totalRatio)))
+	audioPageNum = audioRatio * sliceNum
+	videoPageNum = videoRatio * sliceNum
+
+	return
+}