|
|
@@ -633,6 +633,51 @@ export async function UpdateYJBDCArticleReadCount(ctx) {
|
|
633
|
633
|
ctx.body = {"errcode": 10000};
|
|
634
|
634
|
}
|
|
635
|
635
|
|
|
|
636
|
+export async function AddOrDeleteYJBDCUserCollect(ctx) {
|
|
|
637
|
+ const param = {
|
|
|
638
|
+ UserID: ctx.query.UserID || 0,
|
|
|
639
|
+ Word: ctx.query.Word || '',
|
|
|
640
|
+ CreateTime:moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
641
|
+ };
|
|
|
642
|
+
|
|
|
643
|
+ let list=await yjbdc.GetYJBDCUserCollect(param);
|
|
|
644
|
+ if (list && list.length>0)
|
|
|
645
|
+ await yjbdc.DeleteYJBDCUserCollect(param);
|
|
|
646
|
+ else
|
|
|
647
|
+ await yjbdc.AddYJBDCUserCollect(param);
|
|
|
648
|
+
|
|
|
649
|
+ let param2={}
|
|
|
650
|
+ param2.UserID=param.UserID;
|
|
|
651
|
+ let result=await yjbdc.GetYJBDCUserCollect(param2);
|
|
|
652
|
+ ctx.body = {"errcode": 10000,result:result};
|
|
|
653
|
+}
|
|
|
654
|
+
|
|
|
655
|
+export async function DeleteYJBDCUserCollect(ctx) {
|
|
|
656
|
+ const param = {
|
|
|
657
|
+ UserID: ctx.query.UserID || 0,
|
|
|
658
|
+ WordArr:ctx.query.WordArr || "",
|
|
|
659
|
+ };
|
|
|
660
|
+
|
|
|
661
|
+ let arr=param.WordArr.split(",");
|
|
|
662
|
+ for(let i=0;i<arr.length;i++){
|
|
|
663
|
+ let obj={};
|
|
|
664
|
+ obj.UserID=param.UserID;
|
|
|
665
|
+ obj.Word=arr[i];
|
|
|
666
|
+ await yjbdc.DeleteYJBDCUserCollect(obj);
|
|
|
667
|
+ }
|
|
|
668
|
+ ctx.body = {"errcode": 10000};
|
|
|
669
|
+}
|
|
|
670
|
+
|
|
|
671
|
+export async function GetYJBDCUserCollect(ctx) {
|
|
|
672
|
+ const param = {
|
|
|
673
|
+ UserID: ctx.query.UserID || 0,
|
|
|
674
|
+ };
|
|
|
675
|
+
|
|
|
676
|
+ let list=await yjbdc.GetYJBDCUserCollect(param);
|
|
|
677
|
+
|
|
|
678
|
+ ctx.body = {"errcode": 10000,result:list};
|
|
|
679
|
+}
|
|
|
680
|
+
|
|
636
|
681
|
//生成PDF
|
|
637
|
682
|
export async function GeneratePDF(ctx) {
|
|
638
|
683
|
const params = ctx.request.body;
|