|
@@ -337,13 +337,19 @@ func checkTemplateIsVisible(header *protocol.RequestHeader, template *models.Aud |
|
@@ -337,13 +337,19 @@ func checkTemplateIsVisible(header *protocol.RequestHeader, template *models.Aud |
337
|
func ChanceExample(header *protocol.RequestHeader, request *protocol.ChanceExampleRequest) (rsp *protocol.ChanceExampleResponse, err error) {
|
337
|
func ChanceExample(header *protocol.RequestHeader, request *protocol.ChanceExampleRequest) (rsp *protocol.ChanceExampleResponse, err error) {
|
338
|
var (
|
338
|
var (
|
339
|
example string
|
339
|
example string
|
|
|
340
|
+ videosData string
|
340
|
)
|
341
|
)
|
341
|
- if example, err = models.GetAuditTemplateExample(int64(request.TemplateId)); err != nil {
|
342
|
+ if example, videosData, err = models.GetAuditTemplateExample(int64(request.TemplateId)); err != nil {
|
342
|
log.Error(request.TemplateId, err)
|
343
|
log.Error(request.TemplateId, err)
|
343
|
err = protocol.NewErrWithMessage(5301) //模板不存在
|
344
|
err = protocol.NewErrWithMessage(5301) //模板不存在
|
344
|
return
|
345
|
return
|
345
|
}
|
346
|
}
|
346
|
- rsp = &protocol.ChanceExampleResponse{example}
|
347
|
+ rsp = &protocol.ChanceExampleResponse{Content: example}
|
|
|
348
|
+ if len(videosData) == 0 {
|
|
|
349
|
+ rsp.Videos = make([]string, 0)
|
|
|
350
|
+ } else {
|
|
|
351
|
+ _ = json.Unmarshal([]byte(videosData), &rsp.Videos)
|
|
|
352
|
+ }
|
347
|
return
|
353
|
return
|
348
|
}
|
354
|
}
|
349
|
|
355
|
|