1
|
package service
|
1
|
package service
|
2
|
|
2
|
|
3
|
import (
|
3
|
import (
|
|
|
4
|
+ "github.com/linmadan/egglib-go/core/application"
|
|
|
5
|
+ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
|
|
|
6
|
+ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
|
4
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
|
5
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
|
9
|
+ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
6
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
11
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/blur"
|
12
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/blur"
|
9
|
"strconv"
|
13
|
"strconv"
|
10
|
"strings"
|
14
|
"strings"
|
11
|
-
|
|
|
12
|
- "github.com/linmadan/egglib-go/core/application"
|
|
|
13
|
- "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
|
|
|
14
|
- "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
|
|
|
15
|
- "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
|
|
|
16
|
)
|
15
|
)
|
17
|
|
16
|
|
18
|
// CooperationProjectService 共创项目服务
|
17
|
// CooperationProjectService 共创项目服务
|
|
@@ -245,17 +244,20 @@ func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfoAtta |
|
@@ -245,17 +244,20 @@ func (srv CooperationProjectService) PersonSearchCooperationProjectShareInfoAtta |
245
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
244
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
246
|
}
|
245
|
}
|
247
|
// 不是本人查看需要做模糊处理
|
246
|
// 不是本人查看需要做模糊处理
|
248
|
- if response.UserBaseId != projectQuery.Operator.UserBaseId {
|
|
|
249
|
- file, err := blur.FileBlur(response.Attachment.Url, true)
|
|
|
250
|
- if err != nil { // || len(file)==0
|
|
|
251
|
- log.Logger.Error(err.Error())
|
|
|
252
|
- return nil, application.ThrowError(application.BUSINESS_ERROR, "文件加载错误,请重试")
|
|
|
253
|
- }
|
|
|
254
|
- if !(strings.HasPrefix(file, "http") || strings.HasPrefix(file, "https")) {
|
|
|
255
|
- file = constant.ALLIED_CREATION_GATEWAY_HOST + "/" + file
|
247
|
+ if response.Attachment != nil {
|
|
|
248
|
+ if response.UserBaseId != projectQuery.Operator.UserBaseId {
|
|
|
249
|
+ file, err := blur.FileBlur(response.Attachment.Url, true)
|
|
|
250
|
+ if err != nil { // || len(file)==0
|
|
|
251
|
+ log.Logger.Error(err.Error())
|
|
|
252
|
+ return nil, application.ThrowError(application.BUSINESS_ERROR, "文件加载错误,请重试")
|
|
|
253
|
+ }
|
|
|
254
|
+ if !(strings.HasPrefix(file, "http") || strings.HasPrefix(file, "https")) {
|
|
|
255
|
+ file = constant.ALLIED_CREATION_GATEWAY_HOST + "/" + file
|
|
|
256
|
+ }
|
|
|
257
|
+ response.Attachment.Url = file
|
256
|
}
|
258
|
}
|
257
|
- response.Attachment.Url = file
|
|
|
258
|
}
|
259
|
}
|
|
|
260
|
+
|
259
|
return map[string]interface{}{
|
261
|
return map[string]interface{}{
|
260
|
"attachment": response.Attachment,
|
262
|
"attachment": response.Attachment,
|
261
|
}, nil
|
263
|
}, nil
|