Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss into dev
正在显示
6 个修改的文件
包含
18 行增加
和
14 行删除
@@ -230,7 +230,7 @@ type ( | @@ -230,7 +230,7 @@ type ( | ||
230 | Size int `json:"size"` | 230 | Size int `json:"size"` |
231 | ArticleId int64 `json:"articleId"` // 文章ID | 231 | ArticleId int64 `json:"articleId"` // 文章ID |
232 | TopId int64 `json:"topId,optional"` // 文章顶层ID | 232 | TopId int64 `json:"topId,optional"` // 文章顶层ID |
233 | - AuthorId int64 `json:"authorId,optional"` // 用户 | 233 | + Author string `json:"author,optional"` // 用户 |
234 | Show int `json:"show,optional"` // 显示状态 | 234 | Show int `json:"show,optional"` // 显示状态 |
235 | BeginTime int64 `json:"beginTime,optional"` // 开始时间 | 235 | BeginTime int64 `json:"beginTime,optional"` // 开始时间 |
236 | EndTime int64 `json:"endTime,optional"` // 结束时间 | 236 | EndTime int64 `json:"endTime,optional"` // 结束时间 |
@@ -32,7 +32,8 @@ func (l *SystemArticleCommentSearchLogic) SystemArticleCommentSearch(req *types. | @@ -32,7 +32,8 @@ func (l *SystemArticleCommentSearchLogic) SystemArticleCommentSearch(req *types. | ||
32 | WithOffsetLimit(req.Page, req.Size). | 32 | WithOffsetLimit(req.Page, req.Size). |
33 | WithKV("articleId", req.ArticleId). | 33 | WithKV("articleId", req.ArticleId). |
34 | WithKV("topId", req.TopId). | 34 | WithKV("topId", req.TopId). |
35 | - WithKV("fromUserId", req.AuthorId). | 35 | + WithKV("show", req.Show). |
36 | + WithKV("fromUserName", req.Author). | ||
36 | WithKV("beginCreatedAt", req.BeginTime). | 37 | WithKV("beginCreatedAt", req.BeginTime). |
37 | WithKV("endCreatedAt", req.EndTime) | 38 | WithKV("endCreatedAt", req.EndTime) |
38 | total, comments, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, queryOptions) | 39 | total, comments, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, queryOptions) |
@@ -41,9 +41,9 @@ func (l *SystemGetLogic) SystemGet(req *types.DepartmentGetRequest) (resp *types | @@ -41,9 +41,9 @@ func (l *SystemGetLogic) SystemGet(req *types.DepartmentGetRequest) (resp *types | ||
41 | if err != nil { | 41 | if err != nil { |
42 | return nil, err | 42 | return nil, err |
43 | } | 43 | } |
44 | - ids := make([]int64, 0) | 44 | + var userIds = make([]int64, 0) |
45 | for i := range users { | 45 | for i := range users { |
46 | - ids = append(ids, users[i].Id) | 46 | + userIds = append(userIds, users[i].Id) |
47 | } | 47 | } |
48 | resp = &types.DepartmentGetResponse{ | 48 | resp = &types.DepartmentGetResponse{ |
49 | Department: types.Department{ | 49 | Department: types.Department{ |
@@ -51,7 +51,7 @@ func (l *SystemGetLogic) SystemGet(req *types.DepartmentGetRequest) (resp *types | @@ -51,7 +51,7 @@ func (l *SystemGetLogic) SystemGet(req *types.DepartmentGetRequest) (resp *types | ||
51 | CompanyId: department.CompanyId, | 51 | CompanyId: department.CompanyId, |
52 | ParentId: department.ParentId, | 52 | ParentId: department.ParentId, |
53 | Name: department.Name, | 53 | Name: department.Name, |
54 | - UserIds: ids, | 54 | + UserIds: userIds, |
55 | }, | 55 | }, |
56 | } | 56 | } |
57 | return resp, nil | 57 | return resp, nil |
@@ -28,7 +28,7 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi | @@ -28,7 +28,7 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi | ||
28 | queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size) | 28 | queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size) |
29 | 29 | ||
30 | if len(req.Category) > 0 { | 30 | if len(req.Category) > 0 { |
31 | - queryOptions = queryOptions.MustWithKV("group", "%"+req.Category+"%") | 31 | + queryOptions = queryOptions.MustWithKV("category", "%"+req.Category+"%") |
32 | } | 32 | } |
33 | if len(req.TagName) > 0 { | 33 | if len(req.TagName) > 0 { |
34 | queryOptions = queryOptions.MustWithKV("name", "%"+req.TagName+"%") | 34 | queryOptions = queryOptions.MustWithKV("name", "%"+req.TagName+"%") |
@@ -137,14 +137,14 @@ type SystemArticleCommentSearchMeResponse struct { | @@ -137,14 +137,14 @@ type SystemArticleCommentSearchMeResponse struct { | ||
137 | } | 137 | } |
138 | 138 | ||
139 | type SystemArticleCommentSearchRequest struct { | 139 | type SystemArticleCommentSearchRequest struct { |
140 | - Page int `json:"page"` | ||
141 | - Size int `json:"size"` | ||
142 | - ArticleId int64 `json:"articleId"` // 文章ID | ||
143 | - TopId int64 `json:"topId,optional"` // 文章顶层ID | ||
144 | - AuthorId int64 `json:"authorId,optional"` // 用户 | ||
145 | - Show int `json:"show,optional"` // 显示状态 | ||
146 | - BeginTime int64 `json:"beginTime,optional"` // 开始时间 | ||
147 | - EndTime int64 `json:"endTime,optional"` // 结束时间 | 140 | + Page int `json:"page"` |
141 | + Size int `json:"size"` | ||
142 | + ArticleId int64 `json:"articleId"` // 文章ID | ||
143 | + TopId int64 `json:"topId,optional"` // 文章顶层ID | ||
144 | + Author string `json:"author,optional"` // 用户 | ||
145 | + Show int `json:"show,optional"` // 显示状态 | ||
146 | + BeginTime int64 `json:"beginTime,optional"` // 开始时间 | ||
147 | + EndTime int64 `json:"endTime,optional"` // 结束时间 | ||
148 | } | 148 | } |
149 | 149 | ||
150 | type SystemArticleCommentSearchResponse struct { | 150 | type SystemArticleCommentSearchResponse struct { |
@@ -149,6 +149,9 @@ func (repository *ArticleCommentRepository) Find(ctx context.Context, conn trans | @@ -149,6 +149,9 @@ func (repository *ArticleCommentRepository) Find(ctx context.Context, conn trans | ||
149 | if v, ok := queryOptions["endCreatedAt"]; ok { | 149 | if v, ok := queryOptions["endCreatedAt"]; ok { |
150 | tx = tx.Where("created_at < ?", v) | 150 | tx = tx.Where("created_at < ?", v) |
151 | } | 151 | } |
152 | + if v, ok := queryOptions["fromUserName"]; ok && v.(string) != "" { | ||
153 | + tx = tx.Where(`from_user #>> '{"name"}' like ?`, "%"+v.(string)+"%") | ||
154 | + } | ||
152 | 155 | ||
153 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { | 156 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { |
154 | return dms, tx.Error | 157 | return dms, tx.Error |
-
请 注册 或 登录 后发表评论