作者 yangfu

异常处理

package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/blur"
"strconv"
"strings"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// CooperationProjectService 共创项目服务
... ... @@ -245,6 +244,7 @@ func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfoAtta
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
// 不是本人查看需要做模糊处理
if response.Attachment != nil {
if response.UserBaseId != projectQuery.Operator.UserBaseId {
file, err := blur.FileBlur(response.Attachment.Url, true)
if err != nil { // || len(file)==0
... ... @@ -256,6 +256,8 @@ func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfoAtta
}
response.Attachment.Url = file
}
}
return map[string]interface{}{
"attachment": response.Attachment,
}, nil
... ...
... ... @@ -120,7 +120,7 @@ func PDFBlur(pdfPath string) (string, error) {
cmd := exec.Command(cmdPath, pdfPath, tmpImagePath+"/")
err = cmd.Run()
if err != nil {
panic(err)
return "", err
}
var blurFiles = make([]string, 0)
... ...