作者 yangfu

Merge branch 'dev' into test

@@ -40,3 +40,4 @@ ApiAuth: @@ -40,3 +40,4 @@ ApiAuth:
40 Wechat: 40 Wechat:
41 AppID: wxae5b305849343ec8 41 AppID: wxae5b305849343ec8
42 AppSecret: f584adb68f7d784425b60e1ebb2ffd4b 42 AppSecret: f584adb68f7d784425b60e1ebb2ffd4b
  43 + QrcodeEnv: "develop"
@@ -292,15 +292,19 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq @@ -292,15 +292,19 @@ func (l *SystemCreateArticleLogic) getSections(req *types.SystemArticleCreateReq
292 sortBy := 1 292 sortBy := 1
293 sections := strings.Split(req.Content, "\n") 293 sections := strings.Split(req.Content, "\n")
294 lo.ForEach(sections, func(item string, index int) { 294 lo.ForEach(sections, func(item string, index int) {
295 - section := domain.ArticleSection{  
296 - CompanyId: article.CompanyId,  
297 - Version: article.Version,  
298 - ArticleId: article.Id,  
299 - Content: item,  
300 - SortBy: sortBy, 295 + //去除空
  296 + item = strings.TrimSpace(item)
  297 + if item != "" {
  298 + section := domain.ArticleSection{
  299 + CompanyId: article.CompanyId,
  300 + Version: article.Version,
  301 + ArticleId: article.Id,
  302 + Content: item,
  303 + SortBy: sortBy,
  304 + }
  305 + articleSections = append(articleSections, &section)
  306 + sortBy++
301 } 307 }
302 - articleSections = append(articleSections, &section)  
303 - sortBy++  
304 }) 308 })
305 return articleSections 309 return articleSections
306 } 310 }
@@ -80,7 +80,7 @@ func (l *SystemDeleteArticleLogic) SystemDeleteArticle(req *types.SystemArticleD @@ -80,7 +80,7 @@ func (l *SystemDeleteArticleLogic) SystemDeleteArticle(req *types.SystemArticleD
80 //消息通知 80 //消息通知
81 messageLogic := message.NewMiniSystemLogic(l.ctx, l.svcCtx) 81 messageLogic := message.NewMiniSystemLogic(l.ctx, l.svcCtx)
82 mTime := time.Unix(article.CreatedAt, 0).Format("2006-01-02 15:04") 82 mTime := time.Unix(article.CreatedAt, 0).Format("2006-01-02 15:04")
83 - err = messageLogic.ArticleDeleted(conn, article.CompanyId, article.AuthorId, mTime) 83 + err = messageLogic.ArticleDeleted(conn, article.CompanyId, article.AuthorId, mTime, article.Title)
84 if err != nil { 84 if err != nil {
85 return xerr.NewErrMsgErr("删除失败", err) 85 return xerr.NewErrMsgErr("删除失败", err)
86 } 86 }
@@ -56,7 +56,7 @@ func (l *MiniQrcodeInviteLogic) MiniQrcodeInvite(req *types.MiniQrCodeRequest) ( @@ -56,7 +56,7 @@ func (l *MiniQrcodeInviteLogic) MiniQrcodeInvite(req *types.MiniQrCodeRequest) (
56 Path: req.Page, 56 Path: req.Page,
57 Scene: req.Scene, 57 Scene: req.Scene,
58 CheckPath: lo.ToPtr(false), 58 CheckPath: lo.ToPtr(false),
59 - EnvVersion: "release", 59 + EnvVersion: l.svcCtx.Config.Wechat.QrcodeEnv,
60 }) 60 })
61 if err != nil { 61 if err != nil {
62 return nil, xerr.NewErr(err) 62 return nil, xerr.NewErr(err)
@@ -58,8 +58,8 @@ func (l *MiniSystemLogic) ArticleDefined(conn transaction.Conn, companyId, at in @@ -58,8 +58,8 @@ func (l *MiniSystemLogic) ArticleDefined(conn transaction.Conn, companyId, at in
58 } 58 }
59 59
60 // ArticleDeleted 帖子删除 60 // ArticleDeleted 帖子删除
61 -func (l *MiniSystemLogic) ArticleDeleted(conn transaction.Conn, companyId, at int64, item string) (err error) {  
62 - return l.createMessage(conn, companyId, at, domain.MsgTypeNormal, "帖子已删除", fmt.Sprintf("你于%v发布的帖子已被删除,如有疑问,请联系运营管理员了解详情。", item)) 61 +func (l *MiniSystemLogic) ArticleDeleted(conn transaction.Conn, companyId, at int64, createdTime, title string) (err error) {
  62 + return l.createMessage(conn, companyId, at, domain.MsgTypeDeleted, "帖子已删除", fmt.Sprintf("你于%v发布的帖子[%v]已被删除,如有疑问,请联系运营管理员了解详情。", createdTime, title))
63 } 63 }
64 64
65 //// ArticleAuth 文章权限变更 65 //// ArticleAuth 文章权限变更
@@ -21,8 +21,9 @@ type MessageSystem struct { @@ -21,8 +21,9 @@ type MessageSystem struct {
21 type MsgSystemType int 21 type MsgSystemType int
22 22
23 const ( 23 const (
24 - MsgTypeNormal MsgSystemType = 1  
25 - MsgTypeAbnormal MsgSystemType = 2 24 + MsgTypeNormal MsgSystemType = 1 //1业务正常通知
  25 + MsgTypeAbnormal MsgSystemType = 2 //2业务异常通知
  26 + MsgTypeDeleted MsgSystemType = 3 //3帖子删除通知
26 ) 27 )
27 28
28 type MessageSystemRepository interface { 29 type MessageSystemRepository interface {
@@ -72,6 +72,7 @@ type Wechat struct { @@ -72,6 +72,7 @@ type Wechat struct {
72 AppName string `json:",optional"` 72 AppName string `json:",optional"`
73 AppID string 73 AppID string
74 AppSecret string 74 AppSecret string
  75 + QrcodeEnv string `json:",optional,default=release"`
75 MsgTemplates []Template `json:",optional"` 76 MsgTemplates []Template `json:",optional"`
76 } 77 }
77 78