You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
package echomeet
|
|
|
|
import (
|
|
"yunyan/comm"
|
|
"yunyan/pb"
|
|
"time"
|
|
)
|
|
|
|
// @Summary 获取单条会议记录
|
|
// @Description 根据 Id 获取单条会议记录,若处于转写中会触发一次状态轮询
|
|
// @Tags Echomeet
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Security BearerAuth
|
|
// @Param user body pb.EchomeetGetRecordReq true "请求数据"
|
|
// @Success 200 {object} comm.HttpResult{data=pb.EchomeetGetRecordResp} "响应数据"
|
|
// @Router /api/home/echomeet_getrecord [post]
|
|
func (this *apiComp) GetRecord(session comm.IUserSession, req *pb.EchomeetGetRecordReq) (resp *pb.EchomeetGetRecordResp, errdata *pb.ErrorData) {
|
|
model, err := this.module.model.getrecord(req.Id)
|
|
if err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
if model.State == pb.DBEchoMeetRecordState_Transcribing && model.Taskid != "" {
|
|
now := time.Now().Unix()
|
|
if model.Lastquerytime <= 0 || now-model.Lastquerytime >= TranscribeQueryMinInterval {
|
|
model.Lastquerytime = now
|
|
this.module.model.saverecord(model)
|
|
this.module.tasks.PollTranscribe(model)
|
|
}
|
|
}
|
|
resp = &pb.EchomeetGetRecordResp{Record: model}
|
|
return
|
|
}
|
|
|