...
|
...
|
@@ -337,13 +337,19 @@ func checkTemplateIsVisible(header *protocol.RequestHeader, template *models.Aud |
|
|
func ChanceExample(header *protocol.RequestHeader, request *protocol.ChanceExampleRequest) (rsp *protocol.ChanceExampleResponse, err error) {
|
|
|
var (
|
|
|
example string
|
|
|
videosData string
|
|
|
)
|
|
|
if example, err = models.GetAuditTemplateExample(int64(request.TemplateId)); err != nil {
|
|
|
if example, videosData, err = models.GetAuditTemplateExample(int64(request.TemplateId)); err != nil {
|
|
|
log.Error(request.TemplateId, err)
|
|
|
err = protocol.NewErrWithMessage(5301) //模板不存在
|
|
|
return
|
|
|
}
|
|
|
rsp = &protocol.ChanceExampleResponse{example}
|
|
|
rsp = &protocol.ChanceExampleResponse{Content: example}
|
|
|
if len(videosData) == 0 {
|
|
|
rsp.Videos = make([]string, 0)
|
|
|
} else {
|
|
|
_ = json.Unmarshal([]byte(videosData), &rsp.Videos)
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
|