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.
40 lines
1.2 KiB
40 lines
1.2 KiB
package echomeet
|
|
|
|
import (
|
|
"yunyan/comm"
|
|
"yunyan/pb"
|
|
"time"
|
|
)
|
|
|
|
// @Summary 批量获取会议记录
|
|
// @Description 根据 Ids 批量获取会议记录,若存在转写中的记录会触发一次状态轮询
|
|
// @Tags Echomeet
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Security BearerAuth
|
|
// @Param user body pb.EchomeetGetRecordsReq true "请求数据"
|
|
// @Success 200 {object} comm.HttpResult{data=pb.EchomeetGetRecordsResp} "响应数据"
|
|
// @Router /api/home/echomeet_getrecords [post]
|
|
func (this *apiComp) GetRecords(session comm.IUserSession, req *pb.EchomeetGetRecordsReq) (resp *pb.EchomeetGetRecordsResp, errdata *pb.ErrorData) {
|
|
records, err := this.module.model.getrecords(req.Ids)
|
|
if err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
now := time.Now().Unix()
|
|
for _, model := range records {
|
|
if model.State == pb.DBEchoMeetRecordState_Transcribing && model.Taskid != "" {
|
|
if model.Lastquerytime > 0 && now-model.Lastquerytime < TranscribeQueryMinInterval {
|
|
continue
|
|
}
|
|
model.Lastquerytime = now
|
|
this.module.model.saverecord(model)
|
|
this.module.tasks.PollTranscribe(model)
|
|
}
|
|
}
|
|
resp = &pb.EchomeetGetRecordsResp{Records: records}
|
|
return
|
|
}
|
|
|