作者 yangfu

自查模板修改

... ... @@ -60,8 +60,9 @@ func CreateUploadVideo(client *vod.Client, r *CreateUploadVideoRequest) (respons
//获取图片上传地址和凭证,并创建视频信息
func CreateUploadImage(client *vod.Client, r *CreateUploadImageRequest) (response *CreateUploadImageResponse, err error) {
request := vod.CreateCreateUploadImageRequest()
request.ImageType = "default"
request.ImageType = "cover"
request.AcceptFormat = "JSON"
request.ImageExt = "jpg"
rsp, err := client.CreateUploadImage(request)
if err != nil {
return
... ...
... ... @@ -16,6 +16,7 @@ const (
/*机会-自查内容*/
var CheckOptionsCommit = []CheckOption{{Item: "是", NeedOther: false}, {Item: "否", NeedOther: false}, {Item: "不清楚", NeedOther: false}}
var CheckOptionsApprove = []CheckOption{{Item: "是", NeedOther: false}, {Item: "否", NeedOther: true}, {Item: "不清楚", NeedOther: false}}
//自查结果列表
type SelfCheckResults []selfCheckResult
... ... @@ -158,7 +159,7 @@ type CheckQuestion struct {
}
type CheckOption struct {
Item string `json:"item"`
NeedOther bool `json:"-"` //是否需填写其他的内容【1:需要】【2:不需要】
NeedOther bool `json:"needOther"` //是否需填写其他的内容【1:需要】【2:不需要】
}
/*CheckQuestions 自查问题列表*/
... ...
... ... @@ -303,9 +303,12 @@ func GetCheckQuestionsByChanceId(header *protocol.RequestHeader, id int64) (rsp
groupIdx++
idx = 0
}
item := protocol.NewCheckQuestion(c.CheckItem, getQuestionTitle(groupIdx, idx, c.CheckItem), c.GroupId, protocol.CheckOptionsCommit)
if header.UserId == chance.UserId && chance.ReviewStatus != protocol.ReviewStatusPass {
item.Answer = c.Answer
item := protocol.NewCheckQuestion(c.CheckItem, getQuestionTitle(groupIdx, idx, c.CheckItem), c.GroupId, protocol.CheckOptionsApprove)
if header.UserId == chance.UserId {
item.CheckOptions = protocol.CheckOptionsCommit
if chance.ReviewStatus != protocol.ReviewStatusPass {
item.Answer = c.Answer
}
}
rsp = append(rsp, item)
idx++
... ...
... ... @@ -296,9 +296,16 @@ func Template(header *protocol.RequestHeader, request *protocol.TemplateRequest)
if len(item.Example) > 0 || len(item.Videos) > 2 {
template.Link = fmt.Sprintf("%v/#/ability/opportunity?id=%v", beego.AppConfig.String("h5_host"), item.Id)
}
if template.Questions, err = agg.GetCheckQuestionsByTemplateId(templates.Id); err != nil {
log.Error(err)
return
if request.ChanceId > 0 {
if template.Questions, err = agg.GetCheckQuestionsByChanceId(header, request.ChanceId); err != nil {
log.Error(err)
return
}
} else {
if template.Questions, err = agg.GetCheckQuestionsByTemplateId(templates.Id); err != nil {
log.Error(err)
return
}
}
for j := range forms {
form := forms[j]
... ...