Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss into dev-zhuang
正在显示
8 个修改的文件
包含
20 行增加
和
14 行删除
| @@ -248,7 +248,7 @@ type ( | @@ -248,7 +248,7 @@ type ( | ||
| 248 | MiniArticleDraftGetMeResponse { | 248 | MiniArticleDraftGetMeResponse { |
| 249 | Id int64 `json:"id"` // | 249 | Id int64 `json:"id"` // |
| 250 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | 250 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 |
| 251 | - Section []string `json:"Section"` // 填写的内容 | 251 | + Section []string `json:"section"` // 填写的内容 |
| 252 | Title string `json:"title"` // 标题 | 252 | Title string `json:"title"` // 标题 |
| 253 | Images []string `json:"images"` // 图片 | 253 | Images []string `json:"images"` // 图片 |
| 254 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 254 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| @@ -71,9 +71,9 @@ type ( | @@ -71,9 +71,9 @@ type ( | ||
| 71 | Id int64 `json:"id"` | 71 | Id int64 `json:"id"` |
| 72 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID | 72 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID |
| 73 | CompanyName string `json:"companyName,omitempty"` // 公司名称 | 73 | CompanyName string `json:"companyName,omitempty"` // 公司名称 |
| 74 | - Name string `json:"name,omitempty"` // 名称 | ||
| 75 | - Avatar string `json:"avatar,omitempty"` // 头像 | ||
| 76 | - Position string `json:"position,omitempty"` // 职位 | 74 | + Name string `json:"name"` // 名称 |
| 75 | + Avatar string `json:"avatar"` // 头像 | ||
| 76 | + Position string `json:"position"` // 职位 | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | 79 |
| @@ -51,6 +51,8 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr | @@ -51,6 +51,8 @@ func (l *MiniArticleMarkUserReadLogic) MiniArticleMarkUserRead(req *types.MiniAr | ||
| 51 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) | 51 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) |
| 52 | } | 52 | } |
| 53 | if len(markRecord) > 0 { | 53 | if len(markRecord) > 0 { |
| 54 | + markRecord[0].Author = articleData.Author | ||
| 55 | + markRecord[0].Title = articleData.Title | ||
| 54 | _, err = l.svcCtx.UserReadArticleRepository.Update(l.ctx, conn, markRecord[0]) | 56 | _, err = l.svcCtx.UserReadArticleRepository.Update(l.ctx, conn, markRecord[0]) |
| 55 | if err != nil { | 57 | if err != nil { |
| 56 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) | 58 | return nil, xerr.NewErrMsgErr("标记浏览记录失败", err) |
| @@ -170,11 +170,11 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR | @@ -170,11 +170,11 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR | ||
| 170 | } | 170 | } |
| 171 | //设置内容概要 | 171 | //设置内容概要 |
| 172 | if len(sectionList) > 0 { | 172 | if len(sectionList) > 0 { |
| 173 | - // 截取内容 30个字 | 173 | + // 截取内容 50个字 |
| 174 | runeNumber := 0 //字数 | 174 | runeNumber := 0 //字数 |
| 175 | stringIndex := 0 //字符串长度 | 175 | stringIndex := 0 //字符串长度 |
| 176 | for i := range sectionList[0].Content { | 176 | for i := range sectionList[0].Content { |
| 177 | - if runeNumber > 30 { | 177 | + if runeNumber > 50 { |
| 178 | break | 178 | break |
| 179 | } | 179 | } |
| 180 | runeNumber += 1 | 180 | runeNumber += 1 |
| @@ -52,6 +52,7 @@ func (l *MiniSearchArticleDraftMeLogic) MiniSearchArticleDraftMe(req *types.Mini | @@ -52,6 +52,7 @@ func (l *MiniSearchArticleDraftMeLogic) MiniSearchArticleDraftMe(req *types.Mini | ||
| 52 | Section: draftList[i].Content, | 52 | Section: draftList[i].Content, |
| 53 | Title: draftList[i].Title, | 53 | Title: draftList[i].Title, |
| 54 | Images: images, | 54 | Images: images, |
| 55 | + CreatedAt: draftList[i].CreatedAt, | ||
| 55 | } | 56 | } |
| 56 | } | 57 | } |
| 57 | return resp, nil | 58 | return resp, nil |
| @@ -4,6 +4,8 @@ import ( | @@ -4,6 +4,8 @@ import ( | ||
| 4 | "context" | 4 | "context" |
| 5 | "strconv" | 5 | "strconv" |
| 6 | 6 | ||
| 7 | + "strings" | ||
| 8 | + | ||
| 7 | "github.com/samber/lo" | 9 | "github.com/samber/lo" |
| 8 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction" | 10 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction" |
| 9 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" | 11 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" |
| @@ -11,7 +13,6 @@ import ( | @@ -11,7 +13,6 @@ import ( | ||
| 11 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata" | 13 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata" |
| 12 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/tool/oss" | 14 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/tool/oss" |
| 13 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr" | 15 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr" |
| 14 | - "strings" | ||
| 15 | 16 | ||
| 16 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | 17 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" |
| 17 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | 18 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" |
| @@ -147,11 +148,11 @@ func (l *SystemUpdateArticleLogic) SystemUpdateArticle(req *types.SystemArticleU | @@ -147,11 +148,11 @@ func (l *SystemUpdateArticleLogic) SystemUpdateArticle(req *types.SystemArticleU | ||
| 147 | }) | 148 | }) |
| 148 | //设置内容概要 | 149 | //设置内容概要 |
| 149 | if len(req.Section) > 0 { | 150 | if len(req.Section) > 0 { |
| 150 | - // 截取内容 30个字 | 151 | + // 截取内容 50个字 |
| 151 | runeNumber := 0 //字数 | 152 | runeNumber := 0 //字数 |
| 152 | stringIndex := 0 //字符串长度 | 153 | stringIndex := 0 //字符串长度 |
| 153 | for i := range req.Section[0].Content { | 154 | for i := range req.Section[0].Content { |
| 154 | - if runeNumber > 30 { | 155 | + if runeNumber > 50 { |
| 155 | break | 156 | break |
| 156 | } | 157 | } |
| 157 | runeNumber += 1 | 158 | runeNumber += 1 |
| @@ -296,9 +296,9 @@ type SimpleUser struct { | @@ -296,9 +296,9 @@ type SimpleUser struct { | ||
| 296 | Id int64 `json:"id"` | 296 | Id int64 `json:"id"` |
| 297 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID | 297 | CompanyId int64 `json:"companyId,omitempty"` // 公司ID |
| 298 | CompanyName string `json:"companyName,omitempty"` // 公司名称 | 298 | CompanyName string `json:"companyName,omitempty"` // 公司名称 |
| 299 | - Name string `json:"name,omitempty"` // 名称 | ||
| 300 | - Avatar string `json:"avatar,omitempty"` // 头像 | ||
| 301 | - Position string `json:"position,omitempty"` // 职位 | 299 | + Name string `json:"name"` // 名称 |
| 300 | + Avatar string `json:"avatar"` // 头像 | ||
| 301 | + Position string `json:"position"` // 职位 | ||
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | type SimpleArticle struct { | 304 | type SimpleArticle struct { |
| @@ -949,7 +949,7 @@ type MiniArticleDraftGetMeRequest struct { | @@ -949,7 +949,7 @@ type MiniArticleDraftGetMeRequest struct { | ||
| 949 | type MiniArticleDraftGetMeResponse struct { | 949 | type MiniArticleDraftGetMeResponse struct { |
| 950 | Id int64 `json:"id"` // | 950 | Id int64 `json:"id"` // |
| 951 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | 951 | Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 |
| 952 | - Section []string `json:"Section"` // 填写的内容 | 952 | + Section []string `json:"section"` // 填写的内容 |
| 953 | Title string `json:"title"` // 标题 | 953 | Title string `json:"title"` // 标题 |
| 954 | Images []string `json:"images"` // 图片 | 954 | Images []string `json:"images"` // 图片 |
| 955 | WhoRead []int64 `json:"whoRead"` // 谁可以看 | 955 | WhoRead []int64 `json:"whoRead"` // 谁可以看 |
| @@ -136,7 +136,9 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction. | @@ -136,7 +136,9 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction. | ||
| 136 | if v, ok := queryOptions["endCreatedAt"]; ok { | 136 | if v, ok := queryOptions["endCreatedAt"]; ok { |
| 137 | tx = tx.Where("created_at < ?", v) | 137 | tx = tx.Where("created_at < ?", v) |
| 138 | } | 138 | } |
| 139 | - | 139 | + if v, ok := queryOptions["authorId"]; ok { |
| 140 | + tx = tx.Where("author_id=?", v) | ||
| 141 | + } | ||
| 140 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { | 142 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { |
| 141 | return dms, tx.Error | 143 | return dms, tx.Error |
| 142 | } | 144 | } |
-
请 注册 或 登录 后发表评论