|
@@ -24,6 +24,17 @@ func ArticleRouters() {
|
24
|
24
|
beego.Router("/api/acticle/delete",&ArticleManage{},"Delete:DeleteCategorys")
|
25
|
25
|
beego.Router("/api/acticle/addvido",&ArticleManage{},"Post:Addvido")
|
26
|
26
|
beego.Router("/api/acticle/savedraft",&ArticleManage{},"Post:SaveDraft")
|
|
27
|
+ beego.Router("/api/acticle/prviewArticle",&ArticleManage{},"Post:PrviewArticle")
|
|
28
|
+ beego.Router("/api/acticle/getarticlePreview",&ArticleManage{},"Get:GetArtilcePreview")
|
|
29
|
+ beego.Router("/api/acticle/save",&ArticleManage{},"Post:AddDraft")
|
|
30
|
+ beego.Router("/api/acticle/getEditArticle",&ArticleManage{},"Get:GetArticleInfo")
|
|
31
|
+ beego.Router("/api/article/Delete",&ArticleManage{},"Delete:DeleteArticle")
|
|
32
|
+ beego.Router("/api/acticle/getMenus",&ArticleManage{},"Get:GetMenus")
|
|
33
|
+ beego.Router("/api/acticle/updateArticlesInfo",&ArticleManage{},"Post:UpdataArticleInfo")
|
|
34
|
+ beego.Router("/api/acticle/previewEditArticle",&ArticleManage{},"Post:PreviewEditArticle")
|
|
35
|
+ beego.Router("/api/acticle/getPreviewInfo",&ArticleManage{},"Post:GetPreviewInfo")
|
|
36
|
+ beego.Router("/api/acticle/getAllComment",&ArticleManage{},"Get:GetAllComment")
|
|
37
|
+ beego.Router("/api/acticle/getArticleCommentDetail",&ArticleManage{},"Get:GetArticleCommentDetail")
|
27
|
38
|
}
|
28
|
39
|
|
29
|
40
|
type ArticleManage struct {
|
|
@@ -108,10 +119,13 @@ func (this *ArticleManage) GetArticleType(){
|
108
|
119
|
|
109
|
120
|
func (this *ArticleManage) GetAllArticles() {
|
110
|
121
|
page, _ := this.GetInt64("page", 1)
|
|
122
|
+ fmt.Println("页面",page)
|
111
|
123
|
limit, _ := this.GetInt64("limit", 10)
|
112
|
|
- searchKey := this.GetString("search", "")
|
113
|
|
- classId,_ := this.GetInt64("classid",0)
|
114
|
|
- fmt.Println("页面",page,"限制",limit,"关键字",searchKey,"分类号",classId)
|
|
124
|
+ fmt.Println("限制",limit)
|
|
125
|
+ searchKey := this.GetString("keyword", "")
|
|
126
|
+ classId,_ := this.GetInt64("id",0)
|
|
127
|
+ status, _ := this.GetInt64("status")
|
|
128
|
+ fmt.Println("页面",page,"限制",limit,"关键字",searchKey,"分类号",classId,"状态值:",status)
|
115
|
129
|
|
116
|
130
|
if page <= 0 {
|
117
|
131
|
page = 1
|
|
@@ -119,10 +133,53 @@ func (this *ArticleManage) GetAllArticles() {
|
119
|
133
|
if limit <= 0 {
|
120
|
134
|
limit = 10
|
121
|
135
|
}
|
|
136
|
+
|
|
137
|
+
|
122
|
138
|
adminUserInfo := this.GetAdminUserInfo()
|
123
|
139
|
userOrgID := adminUserInfo.CurrentOrgId
|
124
|
140
|
|
125
|
|
- articles, total, err := article_service.FindAllArticle(userOrgID, page,limit, searchKey, classId)
|
|
141
|
+ if(status == 1){
|
|
142
|
+ articles, total, err := article_service.GetPublished(userOrgID, page, limit, searchKey)
|
|
143
|
+ category, err := article_service.FindCategoryList(userOrgID)
|
|
144
|
+ if err !=nil{
|
|
145
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取文章分类列表失败")
|
|
146
|
+ return
|
|
147
|
+ }
|
|
148
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
149
|
+ "articles":articles,
|
|
150
|
+ "total":total,
|
|
151
|
+ "category":category,
|
|
152
|
+ })
|
|
153
|
+ }
|
|
154
|
+ if(status == 2){
|
|
155
|
+ articles, total, err := article_service.GetDraftbox(userOrgID, page, limit, searchKey)
|
|
156
|
+ category, err := article_service.FindCategoryList(userOrgID)
|
|
157
|
+ if err !=nil{
|
|
158
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取文章分类列表失败")
|
|
159
|
+ return
|
|
160
|
+ }
|
|
161
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
162
|
+ "articles":articles,
|
|
163
|
+ "total":total,
|
|
164
|
+ "category":category,
|
|
165
|
+ })
|
|
166
|
+ }
|
|
167
|
+
|
|
168
|
+ if(status == 3){
|
|
169
|
+ articles, total, err := article_service.GetNoPass(userOrgID, page, limit, searchKey)
|
|
170
|
+ category, err := article_service.FindCategoryList(userOrgID)
|
|
171
|
+ if err !=nil{
|
|
172
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取文章分类列表失败")
|
|
173
|
+ return
|
|
174
|
+ }
|
|
175
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
176
|
+ "articles":articles,
|
|
177
|
+ "total":total,
|
|
178
|
+ "category":category,
|
|
179
|
+ })
|
|
180
|
+ }
|
|
181
|
+
|
|
182
|
+ articles, total, err := article_service.FindAllArticle(userOrgID, page,limit, searchKey,classId)
|
126
|
183
|
fmt.Println("文章内容是是么",articles)
|
127
|
184
|
fmt.Println("total",total)
|
128
|
185
|
fmt.Println("err",err)
|
|
@@ -453,4 +510,367 @@ func (this *ArticleManage) SaveDraft() {
|
453
|
510
|
this.ServeSuccessJSON(map[string]interface{}{
|
454
|
511
|
"savedraft":articles,
|
455
|
512
|
})
|
|
513
|
+}
|
|
514
|
+
|
|
515
|
+func (this *ArticleManage) PrviewArticle() {
|
|
516
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
517
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
518
|
+ dataBody := make(map[string]interface{}, 0)
|
|
519
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
520
|
+ fmt.Println("视频发布是什么呢",err)
|
|
521
|
+
|
|
522
|
+ if err != nil {
|
|
523
|
+ utils.ErrorLog(err.Error())
|
|
524
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
525
|
+ return
|
|
526
|
+ }
|
|
527
|
+
|
|
528
|
+ actname := dataBody["act_name"].(string)
|
|
529
|
+ if len(actname) == 0 {
|
|
530
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章标题不能为空")
|
|
531
|
+ return
|
|
532
|
+ }
|
|
533
|
+
|
|
534
|
+ actcontent := dataBody["act_content"].(string)
|
|
535
|
+ if len(actcontent) == 0 {
|
|
536
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章内容不能为空")
|
|
537
|
+ return
|
|
538
|
+ }
|
|
539
|
+
|
|
540
|
+ orglogo := dataBody["org_logo"].(string)
|
|
541
|
+ if len(orglogo) == 0 {
|
|
542
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "封面图片不能为空")
|
|
543
|
+ return
|
|
544
|
+ }
|
|
545
|
+
|
|
546
|
+ acttype := int64(dataBody["act_type"].(float64))
|
|
547
|
+ if acttype <= 0 {
|
|
548
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "分类号不能为空")
|
|
549
|
+ return
|
|
550
|
+ }
|
|
551
|
+
|
|
552
|
+ timenow := time.Now().Unix()
|
|
553
|
+ fmt.Println("姓名:",actname,"文章内容",actcontent,"图片",orglogo,"文章类型",acttype,userOrgID)
|
|
554
|
+ articles := models.Articles{
|
|
555
|
+ Title: actname,
|
|
556
|
+ Content: actcontent,
|
|
557
|
+ Imgs: orglogo,
|
|
558
|
+ ClassId: acttype,
|
|
559
|
+ UserOrgId:userOrgID,
|
|
560
|
+ Ctime:timenow,
|
|
561
|
+ Status:1,
|
|
562
|
+ Type:1,
|
|
563
|
+ ArticleStatus:3,
|
|
564
|
+ }
|
|
565
|
+ err = article_service.AddPrviewArticle(articles)
|
|
566
|
+ if err !=nil{
|
|
567
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加预览失败")
|
|
568
|
+ return
|
|
569
|
+ }
|
|
570
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
571
|
+ "art":articles,
|
|
572
|
+ })
|
|
573
|
+ fmt.Println("art是谁",articles)
|
|
574
|
+}
|
|
575
|
+
|
|
576
|
+func (this *ArticleManage) GetArtilcePreview() {
|
|
577
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
578
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
579
|
+ articles, err := article_service.GetArtilcePreview(userOrgID)
|
|
580
|
+ if err !=nil{
|
|
581
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取预览失败")
|
|
582
|
+ return
|
|
583
|
+ }
|
|
584
|
+ fmt.Println("文章内容",articles)
|
|
585
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
586
|
+ "articles":articles,
|
|
587
|
+ })
|
|
588
|
+
|
|
589
|
+}
|
|
590
|
+
|
|
591
|
+func (this *ArticleManage) AddDraft() {
|
|
592
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
593
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
594
|
+ dataBody := make(map[string]interface{}, 0)
|
|
595
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
596
|
+ fmt.Println("视频发布是什么呢", err)
|
|
597
|
+
|
|
598
|
+ if err != nil {
|
|
599
|
+ utils.ErrorLog(err.Error())
|
|
600
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
601
|
+ return
|
|
602
|
+ }
|
|
603
|
+ actname := dataBody["act_name"].(string)
|
|
604
|
+ if len(actname) == 0 {
|
|
605
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章标题不能为空")
|
|
606
|
+ return
|
|
607
|
+ }
|
|
608
|
+
|
|
609
|
+ actcontent := dataBody["act_content"].(string)
|
|
610
|
+ if len(actcontent) == 0 {
|
|
611
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章内容不能为空")
|
|
612
|
+ return
|
|
613
|
+ }
|
|
614
|
+
|
|
615
|
+ orglogo := dataBody["org_logo"].(string)
|
|
616
|
+ if len(orglogo) == 0 {
|
|
617
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "封面图片不能为空")
|
|
618
|
+ return
|
|
619
|
+ }
|
|
620
|
+
|
|
621
|
+ acttype := int64(dataBody["act_type"].(float64))
|
|
622
|
+ if acttype <= 0 {
|
|
623
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "分类号不能为空")
|
|
624
|
+ return
|
|
625
|
+ }
|
|
626
|
+
|
|
627
|
+ timenow := time.Now().Unix()
|
|
628
|
+ fmt.Println("姓名:", actname, "文章内容", actcontent, "图片", orglogo, "文章类型", acttype, userOrgID)
|
|
629
|
+ articles := models.Articles{
|
|
630
|
+ Title: actname,
|
|
631
|
+ Content: actcontent,
|
|
632
|
+ Imgs: orglogo,
|
|
633
|
+ ClassId: acttype,
|
|
634
|
+ UserOrgId: userOrgID,
|
|
635
|
+ Ctime: timenow,
|
|
636
|
+ Status: 1,
|
|
637
|
+ Type: 1,
|
|
638
|
+ ArticleStatus: 2,
|
|
639
|
+ }
|
|
640
|
+ err = article_service.AddDraft(articles)
|
|
641
|
+ if err !=nil{
|
|
642
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "保存草稿失败")
|
|
643
|
+ return
|
|
644
|
+ }
|
|
645
|
+ fmt.Println("文章内容",articles)
|
|
646
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
647
|
+ "articles":articles,
|
|
648
|
+ })
|
|
649
|
+}
|
|
650
|
+
|
|
651
|
+func (this *ArticleManage) GetArticleInfo() {
|
|
652
|
+ id, _ := this.GetInt64("id")
|
|
653
|
+ fmt.Println("id是啥",id)
|
|
654
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
655
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
656
|
+ articles, err := article_service.GetArticleInfo(userOrgID, id)
|
|
657
|
+ if err !=nil{
|
|
658
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "查询文章信息失败")
|
|
659
|
+ return
|
|
660
|
+ }
|
|
661
|
+ fmt.Println("内容是啥什么",articles)
|
|
662
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
663
|
+ "articles":articles,
|
|
664
|
+ })
|
|
665
|
+}
|
|
666
|
+
|
|
667
|
+func (this *ArticleManage) DeleteArticle() {
|
|
668
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
669
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
670
|
+
|
|
671
|
+ dataBody := make(map[string]interface{}, 0)
|
|
672
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
673
|
+ if err != nil {
|
|
674
|
+ utils.ErrorLog(err.Error())
|
|
675
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
676
|
+ return
|
|
677
|
+ }
|
|
678
|
+
|
|
679
|
+ idsInters := dataBody["ids"].([]interface{})
|
|
680
|
+ if len(idsInters) == 0 {
|
|
681
|
+ if err != nil {
|
|
682
|
+ this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除会员失败:(没有选择会员)")
|
|
683
|
+ return
|
|
684
|
+ }
|
|
685
|
+ }
|
|
686
|
+
|
|
687
|
+ ids := make([]int64, 0)
|
|
688
|
+ for _, idsInter := range idsInters {
|
|
689
|
+ id := int64(idsInter.(float64))
|
|
690
|
+ ids = append(ids, id)
|
|
691
|
+ }
|
|
692
|
+
|
|
693
|
+ err = article_service.DeleteArticle(ids, userOrgID)
|
|
694
|
+ if err !=nil{
|
|
695
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除失败")
|
|
696
|
+ return
|
|
697
|
+ }
|
|
698
|
+ returnData := make(map[string]interface{}, 0)
|
|
699
|
+ returnData["msg"] = "ok"
|
|
700
|
+ this.ServeSuccessJSON(returnData)
|
|
701
|
+ return
|
|
702
|
+}
|
|
703
|
+
|
|
704
|
+func (this *ArticleManage) GetMenus(){
|
|
705
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
706
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
707
|
+ categorys, err := article_service.GetMenus(userOrgID)
|
|
708
|
+ if err !=nil{
|
|
709
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "查询失败")
|
|
710
|
+ return
|
|
711
|
+ }
|
|
712
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
713
|
+ "categorys":categorys,
|
|
714
|
+ })
|
|
715
|
+}
|
|
716
|
+
|
|
717
|
+func (this * ArticleManage) UpdataArticleInfo(){
|
|
718
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
719
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
720
|
+ id, _ := this.GetInt64("id")
|
|
721
|
+ fmt.Println("id是多少",id)
|
|
722
|
+ dataBody := make(map[string]interface{}, 0)
|
|
723
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
724
|
+ fmt.Println("视频发布是什么呢",err)
|
|
725
|
+
|
|
726
|
+ if err != nil {
|
|
727
|
+ utils.ErrorLog(err.Error())
|
|
728
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
729
|
+ return
|
|
730
|
+ }
|
|
731
|
+
|
|
732
|
+ title := dataBody["title"].(string)
|
|
733
|
+ if len(title) == 0 {
|
|
734
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章标题不能为空")
|
|
735
|
+ return
|
|
736
|
+ }
|
|
737
|
+ fmt.Println("title",title)
|
|
738
|
+ content := dataBody["content"].(string)
|
|
739
|
+ if len(content) == 0 {
|
|
740
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "内容不能为空")
|
|
741
|
+ return
|
|
742
|
+ }
|
|
743
|
+ fmt.Println("content",content)
|
|
744
|
+ images := dataBody["imgs"].(string)
|
|
745
|
+ fmt.Println("images",images)
|
|
746
|
+ classid :=int64( dataBody["class_id"].(float64))
|
|
747
|
+ if classid <=0 {
|
|
748
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "分类号不能为空")
|
|
749
|
+ return
|
|
750
|
+ }
|
|
751
|
+ //classid, _ := strconv.ParseInt(class_id, 10, 64)
|
|
752
|
+ fmt.Println("分类号",classid)
|
|
753
|
+ fmt.Println("标题",title,"内容",content,"图片",images,"分类号",classid,"机构ID",userOrgID)
|
|
754
|
+
|
|
755
|
+ articles := models.Articles{
|
|
756
|
+ Title: title,
|
|
757
|
+ Content: content,
|
|
758
|
+ Imgs: images,
|
|
759
|
+ ClassId: classid,
|
|
760
|
+ Status: 1,
|
|
761
|
+ Mtime: time.Now().Unix(),
|
|
762
|
+ }
|
|
763
|
+ fmt.Println("为什么",articles)
|
|
764
|
+ article_service.UpdataArticleInfo(&articles,userOrgID, id)
|
|
765
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
766
|
+ "articls":articles,
|
|
767
|
+ })
|
|
768
|
+}
|
|
769
|
+
|
|
770
|
+func (this * ArticleManage) PreviewEditArticle() {
|
|
771
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
772
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
773
|
+ id, _ := this.GetInt64("id")
|
|
774
|
+ fmt.Println("id是多少",id)
|
|
775
|
+ dataBody := make(map[string]interface{}, 0)
|
|
776
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
777
|
+ fmt.Println("视频发布是什么呢",err)
|
|
778
|
+
|
|
779
|
+ if err != nil {
|
|
780
|
+ utils.ErrorLog(err.Error())
|
|
781
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
782
|
+ return
|
|
783
|
+ }
|
|
784
|
+
|
|
785
|
+ title := dataBody["title"].(string)
|
|
786
|
+ if len(title) == 0 {
|
|
787
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章标题不能为空")
|
|
788
|
+ return
|
|
789
|
+ }
|
|
790
|
+ fmt.Println("title",title)
|
|
791
|
+ content := dataBody["content"].(string)
|
|
792
|
+ if len(content) == 0 {
|
|
793
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "内容不能为空")
|
|
794
|
+ return
|
|
795
|
+ }
|
|
796
|
+ fmt.Println("content",content)
|
|
797
|
+ images := dataBody["imgs"].(string)
|
|
798
|
+ fmt.Println("images",images)
|
|
799
|
+ classid :=int64( dataBody["class_id"].(float64))
|
|
800
|
+ if classid <=0 {
|
|
801
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "分类号不能为空")
|
|
802
|
+ return
|
|
803
|
+ }
|
|
804
|
+ //classid, _ := strconv.ParseInt(class_id, 10, 64)
|
|
805
|
+ fmt.Println("分类号",classid)
|
|
806
|
+ fmt.Println("标题",title,"内容",content,"图片",images,"分类号",classid,"机构ID",userOrgID)
|
|
807
|
+
|
|
808
|
+ articles := models.Articles{
|
|
809
|
+ Title: title,
|
|
810
|
+ Content: content,
|
|
811
|
+ Imgs: images,
|
|
812
|
+ ClassId: classid,
|
|
813
|
+ Status: 1,
|
|
814
|
+ Mtime: time.Now().Unix(),
|
|
815
|
+ ArticleStatus:3,
|
|
816
|
+ }
|
|
817
|
+
|
|
818
|
+ article_service.PreviewEditArticle(articles,userOrgID,id)
|
|
819
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
820
|
+ "articls":articles,
|
|
821
|
+ })
|
|
822
|
+}
|
|
823
|
+
|
|
824
|
+func (this * ArticleManage) GetPreviewInfo() {
|
|
825
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
826
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
827
|
+ articles, err := article_service.GetPreviewInfo(userOrgID)
|
|
828
|
+ if err !=nil{
|
|
829
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取预览失败")
|
|
830
|
+ return
|
|
831
|
+ }
|
|
832
|
+ fmt.Println("文章内容",articles)
|
|
833
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
834
|
+ "articles":articles,
|
|
835
|
+ })
|
|
836
|
+}
|
|
837
|
+
|
|
838
|
+func (this * ArticleManage) GetAllComment() {
|
|
839
|
+ page, _ := this.GetInt64("page", 1)
|
|
840
|
+ fmt.Println("页面",page)
|
|
841
|
+ limit, _ := this.GetInt64("limit", 10)
|
|
842
|
+ fmt.Println("限制",limit)
|
|
843
|
+ if page <= 0 {
|
|
844
|
+ page = 1
|
|
845
|
+ }
|
|
846
|
+ if limit <= 0 {
|
|
847
|
+ limit = 10
|
|
848
|
+ }
|
|
849
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
850
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
851
|
+ articles, total, err := article_service.GetAllComment(page, limit, userOrgID)
|
|
852
|
+ fmt.Println("文章内容",articles)
|
|
853
|
+ if err !=nil{
|
|
854
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取预览失败")
|
|
855
|
+ return
|
|
856
|
+ }
|
|
857
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
858
|
+ "total":total,
|
|
859
|
+ "articles":articles,
|
|
860
|
+ })
|
|
861
|
+}
|
|
862
|
+
|
|
863
|
+func (this * ArticleManage) GetArticleCommentDetail(){
|
|
864
|
+ id, _ := this.GetInt64("id")
|
|
865
|
+ fmt.Println("id是多少",id)
|
|
866
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
867
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
868
|
+ articles, err := article_service.GetArticleCommentDetail(id, userOrgID)
|
|
869
|
+ if err !=nil{
|
|
870
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取预览失败")
|
|
871
|
+ return
|
|
872
|
+ }
|
|
873
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
874
|
+ "articles":articles,
|
|
875
|
+ })
|
456
|
876
|
}
|