|
|
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,17 +244,20 @@ func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfoAtta |
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
// 不是本人查看需要做模糊处理
|
|
|
if response.UserBaseId != projectQuery.Operator.UserBaseId {
|
|
|
file, err := blur.FileBlur(response.Attachment.Url, true)
|
|
|
if err != nil { // || len(file)==0
|
|
|
log.Logger.Error(err.Error())
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "文件加载错误,请重试")
|
|
|
}
|
|
|
if !(strings.HasPrefix(file, "http") || strings.HasPrefix(file, "https")) {
|
|
|
file = constant.ALLIED_CREATION_GATEWAY_HOST + "/" + file
|
|
|
if response.Attachment != nil {
|
|
|
if response.UserBaseId != projectQuery.Operator.UserBaseId {
|
|
|
file, err := blur.FileBlur(response.Attachment.Url, true)
|
|
|
if err != nil { // || len(file)==0
|
|
|
log.Logger.Error(err.Error())
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, "文件加载错误,请重试")
|
|
|
}
|
|
|
if !(strings.HasPrefix(file, "http") || strings.HasPrefix(file, "https")) {
|
|
|
file = constant.ALLIED_CREATION_GATEWAY_HOST + "/" + file
|
|
|
}
|
|
|
response.Attachment.Url = file
|
|
|
}
|
|
|
response.Attachment.Url = file
|
|
|
}
|
|
|
|
|
|
return map[string]interface{}{
|
|
|
"attachment": response.Attachment,
|
|
|
}, nil
|
...
|
...
|
|