1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package controllers
- import (
- "encoding/json"
- "eta/eta_pub/models"
- "eta/eta_pub/services"
- )
- // ReportController 报告模块
- type ReportController struct {
- BaseAuthController
- }
- // HandleVideoDecibel
- // @Title 处理音频分贝大小
- // @Description 处理音频分贝大小
- // @Success 200 处理成功
- // @router /handle_video_decibel [post]
- func (this *ReportController) HandleVideoDecibel() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- body := this.Ctx.Input.RequestBody
- req := new(models.ReportChapterReq)
- err := json.Unmarshal(body, &req)
- if err != nil {
- br.Msg = "参数解析失败"
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
- return
- }
- chapterInfo, err := models.GetReportChapterInfoById(req.ReportChapterId)
- if err != nil {
- br.Msg = "章节信息有误"
- br.ErrMsg = "获取章节信息失败, Err: " + err.Error()
- return
- }
- services.HandleVideoDecibel(chapterInfo)
- br.Ret = 200
- br.Msg = "处理成功"
- return
- }
|