作者 yangfu
1 # 说明 1 # 说明
2 2
3 ### 测试环境 3 ### 测试环境
  4 +
4 服务端域名 http://sumifcc-discuss-test.sumifcc.com/ 5 服务端域名 http://sumifcc-discuss-test.sumifcc.com/
  6 +日志地址 https://sumifcc-discuss-test.sumifcc.com/v1/log/access
  7 +
  8 +管理后台“易数家“前端入口:https://digital-front-platform-dev.fjmaimaimai.com/
  9 +跳转后的实际管理后台地址:
5 10
6 ### 可设置环境变量 11 ### 可设置环境变量
7 - DataSource 12 - DataSource
@@ -56,7 +56,8 @@ type ( @@ -56,7 +56,8 @@ type (
56 Show int `json:"show"` // 评论的展示状态(1显示、2不显示) 56 Show int `json:"show"` // 评论的展示状态(1显示、2不显示)
57 Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在) 57 Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)
58 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞) 58 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
59 - Tags []string `json:"tags"` //文章的标签 59 + MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
  60 + Tags []string `json:"tags"` // 文章的标签
60 } 61 }
61 ArticleSection { 62 ArticleSection {
62 Id int64 `json:"id"` //段落id 63 Id int64 `json:"id"` //段落id
@@ -504,11 +505,11 @@ type ( @@ -504,11 +505,11 @@ type (
504 Size int `json:"size"` 505 Size int `json:"size"`
505 CompanyId int64 `json:",optional"` 506 CompanyId int64 `json:",optional"`
506 UserId int64 `json:",optional"` 507 UserId int64 `json:",optional"`
507 - TagCategory string `json:"tagCategory"`  
508 - TagId int64 `json:"tagId"`  
509 - BeginTime int64 `json:"beginTime"`  
510 - EndTime int64 `json:"endTime"`  
511 - SearchWord string `json:"searchWord"` 508 + TagCategory string `json:"tagCategory,optional"`
  509 + TagId int64 `json:"tagId,optional"`
  510 + BeginTime int64 `json:"beginTime,optional"`
  511 + EndTime int64 `json:"endTime,optional"`
  512 + SearchWord string `json:"searchWord,optional"`
512 } 513 }
513 // 514 //
514 MiniSearchArticleResponse { 515 MiniSearchArticleResponse {
@@ -22,6 +22,7 @@ func MiniGetArticleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { @@ -22,6 +22,7 @@ func MiniGetArticleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
22 l := article.NewMiniGetArticleLogic(r.Context(), svcCtx) 22 l := article.NewMiniGetArticleLogic(r.Context(), svcCtx)
23 token := contextdata.GetUserTokenFromCtx(r.Context()) 23 token := contextdata.GetUserTokenFromCtx(r.Context())
24 req.CompanyId = token.CompanyId 24 req.CompanyId = token.CompanyId
  25 + req.UserId = int(token.UserId)
25 resp, err := l.MiniGetArticle(&req) 26 resp, err := l.MiniGetArticle(&req)
26 result.HttpResult(r, w, resp, err) 27 result.HttpResult(r, w, resp, err)
27 } 28 }
@@ -77,6 +77,9 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( @@ -77,6 +77,9 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
77 tags = append(tags, val.Name) 77 tags = append(tags, val.Name)
78 } 78 }
79 } 79 }
  80 + // 查询我是否已关注文章的作者
  81 +
  82 + follow, _ := l.svcCtx.UserFollowRepository.FindOneUserFollowing(l.ctx, conn, int64(req.UserId), articleInfo.AuthorId)
80 83
81 sortBy := domain.SortArticleSection(sectionList) 84 sortBy := domain.SortArticleSection(sectionList)
82 sort.Sort(sortBy) 85 sort.Sort(sortBy)
@@ -117,6 +120,7 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( @@ -117,6 +120,7 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
117 Show: int(articleInfo.Show), 120 Show: int(articleInfo.Show),
118 Edit: 0, 121 Edit: 0,
119 MeLoveFlag: meLoveFlag, 122 MeLoveFlag: meLoveFlag,
  123 + MeFollowFlag: 0,
120 Tags: tags, 124 Tags: tags,
121 } 125 }
122 if articleInfo.CreatedAt != articleInfo.UpdatedAt { 126 if articleInfo.CreatedAt != articleInfo.UpdatedAt {
@@ -125,6 +129,8 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( @@ -125,6 +129,8 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
125 for _, val := range articleInfo.Images { 129 for _, val := range articleInfo.Images {
126 resp.Images = append(resp.Images, val.Url) 130 resp.Images = append(resp.Images, val.Url)
127 } 131 }
128 - 132 + if follow != nil {
  133 + resp.MeFollowFlag = 1
  134 + }
129 return 135 return
130 } 136 }
@@ -796,7 +796,8 @@ type MiniArticleGetResponse struct { @@ -796,7 +796,8 @@ type MiniArticleGetResponse struct {
796 Show int `json:"show"` // 评论的展示状态(1显示、2不显示) 796 Show int `json:"show"` // 评论的展示状态(1显示、2不显示)
797 Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在) 797 Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在)
798 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞) 798 MeLoveFlag int `json:"meLoveFlag"` // 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)
799 - Tags []string `json:"tags"` //文章的标签 799 + MeFollowFlag int `json:"meFollowFlag"` // 当前人员对作者的关注标识 (0 没有关注 1有关注)
  800 + Tags []string `json:"tags"` // 文章的标签
800 } 801 }
801 802
802 type ArticleSection struct { 803 type ArticleSection struct {
@@ -1203,11 +1204,11 @@ type MiniSearchArticleRequest struct { @@ -1203,11 +1204,11 @@ type MiniSearchArticleRequest struct {
1203 Size int `json:"size"` 1204 Size int `json:"size"`
1204 CompanyId int64 `json:",optional"` 1205 CompanyId int64 `json:",optional"`
1205 UserId int64 `json:",optional"` 1206 UserId int64 `json:",optional"`
1206 - TagCategory string `json:"tagCategory"`  
1207 - TagId int64 `json:"tagId"`  
1208 - BeginTime int64 `json:"beginTime"`  
1209 - EndTime int64 `json:"endTime"`  
1210 - SearchWord string `json:"searchWord"` 1207 + TagCategory string `json:"tagCategory,optional"`
  1208 + TagId int64 `json:"tagId,optional"`
  1209 + BeginTime int64 `json:"beginTime,optional"`
  1210 + EndTime int64 `json:"endTime,optional"`
  1211 + SearchWord string `json:"searchWord,optional"`
1211 } 1212 }
1212 1213
1213 type MiniSearchArticleResponse struct { 1214 type MiniSearchArticleResponse struct {