作者 yangfu
... ... @@ -230,7 +230,7 @@ type (
Size int `json:"size"`
ArticleId int64 `json:"articleId"` // 文章ID
TopId int64 `json:"topId,optional"` // 文章顶层ID
AuthorId int64 `json:"authorId,optional"` // 用户
Author string `json:"author,optional"` // 用户
Show int `json:"show,optional"` // 显示状态
BeginTime int64 `json:"beginTime,optional"` // 开始时间
EndTime int64 `json:"endTime,optional"` // 结束时间
... ...
... ... @@ -32,7 +32,8 @@ func (l *SystemArticleCommentSearchLogic) SystemArticleCommentSearch(req *types.
WithOffsetLimit(req.Page, req.Size).
WithKV("articleId", req.ArticleId).
WithKV("topId", req.TopId).
WithKV("fromUserId", req.AuthorId).
WithKV("show", req.Show).
WithKV("fromUserName", req.Author).
WithKV("beginCreatedAt", req.BeginTime).
WithKV("endCreatedAt", req.EndTime)
total, comments, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, queryOptions)
... ...
... ... @@ -41,9 +41,9 @@ func (l *SystemGetLogic) SystemGet(req *types.DepartmentGetRequest) (resp *types
if err != nil {
return nil, err
}
ids := make([]int64, 0)
var userIds = make([]int64, 0)
for i := range users {
ids = append(ids, users[i].Id)
userIds = append(userIds, users[i].Id)
}
resp = &types.DepartmentGetResponse{
Department: types.Department{
... ... @@ -51,7 +51,7 @@ func (l *SystemGetLogic) SystemGet(req *types.DepartmentGetRequest) (resp *types
CompanyId: department.CompanyId,
ParentId: department.ParentId,
Name: department.Name,
UserIds: ids,
UserIds: userIds,
},
}
return resp, nil
... ...
... ... @@ -28,7 +28,7 @@ func (l *SearchTagLogic) SearchTag(req *types.TagListRequest) (resp *types.TagLi
queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size)
if len(req.Category) > 0 {
queryOptions = queryOptions.MustWithKV("group", "%"+req.Category+"%")
queryOptions = queryOptions.MustWithKV("category", "%"+req.Category+"%")
}
if len(req.TagName) > 0 {
queryOptions = queryOptions.MustWithKV("name", "%"+req.TagName+"%")
... ...
... ... @@ -137,14 +137,14 @@ type SystemArticleCommentSearchMeResponse struct {
}
type SystemArticleCommentSearchRequest struct {
Page int `json:"page"`
Size int `json:"size"`
ArticleId int64 `json:"articleId"` // 文章ID
TopId int64 `json:"topId,optional"` // 文章顶层ID
AuthorId int64 `json:"authorId,optional"` // 用户
Show int `json:"show,optional"` // 显示状态
BeginTime int64 `json:"beginTime,optional"` // 开始时间
EndTime int64 `json:"endTime,optional"` // 结束时间
Page int `json:"page"`
Size int `json:"size"`
ArticleId int64 `json:"articleId"` // 文章ID
TopId int64 `json:"topId,optional"` // 文章顶层ID
Author string `json:"author,optional"` // 用户
Show int `json:"show,optional"` // 显示状态
BeginTime int64 `json:"beginTime,optional"` // 开始时间
EndTime int64 `json:"endTime,optional"` // 结束时间
}
type SystemArticleCommentSearchResponse struct {
... ...
... ... @@ -149,6 +149,9 @@ func (repository *ArticleCommentRepository) Find(ctx context.Context, conn trans
if v, ok := queryOptions["endCreatedAt"]; ok {
tx = tx.Where("created_at < ?", v)
}
if v, ok := queryOptions["fromUserName"]; ok && v.(string) != "" {
tx = tx.Where(`from_user #>> '{"name"}' like ?`, "%"+v.(string)+"%")
}
if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
return dms, tx.Error
... ...