作者 tangxvhui

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/mmm-go/oppmg into dev

... ... @@ -69,6 +69,9 @@ func (this *TemplateController) TemplateAdd() {
return
}
}
if len(request.Videos) == 0 {
request.Videos = make([]string, 0)
}
rsp, err := audit.TemplateAdd(uid, companyId, request)
msg = protocol.NewReturnResponse(rsp, err)
return
... ... @@ -118,6 +121,9 @@ func (this *TemplateController) TemplateUpdate() {
return
}
}
if len(request.Videos) == 0 {
request.Videos = make([]string, 0)
}
rsp, err := audit.TemplateUpdate(uid, companyId, request)
msg = protocol.NewReturnResponse(rsp, err)
return
... ...
... ... @@ -89,6 +89,7 @@ func (c *UploadController) UploadVideo() {
filehead, err := c.GetFiles("file")
if err != nil {
log.Error("获取上传文件失败:%s", err)
return
}
var rsp ResponseUploadImage
for i := range filehead {
... ...
... ... @@ -24,6 +24,7 @@ type AuditTemplate struct {
CreateAt time.Time `orm:"column(create_at);type(timestamp)" description:"创建时间"`
UpdateAt time.Time `orm:"column(update_at);type(timestamp)" description:"更新时间"`
Example string `orm:"column(example);null" description:"示例"`
Videos string `orm:"column(videos);null" description:"示例"`
}
const (
... ...
... ... @@ -82,6 +82,7 @@ func (input ValidateInputRedio) ValidateConfig() error {
type TemplateAddRequest struct {
Template Template `json:"template"`
Example string `json:"example"` //示例
Videos []string `json:"videos"` //视频
AuditFlowConfig AuditFlowConfig `json:"auditFlowConfig"`
}
type TemplateAddResponse struct {
... ... @@ -115,6 +116,7 @@ type ProcessConfig struct {
type TemplateUpdateRequest struct {
Template Template `json:"template"`
Example string `json:"example"` //示例`
Videos []string `json:"videos"` //视频
AuditFlowConfig AuditFlowConfig `json:"auditFlowConfig"`
}
type TemplateUpdateResponse struct {
... ... @@ -181,6 +183,7 @@ type TemplateGetRequest struct {
type TemplateGetResponse struct {
Template Template `json:"template"`
Example string `json:"example"` //示例`
Videos []string `json:"videos"` //视频
AuditFlowConfig AuditFlowConfig `json:"auditFlowConfig"`
}
... ...
... ... @@ -53,6 +53,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs
VisibleType: int8(0),
EnableStatus: 1,
Example: request.Example,
Videos: jsonAssertMarsh(request.Videos),
CreateAt: time.Now(),
UpdateAt: time.Now(),
}
... ... @@ -181,6 +182,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
template.Icon = request.Template.Icon
template.NoApprover = int8(request.AuditFlowConfig.NoApprover)
template.Example = request.Example
template.Videos = jsonAssertMarsh(request.Videos)
template.UpdateAt = time.Now()
if err = models.UpdateAuditTemplateById(template); err != nil {
log.Error(err.Error())
... ... @@ -457,6 +459,10 @@ func TemplateGet(uid, companyId int64, request *protocol.TemplateGetRequest) (rs
Code: template.Code,
}
rsp.Example = template.Example
rsp.Videos = make([]string, 0)
if len(template.Videos) > 0 {
_ = json.Unmarshal([]byte(template.Videos), &rsp.Videos)
}
if auditForm, err = models.GetAuditFormByTemplateId(int(template.Id)); err != nil {
log.Error("id:%v msg:%v", template.Id, err.Error())
... ...