作者 tangxvhui

调整接口

@@ -7,6 +7,7 @@ import ( @@ -7,6 +7,7 @@ import (
7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/comment" 7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/comment"
8 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" 8 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
9 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" 9 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  10 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata"
10 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" 11 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
11 ) 12 )
12 13
@@ -18,7 +19,8 @@ func SystemEditAticleCommentLoveHandler(svcCtx *svc.ServiceContext) http.Handler @@ -18,7 +19,8 @@ func SystemEditAticleCommentLoveHandler(svcCtx *svc.ServiceContext) http.Handler
18 result.HttpResult(r, w, nil, err) 19 result.HttpResult(r, w, nil, err)
19 return 20 return
20 } 21 }
21 - 22 + token := contextdata.GetUserTokenFromCtx(r.Context())
  23 + req.CompanyId = token.CompanyId
22 l := comment.NewSystemEditAticleCommentLoveLogic(r.Context(), svcCtx) 24 l := comment.NewSystemEditAticleCommentLoveLogic(r.Context(), svcCtx)
23 resp, err := l.SystemEditAticleCommentLove(&req) 25 resp, err := l.SystemEditAticleCommentLove(&req)
24 result.HttpResult(r, w, resp, err) 26 result.HttpResult(r, w, resp, err)
@@ -49,6 +49,9 @@ func (l *SystemEditAticleCommentLoveLogic) SystemEditAticleCommentLove(req *type @@ -49,6 +49,9 @@ func (l *SystemEditAticleCommentLoveLogic) SystemEditAticleCommentLove(req *type
49 } 49 }
50 resp = &types.SystemEditCommentLoveResponse{} 50 resp = &types.SystemEditCommentLoveResponse{}
51 for _, val := range commetList { 51 for _, val := range commetList {
  52 + if val.CompanyId != req.CompanyId {
  53 + return nil, xerr.NewErrMsg("没有操作权限")
  54 + }
52 if u, ok := paramMap[val.Id]; ok { 55 if u, ok := paramMap[val.Id]; ok {
53 val.CountAdminLove = u 56 val.CountAdminLove = u
54 resp.ParamList = append(resp.ParamList, types.SystemEditLove{ 57 resp.ParamList = append(resp.ParamList, types.SystemEditLove{