作者 tangxvhui

Merge branch 'dev' into test

@@ -15,6 +15,58 @@ @@ -15,6 +15,58 @@
15 "application/json" 15 "application/json"
16 ], 16 ],
17 "paths": { 17 "paths": {
  18 + "v1/common/sms/code": {
  19 + "post": {
  20 + "summary": "短信验证码",
  21 + "operationId": "commonSmsCode",
  22 + "responses": {
  23 + "200": {
  24 + "description": "A successful response.",
  25 + "schema": {
  26 + "$ref": "#/definitions/CommonSmsCodeResposne"
  27 + }
  28 + }
  29 + },
  30 + "parameters": [
  31 + {
  32 + "name": "body",
  33 + "in": "body",
  34 + "required": true,
  35 + "schema": {
  36 + "$ref": "#/definitions/CommonSmsCodeRequest"
  37 + }
  38 + }
  39 + ],
  40 + "requestBody": {},
  41 + "tags": [
  42 + "common"
  43 + ]
  44 + }
  45 + },
  46 + "v1/log/{module}": {
  47 + "get": {
  48 + "summary": "日志查询",
  49 + "operationId": "commonGetLog",
  50 + "responses": {
  51 + "200": {
  52 + "description": "A successful response.",
  53 + "schema": {}
  54 + }
  55 + },
  56 + "parameters": [
  57 + {
  58 + "name": "module",
  59 + "in": "path",
  60 + "required": true,
  61 + "type": "string"
  62 + }
  63 + ],
  64 + "requestBody": {},
  65 + "tags": [
  66 + "common"
  67 + ]
  68 + }
  69 + },
18 "v1/mini/article": { 70 "v1/mini/article": {
19 "post": { 71 "post": {
20 "summary": "小程序创建发布内容", 72 "summary": "小程序创建发布内容",
@@ -667,10 +719,38 @@ @@ -667,10 +719,38 @@
667 ] 719 ]
668 } 720 }
669 }, 721 },
670 - "v1/mini/message/business": { 722 + "v1/mini/message/comment": {
  723 + "post": {
  724 + "summary": "评论消息",
  725 + "operationId": "miniComment",
  726 + "responses": {
  727 + "200": {
  728 + "description": "A successful response.",
  729 + "schema": {
  730 + "$ref": "#/definitions/MessageBusinessResponse"
  731 + }
  732 + }
  733 + },
  734 + "parameters": [
  735 + {
  736 + "name": "body",
  737 + "in": "body",
  738 + "required": true,
  739 + "schema": {
  740 + "$ref": "#/definitions/MessageRequest"
  741 + }
  742 + }
  743 + ],
  744 + "requestBody": {},
  745 + "tags": [
  746 + "message"
  747 + ]
  748 + }
  749 + },
  750 + "v1/mini/message/like": {
671 "post": { 751 "post": {
672 - "summary": "业务消息",  
673 - "operationId": "miniBusiness", 752 + "summary": "点赞消息",
  753 + "operationId": "miniLike",
674 "responses": { 754 "responses": {
675 "200": { 755 "200": {
676 "description": "A successful response.", 756 "description": "A successful response.",
@@ -685,7 +765,7 @@ @@ -685,7 +765,7 @@
685 "in": "body", 765 "in": "body",
686 "required": true, 766 "required": true,
687 "schema": { 767 "schema": {
688 - "$ref": "#/definitions/MessageBusinessRequest" 768 + "$ref": "#/definitions/MessageRequest"
689 } 769 }
690 } 770 }
691 ], 771 ],
@@ -713,7 +793,7 @@ @@ -713,7 +793,7 @@
713 "in": "body", 793 "in": "body",
714 "required": true, 794 "required": true,
715 "schema": { 795 "schema": {
716 - "$ref": "#/definitions/MessageSystemRequest" 796 + "$ref": "#/definitions/MessageRequest"
717 } 797 }
718 } 798 }
719 ], 799 ],
@@ -1069,6 +1149,34 @@ @@ -1069,6 +1149,34 @@
1069 ] 1149 ]
1070 } 1150 }
1071 }, 1151 },
  1152 + "v1/mini/user/mylike": {
  1153 + "post": {
  1154 + "summary": "我点赞的文章或评论",
  1155 + "operationId": "miniMyLike",
  1156 + "responses": {
  1157 + "200": {
  1158 + "description": "A successful response.",
  1159 + "schema": {
  1160 + "$ref": "#/definitions/MiniMyLikeResponse"
  1161 + }
  1162 + }
  1163 + },
  1164 + "parameters": [
  1165 + {
  1166 + "name": "body",
  1167 + "in": "body",
  1168 + "required": true,
  1169 + "schema": {
  1170 + "$ref": "#/definitions/MiniMyLikeRequest"
  1171 + }
  1172 + }
  1173 + ],
  1174 + "requestBody": {},
  1175 + "tags": [
  1176 + "user"
  1177 + ]
  1178 + }
  1179 + },
1072 "v1/mini/user/news": { 1180 "v1/mini/user/news": {
1073 "post": { 1181 "post": {
1074 "summary": "用户快讯", 1182 "summary": "用户快讯",
@@ -1541,6 +1649,90 @@ @@ -1541,6 +1649,90 @@
1541 ] 1649 ]
1542 } 1650 }
1543 }, 1651 },
  1652 + "v1/system/article_comment/edit": {
  1653 + "post": {
  1654 + "summary": "管理后台变更评论",
  1655 + "operationId": "SystemEditAticleComment",
  1656 + "responses": {
  1657 + "200": {
  1658 + "description": "A successful response.",
  1659 + "schema": {
  1660 + "$ref": "#/definitions/SystemEditCommentResponse"
  1661 + }
  1662 + }
  1663 + },
  1664 + "parameters": [
  1665 + {
  1666 + "name": "body",
  1667 + "in": "body",
  1668 + "required": true,
  1669 + "schema": {
  1670 + "$ref": "#/definitions/SystemEditCommentRequest"
  1671 + }
  1672 + }
  1673 + ],
  1674 + "requestBody": {},
  1675 + "tags": [
  1676 + "comment"
  1677 + ]
  1678 + }
  1679 + },
  1680 + "v1/system/article_comment/edit_show": {
  1681 + "post": {
  1682 + "summary": "管理后台变更评论的显示状态",
  1683 + "operationId": "SystemEditAticleCommentShow",
  1684 + "responses": {
  1685 + "200": {
  1686 + "description": "A successful response.",
  1687 + "schema": {
  1688 + "$ref": "#/definitions/SystemEditCommentShowResponse"
  1689 + }
  1690 + }
  1691 + },
  1692 + "parameters": [
  1693 + {
  1694 + "name": "body",
  1695 + "in": "body",
  1696 + "required": true,
  1697 + "schema": {
  1698 + "$ref": "#/definitions/SystemEditCommentShowRequest"
  1699 + }
  1700 + }
  1701 + ],
  1702 + "requestBody": {},
  1703 + "tags": [
  1704 + "comment"
  1705 + ]
  1706 + }
  1707 + },
  1708 + "v1/system/article_comment/list": {
  1709 + "post": {
  1710 + "summary": "管理后台查看所有的评论",
  1711 + "operationId": "SystemListAticleComment",
  1712 + "responses": {
  1713 + "200": {
  1714 + "description": "A successful response.",
  1715 + "schema": {
  1716 + "$ref": "#/definitions/SystemListCommentResponse"
  1717 + }
  1718 + }
  1719 + },
  1720 + "parameters": [
  1721 + {
  1722 + "name": "body",
  1723 + "in": "body",
  1724 + "required": true,
  1725 + "schema": {
  1726 + "$ref": "#/definitions/SystemListCommentRequest"
  1727 + }
  1728 + }
  1729 + ],
  1730 + "requestBody": {},
  1731 + "tags": [
  1732 + "comment"
  1733 + ]
  1734 + }
  1735 + },
1544 "v1/system/article_comment/search": { 1736 "v1/system/article_comment/search": {
1545 "post": { 1737 "post": {
1546 "summary": "管理后台文章评论列表", 1738 "summary": "管理后台文章评论列表",
@@ -1597,6 +1789,32 @@ @@ -1597,6 +1789,32 @@
1597 ] 1789 ]
1598 } 1790 }
1599 }, 1791 },
  1792 + "v1/system/article_comment/{id}": {
  1793 + "get": {
  1794 + "summary": "管理后台评论的详情",
  1795 + "operationId": "SystemGetAticleComment",
  1796 + "responses": {
  1797 + "200": {
  1798 + "description": "A successful response.",
  1799 + "schema": {
  1800 + "$ref": "#/definitions/SystemGetCommentResponse"
  1801 + }
  1802 + }
  1803 + },
  1804 + "parameters": [
  1805 + {
  1806 + "name": "id",
  1807 + "in": "path",
  1808 + "required": true,
  1809 + "type": "string"
  1810 + }
  1811 + ],
  1812 + "requestBody": {},
  1813 + "tags": [
  1814 + "comment"
  1815 + ]
  1816 + }
  1817 + },
1600 "v1/system/article_tag": { 1818 "v1/system/article_tag": {
1601 "post": { 1819 "post": {
1602 "summary": "后台创建文章标签", 1820 "summary": "后台创建文章标签",
@@ -1755,6 +1973,34 @@ @@ -1755,6 +1973,34 @@
1755 ] 1973 ]
1756 } 1974 }
1757 }, 1975 },
  1976 + "v1/system/company/positions/search": {
  1977 + "post": {
  1978 + "summary": "公司职位搜索",
  1979 + "operationId": "systemCompanyPositionsSearch",
  1980 + "responses": {
  1981 + "200": {
  1982 + "description": "A successful response.",
  1983 + "schema": {
  1984 + "$ref": "#/definitions/CompanyPositionsSearchResponse"
  1985 + }
  1986 + }
  1987 + },
  1988 + "parameters": [
  1989 + {
  1990 + "name": "body",
  1991 + "in": "body",
  1992 + "required": true,
  1993 + "schema": {
  1994 + "$ref": "#/definitions/CompanyPositionsSearchRequest"
  1995 + }
  1996 + }
  1997 + ],
  1998 + "requestBody": {},
  1999 + "tags": [
  2000 + "company"
  2001 + ]
  2002 + }
  2003 + },
1758 "v1/system/company/search": { 2004 "v1/system/company/search": {
1759 "post": { 2005 "post": {
1760 "summary": "公司搜索", 2006 "summary": "公司搜索",
@@ -2242,34 +2488,6 @@ @@ -2242,34 +2488,6 @@
2242 "user" 2488 "user"
2243 ] 2489 ]
2244 } 2490 }
2245 - },  
2246 - "v1/user/mylike": {  
2247 - "post": {  
2248 - "summary": "我点赞的文章或评论",  
2249 - "operationId": "miniMyLike",  
2250 - "responses": {  
2251 - "200": {  
2252 - "description": "A successful response.",  
2253 - "schema": {  
2254 - "$ref": "#/definitions/MiniMyLikeResponse"  
2255 - }  
2256 - }  
2257 - },  
2258 - "parameters": [  
2259 - {  
2260 - "name": "body",  
2261 - "in": "body",  
2262 - "required": true,  
2263 - "schema": {  
2264 - "$ref": "#/definitions/MiniMyLikeRequest"  
2265 - }  
2266 - }  
2267 - ],  
2268 - "requestBody": {},  
2269 - "tags": [  
2270 - "user"  
2271 - ]  
2272 - }  
2273 } 2491 }
2274 }, 2492 },
2275 "definitions": { 2493 "definitions": {
@@ -2724,6 +2942,22 @@ @@ -2724,6 +2942,22 @@
2724 "name" 2942 "name"
2725 ] 2943 ]
2726 }, 2944 },
  2945 + "CommonSmsCodeRequest": {
  2946 + "type": "object",
  2947 + "properties": {
  2948 + "phone": {
  2949 + "type": "string"
  2950 + }
  2951 + },
  2952 + "title": "CommonSmsCodeRequest",
  2953 + "required": [
  2954 + "phone"
  2955 + ]
  2956 + },
  2957 + "CommonSmsCodeResposne": {
  2958 + "type": "object",
  2959 + "title": "CommonSmsCodeResposne"
  2960 + },
2727 "Company": { 2961 "Company": {
2728 "type": "object", 2962 "type": "object",
2729 "properties": { 2963 "properties": {
@@ -2743,6 +2977,11 @@ @@ -2743,6 +2977,11 @@
2743 "logo": { 2977 "logo": {
2744 "type": "string", 2978 "type": "string",
2745 "description": " 公司LOGO" 2979 "description": " 公司LOGO"
  2980 + },
  2981 + "joinedFlag": {
  2982 + "type": "integer",
  2983 + "format": "int32",
  2984 + "description": " 已加入标识(1:已加入 其他:未加入)"
2746 } 2985 }
2747 }, 2986 },
2748 "title": "Company", 2987 "title": "Company",
@@ -2750,19 +2989,44 @@ @@ -2750,19 +2989,44 @@
2750 "id", 2989 "id",
2751 "name", 2990 "name",
2752 "code", 2991 "code",
2753 - "logo" 2992 + "logo",
  2993 + "joinedFlag"
2754 ] 2994 ]
2755 }, 2995 },
2756 - "CompanySearchRequest": { 2996 + "CompanyPositionsSearchRequest": {
2757 "type": "object", 2997 "type": "object",
2758 - "properties": {  
2759 - "page": {  
2760 - "type": "integer",  
2761 - "format": "int32" 2998 + "title": "CompanyPositionsSearchRequest"
2762 }, 2999 },
2763 - "size": {  
2764 - "type": "integer",  
2765 - "format": "int32" 3000 + "CompanyPositionsSearchResponse": {
  3001 + "type": "object",
  3002 + "properties": {
  3003 + "list": {
  3004 + "type": "array",
  3005 + "items": {
  3006 + "$ref": "#/definitions/Position"
  3007 + }
  3008 + },
  3009 + "total": {
  3010 + "type": "integer",
  3011 + "format": "int64"
  3012 + }
  3013 + },
  3014 + "title": "CompanyPositionsSearchResponse",
  3015 + "required": [
  3016 + "list",
  3017 + "total"
  3018 + ]
  3019 + },
  3020 + "CompanySearchRequest": {
  3021 + "type": "object",
  3022 + "properties": {
  3023 + "page": {
  3024 + "type": "integer",
  3025 + "format": "int32"
  3026 + },
  3027 + "size": {
  3028 + "type": "integer",
  3029 + "format": "int32"
2766 }, 3030 },
2767 "flag": { 3031 "flag": {
2768 "type": "integer", 3032 "type": "integer",
@@ -2777,6 +3041,10 @@ @@ -2777,6 +3041,10 @@
2777 "code": { 3041 "code": {
2778 "type": "string", 3042 "type": "string",
2779 "description": " 按编码搜索" 3043 "description": " 按编码搜索"
  3044 + },
  3045 + "content": {
  3046 + "type": "string",
  3047 + "description": " 按公司名/编码搜索"
2780 } 3048 }
2781 }, 3049 },
2782 "title": "CompanySearchRequest" 3050 "title": "CompanySearchRequest"
@@ -2822,6 +3090,14 @@ @@ -2822,6 +3090,14 @@
2822 "name": { 3090 "name": {
2823 "type": "string", 3091 "type": "string",
2824 "description": " 部门名称" 3092 "description": " 部门名称"
  3093 + },
  3094 + "userIds": {
  3095 + "type": "array",
  3096 + "items": {
  3097 + "type": "integer",
  3098 + "format": "int64"
  3099 + },
  3100 + "description": " 部门下的用户"
2825 } 3101 }
2826 }, 3102 },
2827 "title": "Department", 3103 "title": "Department",
@@ -2829,7 +3105,8 @@ @@ -2829,7 +3105,8 @@
2829 "id", 3105 "id",
2830 "companyId", 3106 "companyId",
2831 "parentId", 3107 "parentId",
2832 - "name" 3108 + "name",
  3109 + "userIds"
2833 ] 3110 ]
2834 }, 3111 },
2835 "DepartmentAddRequest": { 3112 "DepartmentAddRequest": {
@@ -3069,29 +3346,6 @@ @@ -3069,29 +3346,6 @@
3069 "comment" 3346 "comment"
3070 ] 3347 ]
3071 }, 3348 },
3072 - "MessageBusinessRequest": {  
3073 - "type": "object",  
3074 - "properties": {  
3075 - "type": {  
3076 - "type": "integer",  
3077 - "format": "int32"  
3078 - },  
3079 - "page": {  
3080 - "type": "integer",  
3081 - "format": "int32"  
3082 - },  
3083 - "size": {  
3084 - "type": "integer",  
3085 - "format": "int32"  
3086 - }  
3087 - },  
3088 - "title": "MessageBusinessRequest",  
3089 - "required": [  
3090 - "type",  
3091 - "page",  
3092 - "size"  
3093 - ]  
3094 - },  
3095 "MessageBusinessResponse": { 3349 "MessageBusinessResponse": {
3096 "type": "object", 3350 "type": "object",
3097 "properties": { 3351 "properties": {
@@ -3112,6 +3366,24 @@ @@ -3112,6 +3366,24 @@
3112 "total" 3366 "total"
3113 ] 3367 ]
3114 }, 3368 },
  3369 + "MessageRequest": {
  3370 + "type": "object",
  3371 + "properties": {
  3372 + "page": {
  3373 + "type": "integer",
  3374 + "format": "int32"
  3375 + },
  3376 + "size": {
  3377 + "type": "integer",
  3378 + "format": "int32"
  3379 + }
  3380 + },
  3381 + "title": "MessageRequest",
  3382 + "required": [
  3383 + "page",
  3384 + "size"
  3385 + ]
  3386 + },
3115 "MessageSystemItem": { 3387 "MessageSystemItem": {
3116 "type": "object", 3388 "type": "object",
3117 "properties": { 3389 "properties": {
@@ -3148,24 +3420,6 @@ @@ -3148,24 +3420,6 @@
3148 "createdAt" 3420 "createdAt"
3149 ] 3421 ]
3150 }, 3422 },
3151 - "MessageSystemRequest": {  
3152 - "type": "object",  
3153 - "properties": {  
3154 - "page": {  
3155 - "type": "integer",  
3156 - "format": "int32"  
3157 - },  
3158 - "size": {  
3159 - "type": "integer",  
3160 - "format": "int32"  
3161 - }  
3162 - },  
3163 - "title": "MessageSystemRequest",  
3164 - "required": [  
3165 - "page",  
3166 - "size"  
3167 - ]  
3168 - },  
3169 "MessageSystemResponse": { 3423 "MessageSystemResponse": {
3170 "type": "object", 3424 "type": "object",
3171 "properties": { 3425 "properties": {
@@ -3555,7 +3809,7 @@ @@ -3555,7 +3809,7 @@
3555 "format": "int32", 3809 "format": "int32",
3556 "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式" 3810 "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式"
3557 }, 3811 },
3558 - "Section": { 3812 + "section": {
3559 "type": "array", 3813 "type": "array",
3560 "items": { 3814 "items": {
3561 "type": "string" 3815 "type": "string"
@@ -3598,7 +3852,7 @@ @@ -3598,7 +3852,7 @@
3598 "required": [ 3852 "required": [
3599 "id", 3853 "id",
3600 "template", 3854 "template",
3601 - "Section", 3855 + "section",
3602 "title", 3856 "title",
3603 "images", 3857 "images",
3604 "whoRead", 3858 "whoRead",
@@ -3898,12 +4152,17 @@ @@ -3898,12 +4152,17 @@
3898 "format": "int32", 4152 "format": "int32",
3899 "description": " 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)" 4153 "description": " 当前人员对文章的点赞标识 (0 没有点赞 1有点赞)"
3900 }, 4154 },
  4155 + "meFollowFlag": {
  4156 + "type": "integer",
  4157 + "format": "int32",
  4158 + "description": " 当前人员对作者的关注标识 (0 没有关注 1有关注)"
  4159 + },
3901 "tags": { 4160 "tags": {
3902 "type": "array", 4161 "type": "array",
3903 "items": { 4162 "items": {
3904 "type": "string" 4163 "type": "string"
3905 }, 4164 },
3906 - "description": "文章的标签" 4165 + "description": " 文章的标签"
3907 } 4166 }
3908 }, 4167 },
3909 "title": "MiniArticleGetResponse", 4168 "title": "MiniArticleGetResponse",
@@ -3924,6 +4183,7 @@ @@ -3924,6 +4183,7 @@
3924 "show", 4183 "show",
3925 "edit", 4184 "edit",
3926 "meLoveFlag", 4185 "meLoveFlag",
  4186 + "meFollowFlag",
3927 "tags" 4187 "tags"
3928 ] 4188 ]
3929 }, 4189 },
@@ -4482,6 +4742,10 @@ @@ -4482,6 +4742,10 @@
4482 "type": "string", 4742 "type": "string",
4483 "description": " 发布人" 4743 "description": " 发布人"
4484 }, 4744 },
  4745 + "avatar": {
  4746 + "type": "string",
  4747 + "description": " 发布人的头像"
  4748 + },
4485 "images": { 4749 "images": {
4486 "type": "array", 4750 "type": "array",
4487 "items": { 4751 "items": {
@@ -4503,6 +4767,7 @@ @@ -4503,6 +4767,7 @@
4503 "articleId", 4767 "articleId",
4504 "title", 4768 "title",
4505 "author", 4769 "author",
  4770 + "avatar",
4506 "images", 4771 "images",
4507 "createdAt", 4772 "createdAt",
4508 "meReadFlag" 4773 "meReadFlag"
@@ -4549,12 +4814,7 @@ @@ -4549,12 +4814,7 @@
4549 "title": "MiniSearchArticleRequest", 4814 "title": "MiniSearchArticleRequest",
4550 "required": [ 4815 "required": [
4551 "page", 4816 "page",
4552 - "size",  
4553 - "tagCategory",  
4554 - "tagId",  
4555 - "beginTime",  
4556 - "endTime",  
4557 - "searchWord" 4817 + "size"
4558 ] 4818 ]
4559 }, 4819 },
4560 "MiniSearchArticleResponse": { 4820 "MiniSearchArticleResponse": {
@@ -4604,7 +4864,6 @@ @@ -4604,7 +4864,6 @@
4604 "title": "MiniSetUserLikeRequset", 4864 "title": "MiniSetUserLikeRequset",
4605 "required": [ 4865 "required": [
4606 "articleId", 4866 "articleId",
4607 - "commentId",  
4608 "flag" 4867 "flag"
4609 ] 4868 ]
4610 }, 4869 },
@@ -4678,6 +4937,11 @@ @@ -4678,6 +4937,11 @@
4678 }, 4937 },
4679 "code": { 4938 "code": {
4680 "type": "string" 4939 "type": "string"
  4940 + },
  4941 + "isFromQr": {
  4942 + "type": "boolean",
  4943 + "format": "boolean",
  4944 + "description": " true:扫码添加 false:手动查找添加"
4681 } 4945 }
4682 }, 4946 },
4683 "title": "MiniUserApplyJoinCompanyRequest", 4947 "title": "MiniUserApplyJoinCompanyRequest",
@@ -4688,7 +4952,16 @@ @@ -4688,7 +4952,16 @@
4688 }, 4952 },
4689 "MiniUserApplyJoinCompanyResponse": { 4953 "MiniUserApplyJoinCompanyResponse": {
4690 "type": "object", 4954 "type": "object",
4691 - "title": "MiniUserApplyJoinCompanyResponse" 4955 + "properties": {
  4956 + "token": {
  4957 + "type": "string",
  4958 + "description": " x-token"
  4959 + }
  4960 + },
  4961 + "title": "MiniUserApplyJoinCompanyResponse",
  4962 + "required": [
  4963 + "token"
  4964 + ]
4692 }, 4965 },
4693 "MiniUserAuditRequest": { 4966 "MiniUserAuditRequest": {
4694 "type": "object", 4967 "type": "object",
@@ -4746,6 +5019,9 @@ @@ -4746,6 +5019,9 @@
4746 "size": { 5019 "size": {
4747 "type": "integer", 5020 "type": "integer",
4748 "format": "int32" 5021 "format": "int32"
  5022 + },
  5023 + "name": {
  5024 + "type": "string"
4749 } 5025 }
4750 }, 5026 },
4751 "title": "MiniUserFollowedSearchRequest" 5027 "title": "MiniUserFollowedSearchRequest"
@@ -5056,6 +5332,18 @@ @@ -5056,6 +5332,18 @@
5056 "comment" 5332 "comment"
5057 ] 5333 ]
5058 }, 5334 },
  5335 + "Position": {
  5336 + "type": "object",
  5337 + "properties": {
  5338 + "name": {
  5339 + "type": "string"
  5340 + }
  5341 + },
  5342 + "title": "Position",
  5343 + "required": [
  5344 + "name"
  5345 + ]
  5346 + },
5059 "RoleDeleteRequest": { 5347 "RoleDeleteRequest": {
5060 "type": "object", 5348 "type": "object",
5061 "properties": { 5349 "properties": {
@@ -5554,9 +5842,8 @@ @@ -5554,9 +5842,8 @@
5554 "format": "int64", 5842 "format": "int64",
5555 "description": " 文章顶层ID" 5843 "description": " 文章顶层ID"
5556 }, 5844 },
5557 - "authorId": {  
5558 - "type": "integer",  
5559 - "format": "int64", 5845 + "author": {
  5846 + "type": "string",
5560 "description": " 用户" 5847 "description": " 用户"
5561 }, 5848 },
5562 "show": { 5849 "show": {
@@ -5579,8 +5866,7 @@ @@ -5579,8 +5866,7 @@
5579 "required": [ 5866 "required": [
5580 "page", 5867 "page",
5581 "size", 5868 "size",
5582 - "articleId",  
5583 - "topId" 5869 + "articleId"
5584 ] 5870 ]
5585 }, 5871 },
5586 "SystemArticleCommentSearchResponse": { 5872 "SystemArticleCommentSearchResponse": {
@@ -5840,6 +6126,11 @@ @@ -5840,6 +6126,11 @@
5840 "$ref": "#/definitions/ArticleTagItem" 6126 "$ref": "#/definitions/ArticleTagItem"
5841 }, 6127 },
5842 "description": "标签" 6128 "description": "标签"
  6129 + },
  6130 + "targetUser": {
  6131 + "type": "integer",
  6132 + "format": "int32",
  6133 + "description": "分发方式 [0分发给所有人、1分发给指定的人]"
5843 } 6134 }
5844 }, 6135 },
5845 "title": "SystemArticleGetResponse", 6136 "title": "SystemArticleGetResponse",
@@ -5860,7 +6151,8 @@ @@ -5860,7 +6151,8 @@
5860 "countComment", 6151 "countComment",
5861 "countRead", 6152 "countRead",
5862 "show", 6153 "show",
5863 - "tags" 6154 + "tags",
  6155 + "targetUser"
5864 ] 6156 ]
5865 }, 6157 },
5866 "SystemArticleHistory": { 6158 "SystemArticleHistory": {
@@ -6339,6 +6631,344 @@ @@ -6339,6 +6631,344 @@
6339 "targetUser" 6631 "targetUser"
6340 ] 6632 ]
6341 }, 6633 },
  6634 + "SystemCommentItem": {
  6635 + "type": "object",
  6636 + "properties": {
  6637 + "id": {
  6638 + "type": "integer",
  6639 + "format": "int64",
  6640 + "description": "评论id"
  6641 + },
  6642 + "pid": {
  6643 + "type": "integer",
  6644 + "format": "int64"
  6645 + },
  6646 + "topId": {
  6647 + "type": "integer",
  6648 + "format": "int64"
  6649 + },
  6650 + "articleId": {
  6651 + "type": "integer",
  6652 + "format": "int64",
  6653 + "description": "对应的文章id"
  6654 + },
  6655 + "articleTitle": {
  6656 + "type": "string",
  6657 + "description": "文章标题"
  6658 + },
  6659 + "fromUserId": {
  6660 + "type": "integer",
  6661 + "format": "int64",
  6662 + "description": "填写评论的人"
  6663 + },
  6664 + "fromUser": {
  6665 + "$ref": "#/definitions/CommentAuthor",
  6666 + "description": "填写评论的人"
  6667 + },
  6668 + "createdAt": {
  6669 + "type": "integer",
  6670 + "format": "int64",
  6671 + "description": "评论的填写时间"
  6672 + },
  6673 + "content": {
  6674 + "type": "string",
  6675 + "description": "评论的内容"
  6676 + },
  6677 + "show": {
  6678 + "type": "integer",
  6679 + "format": "int32",
  6680 + "description": "是否展示 [1显示] [2不显示]"
  6681 + },
  6682 + "countReplay": {
  6683 + "type": "integer",
  6684 + "format": "int32",
  6685 + "description": "回复数量"
  6686 + },
  6687 + "countUserLove": {
  6688 + "type": "integer",
  6689 + "format": "int32",
  6690 + "description": "用户点赞数量"
  6691 + },
  6692 + "countAdminLove": {
  6693 + "type": "integer",
  6694 + "format": "int32",
  6695 + "description": "运营点赞数量"
  6696 + }
  6697 + },
  6698 + "title": "SystemCommentItem",
  6699 + "required": [
  6700 + "id",
  6701 + "pid",
  6702 + "topId",
  6703 + "articleId",
  6704 + "articleTitle",
  6705 + "fromUserId",
  6706 + "fromUser",
  6707 + "createdAt",
  6708 + "content",
  6709 + "show",
  6710 + "countReplay",
  6711 + "countUserLove",
  6712 + "countAdminLove"
  6713 + ]
  6714 + },
  6715 + "SystemEditCommentRequest": {
  6716 + "type": "object",
  6717 + "properties": {
  6718 + "": {
  6719 + "type": "integer",
  6720 + "format": "int64"
  6721 + },
  6722 + "id": {
  6723 + "type": "integer",
  6724 + "format": "int64"
  6725 + },
  6726 + "show": {
  6727 + "type": "integer",
  6728 + "format": "int32",
  6729 + "description": "[1 显示评论] [2: 隐藏评论]"
  6730 + },
  6731 + "countAdminLove": {
  6732 + "type": "integer",
  6733 + "format": "int32"
  6734 + }
  6735 + },
  6736 + "title": "SystemEditCommentRequest",
  6737 + "required": [
  6738 + "id",
  6739 + "show"
  6740 + ]
  6741 + },
  6742 + "SystemEditCommentResponse": {
  6743 + "type": "object",
  6744 + "properties": {
  6745 + "id": {
  6746 + "type": "integer",
  6747 + "format": "int64"
  6748 + }
  6749 + },
  6750 + "title": "SystemEditCommentResponse",
  6751 + "required": [
  6752 + "id"
  6753 + ]
  6754 + },
  6755 + "SystemEditCommentShowRequest": {
  6756 + "type": "object",
  6757 + "properties": {
  6758 + "": {
  6759 + "type": "integer",
  6760 + "format": "int64"
  6761 + },
  6762 + "id": {
  6763 + "type": "array",
  6764 + "items": {
  6765 + "type": "integer",
  6766 + "format": "int64"
  6767 + }
  6768 + },
  6769 + "show": {
  6770 + "type": "integer",
  6771 + "format": "int32",
  6772 + "description": "[1 显示评论] [2: 隐藏评论]"
  6773 + }
  6774 + },
  6775 + "title": "SystemEditCommentShowRequest",
  6776 + "required": [
  6777 + "id",
  6778 + "show"
  6779 + ]
  6780 + },
  6781 + "SystemEditCommentShowResponse": {
  6782 + "type": "object",
  6783 + "properties": {
  6784 + "id": {
  6785 + "type": "array",
  6786 + "items": {
  6787 + "type": "integer",
  6788 + "format": "int64"
  6789 + }
  6790 + }
  6791 + },
  6792 + "title": "SystemEditCommentShowResponse",
  6793 + "required": [
  6794 + "id"
  6795 + ]
  6796 + },
  6797 + "SystemGetCommentRequest": {
  6798 + "type": "object",
  6799 + "properties": {
  6800 + "": {
  6801 + "type": "integer",
  6802 + "format": "int64"
  6803 + },
  6804 + "id": {
  6805 + "type": "integer",
  6806 + "format": "int64"
  6807 + }
  6808 + },
  6809 + "title": "SystemGetCommentRequest",
  6810 + "required": [
  6811 + "id"
  6812 + ]
  6813 + },
  6814 + "SystemGetCommentResponse": {
  6815 + "type": "object",
  6816 + "properties": {
  6817 + "id": {
  6818 + "type": "integer",
  6819 + "format": "int64",
  6820 + "description": "评论id"
  6821 + },
  6822 + "pid": {
  6823 + "type": "integer",
  6824 + "format": "int64"
  6825 + },
  6826 + "topId": {
  6827 + "type": "integer",
  6828 + "format": "int64"
  6829 + },
  6830 + "articleId": {
  6831 + "type": "integer",
  6832 + "format": "int64",
  6833 + "description": "对应的文章id"
  6834 + },
  6835 + "articleTitle": {
  6836 + "type": "string",
  6837 + "description": "文章标题"
  6838 + },
  6839 + "fromUserId": {
  6840 + "type": "integer",
  6841 + "format": "int64",
  6842 + "description": "填写评论的人"
  6843 + },
  6844 + "fromUser": {
  6845 + "$ref": "#/definitions/CommentAuthor",
  6846 + "description": "填写评论的人"
  6847 + },
  6848 + "createdAt": {
  6849 + "type": "integer",
  6850 + "format": "int64",
  6851 + "description": "评论的填写时间"
  6852 + },
  6853 + "sectionContent": {
  6854 + "type": "string",
  6855 + "description": "引用的段落内容"
  6856 + },
  6857 + "content": {
  6858 + "type": "string",
  6859 + "description": " 评论的内容"
  6860 + },
  6861 + "show": {
  6862 + "type": "integer",
  6863 + "format": "int32",
  6864 + "description": "是否展示 [1显示] [2不显示]"
  6865 + },
  6866 + "countReplay": {
  6867 + "type": "integer",
  6868 + "format": "int32",
  6869 + "description": "回复数量"
  6870 + },
  6871 + "countUserLove": {
  6872 + "type": "integer",
  6873 + "format": "int32",
  6874 + "description": "用户点赞数量"
  6875 + },
  6876 + "countAdminLove": {
  6877 + "type": "integer",
  6878 + "format": "int32",
  6879 + "description": "运营点赞数量"
  6880 + }
  6881 + },
  6882 + "title": "SystemGetCommentResponse",
  6883 + "required": [
  6884 + "id",
  6885 + "pid",
  6886 + "topId",
  6887 + "articleId",
  6888 + "articleTitle",
  6889 + "fromUserId",
  6890 + "fromUser",
  6891 + "createdAt",
  6892 + "sectionContent",
  6893 + "content",
  6894 + "show",
  6895 + "countReplay",
  6896 + "countUserLove",
  6897 + "countAdminLove"
  6898 + ]
  6899 + },
  6900 + "SystemListCommentRequest": {
  6901 + "type": "object",
  6902 + "properties": {
  6903 + "page": {
  6904 + "type": "integer",
  6905 + "format": "int32"
  6906 + },
  6907 + "size": {
  6908 + "type": "integer",
  6909 + "format": "int32"
  6910 + },
  6911 + "": {
  6912 + "type": "integer",
  6913 + "format": "int64"
  6914 + },
  6915 + "topId": {
  6916 + "type": "integer",
  6917 + "format": "int64",
  6918 + "description": " 评论的顶层ID"
  6919 + },
  6920 + "fromUser": {
  6921 + "type": "string",
  6922 + "description": " 用户"
  6923 + },
  6924 + "show": {
  6925 + "type": "integer",
  6926 + "format": "int32",
  6927 + "description": " 显示状态"
  6928 + },
  6929 + "beginTime": {
  6930 + "type": "integer",
  6931 + "format": "int64",
  6932 + "description": " 填写评论的开始时间"
  6933 + },
  6934 + "endTime": {
  6935 + "type": "integer",
  6936 + "format": "int64",
  6937 + "description": " 填写评论的结束时间"
  6938 + },
  6939 + "articleTitle": {
  6940 + "type": "string"
  6941 + },
  6942 + "content": {
  6943 + "type": "string"
  6944 + }
  6945 + },
  6946 + "title": "SystemListCommentRequest",
  6947 + "required": [
  6948 + "page",
  6949 + "size"
  6950 + ]
  6951 + },
  6952 + "SystemListCommentResponse": {
  6953 + "type": "object",
  6954 + "properties": {
  6955 + "total": {
  6956 + "type": "integer",
  6957 + "format": "int32"
  6958 + },
  6959 + "list": {
  6960 + "type": "array",
  6961 + "items": {
  6962 + "$ref": "#/definitions/SystemCommentItem"
  6963 + }
  6964 + }
  6965 + },
  6966 + "title": "SystemListCommentResponse",
  6967 + "required": [
  6968 + "total",
  6969 + "list"
  6970 + ]
  6971 + },
6342 "SystemUser": { 6972 "SystemUser": {
6343 "type": "object", 6973 "type": "object",
6344 "properties": { 6974 "properties": {
@@ -6579,11 +7209,31 @@ @@ -6579,11 +7209,31 @@
6579 "id": { 7209 "id": {
6580 "type": "integer", 7210 "type": "integer",
6581 "format": "int64" 7211 "format": "int64"
  7212 + },
  7213 + "name": {
  7214 + "type": "string",
  7215 + "description": " 姓名"
  7216 + },
  7217 + "roles": {
  7218 + "type": "array",
  7219 + "items": {
  7220 + "type": "integer",
  7221 + "format": "int64"
  7222 + },
  7223 + "description": " 权限角色"
  7224 + },
  7225 + "enable": {
  7226 + "type": "integer",
  7227 + "format": "int32",
  7228 + "description": " 状态 1:启用 2:禁用"
6582 } 7229 }
6583 }, 7230 },
6584 "title": "SystemUserAccountUpdateRequest", 7231 "title": "SystemUserAccountUpdateRequest",
6585 "required": [ 7232 "required": [
6586 - "id" 7233 + "id",
  7234 + "name",
  7235 + "roles",
  7236 + "enable"
6587 ] 7237 ]
6588 }, 7238 },
6589 "SystemUserAccountUpdateResponse": { 7239 "SystemUserAccountUpdateResponse": {
@@ -6786,8 +7436,7 @@ @@ -6786,8 +7436,7 @@
6786 "required": [ 7436 "required": [
6787 "image", 7437 "image",
6788 "name", 7438 "name",
6789 - "category",  
6790 - "other" 7439 + "category"
6791 ] 7440 ]
6792 }, 7441 },
6793 "TagCreateResponse": { 7442 "TagCreateResponse": {
@@ -6868,8 +7517,7 @@ @@ -6868,8 +7517,7 @@
6868 "id", 7517 "id",
6869 "image", 7518 "image",
6870 "name", 7519 "name",
6871 - "category",  
6872 - "other" 7520 + "category"
6873 ] 7521 ]
6874 }, 7522 },
6875 "TagEditResponse": { 7523 "TagEditResponse": {
@@ -7164,6 +7812,10 @@ @@ -7164,6 +7812,10 @@
7164 "type": "string", 7812 "type": "string",
7165 "description": " 公司编码(邀请码)" 7813 "description": " 公司编码(邀请码)"
7166 }, 7814 },
  7815 + "companyLogo": {
  7816 + "$ref": "#/definitions/string",
  7817 + "description": " 公司LOGO"
  7818 + },
7167 "flag": { 7819 "flag": {
7168 "type": "integer", 7820 "type": "integer",
7169 "format": "int32", 7821 "format": "int32",
@@ -7174,7 +7826,7 @@ @@ -7174,7 +7826,7 @@
7174 "description": " 名称" 7826 "description": " 名称"
7175 }, 7827 },
7176 "avatar": { 7828 "avatar": {
7177 - "type": "string", 7829 + "$ref": "#/definitions/string",
7178 "description": " 头像" 7830 "description": " 头像"
7179 }, 7831 },
7180 "phone": { 7832 "phone": {
@@ -7229,6 +7881,7 @@ @@ -7229,6 +7881,7 @@
7229 "companyId", 7881 "companyId",
7230 "companyName", 7882 "companyName",
7231 "companyCode", 7883 "companyCode",
  7884 + "companyLogo",
7232 "flag", 7885 "flag",
7233 "name", 7886 "name",
7234 "avatar", 7887 "avatar",
@@ -7271,6 +7924,17 @@ @@ -7271,6 +7924,17 @@
7271 "type": "boolean", 7924 "type": "boolean",
7272 "format": "boolean", 7925 "format": "boolean",
7273 "description": " 已读标识 true:已读 false:未读" 7926 "description": " 已读标识 true:已读 false:未读"
  7927 + },
  7928 + "images": {
  7929 + "type": "array",
  7930 + "items": {
  7931 + "type": "string"
  7932 + },
  7933 + "description": " 图片列表"
  7934 + },
  7935 + "author": {
  7936 + "$ref": "#/definitions/UserItem",
  7937 + "description": " 作者"
7274 } 7938 }
7275 }, 7939 },
7276 "title": "UserNewsItem", 7940 "title": "UserNewsItem",
@@ -7280,7 +7944,9 @@ @@ -7280,7 +7944,9 @@
7280 "title", 7944 "title",
7281 "summary", 7945 "summary",
7282 "time", 7946 "time",
7283 - "readFlag" 7947 + "readFlag",
  7948 + "images",
  7949 + "author"
7284 ] 7950 ]
7285 }, 7951 },
7286 "UserSearchRequest": { 7952 "UserSearchRequest": {
@@ -70,9 +70,12 @@ service Core { @@ -70,9 +70,12 @@ service Core {
70 @doc "取消关注" 70 @doc "取消关注"
71 @handler miniUserUnFollow 71 @handler miniUserUnFollow
72 post /mini/user/unfollow (FollowRequest) 72 post /mini/user/unfollow (FollowRequest)
73 - @doc "我点赞的文章或评论" 73 + @doc "我点赞的-文章或评论列表"
74 @handler miniMyLike 74 @handler miniMyLike
75 post /mini/user/mylike (MiniMyLikeRequest)returns (MiniMyLikeResponse) 75 post /mini/user/mylike (MiniMyLikeRequest)returns (MiniMyLikeResponse)
  76 + @doc "我被点赞-文章或评论列表"
  77 + @handler miniMyBeLiked
  78 + post /mini/user/mybeliked (MiniBeLikedRequest)returns (MiniBeLikedResponse)
76 } 79 }
77 80
78 type( 81 type(
@@ -220,7 +223,7 @@ type( @@ -220,7 +223,7 @@ type(
220 223
221 224
222 225
223 -// 我点赞的文章或评论 226 +// 1.我点赞的文章或评论 2.我的文章或评论被点赞
224 type ( 227 type (
225 MiniMyLikeRequest{ 228 MiniMyLikeRequest{
226 Page int `json:"page"` 229 Page int `json:"page"`
@@ -249,6 +252,28 @@ type ( @@ -249,6 +252,28 @@ type (
249 CountComment int `json:"countComment"` // 评论数量 252 CountComment int `json:"countComment"` // 评论数量
250 Show int `json:"show"` // 评论的展示状态(0显示、1不显示) 253 Show int `json:"show"` // 评论的展示状态(0显示、1不显示)
251 } 254 }
  255 +
  256 +
  257 + MiniBeLikedRequest{
  258 + Page int `json:"page"`
  259 + Size int `json:"size"`
  260 + }
  261 +
  262 + MiniBeLikedResponse {
  263 + List []MyBeLikedItem `json:"list"`
  264 + Total int64 `json:"total"`
  265 + }
  266 +
  267 + MyBeLikedItem {
  268 + UserId int64 `json:"userId"` // 点赞人id
  269 + ArticleId int64 `json:"articleId"` // 文章id
  270 + CommentId int64 `json:"commentId"` // 评论id
  271 + CreatedAt int64 `json:"createdAt"` // 创建时间
  272 + User *SimpleUser `json:"user"` // 点赞人
  273 + Article *SimpleArticle `json:"article"` // 文章
  274 + Comment *SimpleComment `json:"comment"` // 评论
  275 + }
  276 +
252 ) 277 )
253 278
254 279
@@ -275,6 +275,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { @@ -275,6 +275,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
275 Path: "/mini/user/mylike", 275 Path: "/mini/user/mylike",
276 Handler: user.MiniMyLikeHandler(serverCtx), 276 Handler: user.MiniMyLikeHandler(serverCtx),
277 }, 277 },
  278 + {
  279 + Method: http.MethodPost,
  280 + Path: "/mini/user/mybeliked",
  281 + Handler: user.MiniMyBeLikedHandler(serverCtx),
  282 + },
278 }..., 283 }...,
279 ), 284 ),
280 rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), 285 rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
  1 +package user
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
  5 + "net/http"
  6 +
  7 + "github.com/zeromicro/go-zero/rest/httpx"
  8 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/user"
  9 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
  10 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  11 +)
  12 +
  13 +func MiniMyBeLikedHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  14 + return func(w http.ResponseWriter, r *http.Request) {
  15 + var req types.MiniBeLikedRequest
  16 + if err := httpx.Parse(r, &req); err != nil {
  17 + result.ParamErrorResult(r, w, err)
  18 + return
  19 + }
  20 +
  21 + l := user.NewMiniMyBeLikedLogic(r.Context(), svcCtx)
  22 + resp, err := l.MiniMyBeLiked(&req)
  23 + result.HttpResult(r, w, resp, err)
  24 + }
  25 +}
1 package user 1 package user
2 2
3 import ( 3 import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata"
4 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" 5 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
5 "net/http" 6 "net/http"
6 7
@@ -17,7 +18,8 @@ func MiniUserStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { @@ -17,7 +18,8 @@ func MiniUserStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
17 httpx.ErrorCtx(r.Context(), w, err) 18 httpx.ErrorCtx(r.Context(), w, err)
18 return 19 return
19 } 20 }
20 - 21 + userToken := contextdata.GetUserTokenFromCtx(r.Context())
  22 + req.UserId = userToken.UserId
21 l := user.NewSystemUserStatisticsLogic(r.Context(), svcCtx) 23 l := user.NewSystemUserStatisticsLogic(r.Context(), svcCtx)
22 resp, err := l.SystemUserStatistics(&req) 24 resp, err := l.SystemUserStatistics(&req)
23 result.HttpResult(r, w, resp, err) 25 result.HttpResult(r, w, resp, err)
@@ -2,6 +2,7 @@ package article @@ -2,6 +2,7 @@ package article
2 2
3 import ( 3 import (
4 "context" 4 "context"
  5 +
5 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/message" 6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/message"
6 7
7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" 8 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
@@ -56,7 +57,7 @@ func (l *MiniSetUserLikeLogic) cancelSetUserLikeArticle(req *types.MiniSetUserLi @@ -56,7 +57,7 @@ func (l *MiniSetUserLikeLogic) cancelSetUserLikeArticle(req *types.MiniSetUserLi
56 // 检查id 57 // 检查id
57 userInfo, err := l.svcCtx.UserRepository.FindOne(l.ctx, conn, req.UserId) 58 userInfo, err := l.svcCtx.UserRepository.FindOne(l.ctx, conn, req.UserId)
58 if err != nil { 59 if err != nil {
59 - //无法确认 文章的id 60 + //无法确认 人员的id
60 return nil, xerr.NewErrMsgErr("无法确认操作人员信息", err) 61 return nil, xerr.NewErrMsgErr("无法确认操作人员信息", err)
61 } 62 }
62 articleInfo, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.ArticleId) 63 articleInfo, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.ArticleId)
@@ -129,7 +130,7 @@ func (l *MiniSetUserLikeLogic) cancelSetUserLikeComment(req *types.MiniSetUserLi @@ -129,7 +130,7 @@ func (l *MiniSetUserLikeLogic) cancelSetUserLikeComment(req *types.MiniSetUserLi
129 // 检查id 130 // 检查id
130 userInfo, err := l.svcCtx.UserRepository.FindOne(l.ctx, conn, req.UserId) 131 userInfo, err := l.svcCtx.UserRepository.FindOne(l.ctx, conn, req.UserId)
131 if err != nil { 132 if err != nil {
132 - //无法确认 文章的id 133 + //无法确认 人员的id
133 return nil, xerr.NewErrMsgErr("无法确认操作人员信息", err) 134 return nil, xerr.NewErrMsgErr("无法确认操作人员信息", err)
134 } 135 }
135 articleInfo, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.ArticleId) 136 articleInfo, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.ArticleId)
@@ -249,6 +250,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeArticle(req *types.MiniSetUserLikeRequ @@ -249,6 +250,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeArticle(req *types.MiniSetUserLikeRequ
249 CommentId: 0, 250 CommentId: 0,
250 CommentAuthor: 0, 251 CommentAuthor: 0,
251 UserId: req.UserId, 252 UserId: req.UserId,
  253 + ToUserId: articleInfo.AuthorId,
252 } 254 }
253 // 添加点赞标识 255 // 添加点赞标识
254 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo) 256 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo)
@@ -338,6 +340,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeComment(req *types.MiniSetUserLikeRequ @@ -338,6 +340,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeComment(req *types.MiniSetUserLikeRequ
338 CommentId: req.CommentId, 340 CommentId: req.CommentId,
339 CommentAuthor: commentInfo.FromUserId, 341 CommentAuthor: commentInfo.FromUserId,
340 UserId: req.UserId, 342 UserId: req.UserId,
  343 + ToUserId: commentInfo.FromUserId,
341 } 344 }
342 // 设置赞标识 345 // 设置赞标识
343 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo) 346 _, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo)
@@ -37,6 +37,12 @@ func NewSystemUpdateArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext @@ -37,6 +37,12 @@ func NewSystemUpdateArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext
37 func (l *SystemUpdateArticleLogic) SystemUpdateArticle(req *types.SystemArticleUpdateRequest) (resp *types.SystemArticleUpdateResponse, err error) { 37 func (l *SystemUpdateArticleLogic) SystemUpdateArticle(req *types.SystemArticleUpdateRequest) (resp *types.SystemArticleUpdateResponse, err error) {
38 var conn = l.svcCtx.DefaultDBConn() 38 var conn = l.svcCtx.DefaultDBConn()
39 userToken := contextdata.GetUserTokenFromCtx(l.ctx) 39 userToken := contextdata.GetUserTokenFromCtx(l.ctx)
  40 + // 预处理参数
  41 + if req.TargetUser == 0 {
  42 + //TargetUser 设定为分发给所有人,清空 WhoRead
  43 + req.WhoRead = make([]int64, 0)
  44 + }
  45 +
40 article, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.Id) 46 article, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.Id)
41 if err != nil { 47 if err != nil {
42 return nil, xerr.NewErrMsgErr("帖子不存在", err) 48 return nil, xerr.NewErrMsgErr("帖子不存在", err)
@@ -102,6 +102,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList @@ -102,6 +102,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList
102 AtWho: []types.CommentAtWho{}, 102 AtWho: []types.CommentAtWho{},
103 CreatedAt: val.CreatedAt, 103 CreatedAt: val.CreatedAt,
104 MeLoveFlag: 0, 104 MeLoveFlag: 0,
  105 + Content: val.Content,
105 }, 106 },
106 Reply: []types.ArticleCommentItem{}, 107 Reply: []types.ArticleCommentItem{},
107 TotalReply: int64(val.CountReply), 108 TotalReply: int64(val.CountReply),
@@ -175,6 +176,7 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag @@ -175,6 +176,7 @@ func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlag
175 AtWho: []types.CommentAtWho{}, 176 AtWho: []types.CommentAtWho{},
176 CreatedAt: val.CreatedAt, 177 CreatedAt: val.CreatedAt,
177 MeLoveFlag: 0, 178 MeLoveFlag: 0,
  179 + Content: val.Content,
178 } 180 }
179 181
180 if _, ok := loveFlagMap[val.Id]; ok { 182 if _, ok := loveFlagMap[val.Id]; ok {
@@ -52,6 +52,7 @@ func (l *SystemEditAticleCommentShowLogic) SystemEditAticleCommentShow(req *type @@ -52,6 +52,7 @@ func (l *SystemEditAticleCommentShowLogic) SystemEditAticleCommentShow(req *type
52 } 52 }
53 } 53 }
54 } 54 }
  55 +
55 if err != nil { 56 if err != nil {
56 return resp, err 57 return resp, err
57 } 58 }
@@ -199,6 +199,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma @@ -199,6 +199,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
199 Content: v.Content, 199 Content: v.Content,
200 CountLove: v.CountUserLove, 200 CountLove: v.CountUserLove,
201 CountComment: v.CountReply, 201 CountComment: v.CountReply,
  202 + Show: int(v.Show),
202 } 203 }
203 } 204 }
204 205
  1 +package user
  2 +
  3 +import (
  4 + "context"
  5 + "github.com/samber/lo"
  6 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
  7 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata"
  8 +
  9 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
  10 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  11 +
  12 + "github.com/zeromicro/go-zero/core/logx"
  13 +)
  14 +
  15 +type MiniMyBeLikedLogic struct {
  16 + logx.Logger
  17 + ctx context.Context
  18 + svcCtx *svc.ServiceContext
  19 +}
  20 +
  21 +func NewMiniMyBeLikedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniMyBeLikedLogic {
  22 + return &MiniMyBeLikedLogic{
  23 + Logger: logx.WithContext(ctx),
  24 + ctx: ctx,
  25 + svcCtx: svcCtx,
  26 + }
  27 +}
  28 +
  29 +func (l *MiniMyBeLikedLogic) MiniMyBeLiked(req *types.MiniBeLikedRequest) (resp *types.MiniBeLikedResponse, err error) {
  30 + var userToken = contextdata.GetUserTokenFromCtx(l.ctx)
  31 + var conn = l.svcCtx.DefaultDBConn()
  32 +
  33 + total, list, err := l.svcCtx.UserLoveFlagRepository.Find(l.ctx, conn, domain.NewQueryOptions().
  34 + WithOffsetLimit(req.Page, req.Size).
  35 + WithKV("commentId", userToken.CompanyId).
  36 + WithKV("toUserId", userToken.UserId))
  37 + if err != nil {
  38 + return nil, err
  39 + }
  40 +
  41 + resp = &types.MiniBeLikedResponse{}
  42 + resp.Total = total
  43 + resp.List = make([]types.MyBeLikedItem, 0)
  44 + if total == 0 || len(list) == 0 {
  45 + return resp, nil
  46 + }
  47 +
  48 + var userMap = make(map[int64]*domain.User)
  49 + var articleMap = make(map[int64]*domain.Article)
  50 + var commentMap = make(map[int64]*domain.ArticleComment)
  51 +
  52 + lo.ForEach(list, func(item *domain.UserLoveFlag, index int) {
  53 + var (
  54 + user *domain.User
  55 + article *domain.Article
  56 + comment *domain.ArticleComment
  57 + )
  58 + user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.UserId, l.svcCtx.UserRepository.FindOne)
  59 + article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne)
  60 + // 点赞评论
  61 + if item.CommentId != 0 {
  62 + comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne)
  63 + }
  64 +
  65 + resp.List = append(resp.List, l.NewItemSimple(item, user, article, comment))
  66 + })
  67 +
  68 + return resp, nil
  69 +}
  70 +
  71 +func (l *MiniMyBeLikedLogic) NewItemSimple(love *domain.UserLoveFlag, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyBeLikedItem {
  72 + item := types.MyBeLikedItem{
  73 + UserId: love.UserId,
  74 + ArticleId: love.ArticleId,
  75 + CommentId: love.CommentId,
  76 + CreatedAt: love.CreatedAt,
  77 + }
  78 +
  79 + if user != nil {
  80 + item.User = &types.SimpleUser{
  81 + Id: user.Id,
  82 + CompanyId: user.CompanyId,
  83 + Name: user.Name,
  84 + Avatar: user.Avatar,
  85 + Position: user.Position,
  86 + }
  87 + }
  88 +
  89 + if article != nil {
  90 + item.Article = &types.SimpleArticle{
  91 + Id: article.Id,
  92 + Title: article.Title,
  93 + Summary: article.Summary,
  94 + CountLove: article.CountLove,
  95 + CountComment: article.CountComment,
  96 + Show: int(article.Show),
  97 + }
  98 + }
  99 +
  100 + if comment != nil {
  101 + item.Comment = &types.SimpleComment{
  102 + Id: comment.Id,
  103 + Content: comment.Content,
  104 + CountLove: comment.CountUserLove,
  105 + CountComment: comment.CountReply,
  106 + Show: int(comment.Show),
  107 + }
  108 + }
  109 +
  110 + return item
  111 +}
@@ -32,6 +32,7 @@ func (l *MiniMyLikeLogic) MiniMyLike(req *types.MiniMyLikeRequest) (resp *types. @@ -32,6 +32,7 @@ func (l *MiniMyLikeLogic) MiniMyLike(req *types.MiniMyLikeRequest) (resp *types.
32 32
33 total, list, err := l.svcCtx.UserLoveFlagRepository.Find(l.ctx, conn, domain.NewQueryOptions(). 33 total, list, err := l.svcCtx.UserLoveFlagRepository.Find(l.ctx, conn, domain.NewQueryOptions().
34 WithOffsetLimit(req.Page, req.Size). 34 WithOffsetLimit(req.Page, req.Size).
  35 + WithKV("commentId", userToken.CompanyId).
35 WithKV("userId", userToken.UserId)) 36 WithKV("userId", userToken.UserId))
36 if err != nil { 37 if err != nil {
37 return nil, err 38 return nil, err
@@ -54,25 +55,22 @@ func (l *MiniMyLikeLogic) MiniMyLike(req *types.MiniMyLikeRequest) (resp *types. @@ -54,25 +55,22 @@ func (l *MiniMyLikeLogic) MiniMyLike(req *types.MiniMyLikeRequest) (resp *types.
54 article *domain.Article 55 article *domain.Article
55 comment *domain.ArticleComment 56 comment *domain.ArticleComment
56 ) 57 )
57 -  
58 - if item.CommentId != 0 { // 点赞评论  
59 - user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.CommentAuthor, l.svcCtx.UserRepository.FindOne) 58 + user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.ToUserId, l.svcCtx.UserRepository.FindOne)
60 article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne) 59 article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne)
  60 + // 点赞评论
  61 + if item.CommentId != 0 {
61 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne) 62 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne)
62 - } else {  
63 - user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.ArticleAuthor, l.svcCtx.UserRepository.FindOne)  
64 - article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne)  
65 } 63 }
66 64
67 - resp.List = append(resp.List, NewItemSimple(item, user, article, comment)) 65 + resp.List = append(resp.List, l.NewItemSimple(item, user, article, comment))
68 }) 66 })
69 67
70 - return 68 + return resp, nil
71 } 69 }
72 70
73 -func NewItemSimple(love *domain.UserLoveFlag, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyLikeItem { 71 +func (l *MiniMyLikeLogic) NewItemSimple(love *domain.UserLoveFlag, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyLikeItem {
74 item := types.MyLikeItem{ 72 item := types.MyLikeItem{
75 - UserId: love.UserId, 73 + UserId: love.ToUserId,
76 ArticleId: love.ArticleId, 74 ArticleId: love.ArticleId,
77 CommentId: love.CommentId, 75 CommentId: love.CommentId,
78 CreatedAt: love.CreatedAt, 76 CreatedAt: love.CreatedAt,
@@ -587,6 +587,26 @@ type SimpleComment struct { @@ -587,6 +587,26 @@ type SimpleComment struct {
587 Show int `json:"show"` // 评论的展示状态(0显示、1不显示) 587 Show int `json:"show"` // 评论的展示状态(0显示、1不显示)
588 } 588 }
589 589
  590 +type MiniBeLikedRequest struct {
  591 + Page int `json:"page"`
  592 + Size int `json:"size"`
  593 +}
  594 +
  595 +type MiniBeLikedResponse struct {
  596 + List []MyBeLikedItem `json:"list"`
  597 + Total int64 `json:"total"`
  598 +}
  599 +
  600 +type MyBeLikedItem struct {
  601 + UserId int64 `json:"userId"` // 点赞人id
  602 + ArticleId int64 `json:"articleId"` // 文章id
  603 + CommentId int64 `json:"commentId"` // 评论id
  604 + CreatedAt int64 `json:"createdAt"` // 创建时间
  605 + User *SimpleUser `json:"user"` // 点赞人
  606 + Article *SimpleArticle `json:"article"` // 文章
  607 + Comment *SimpleComment `json:"comment"` // 评论
  608 +}
  609 +
590 type SystemUserInfoRequest struct { 610 type SystemUserInfoRequest struct {
591 Token string `header:"x-mmm-accesstoken"` 611 Token string `header:"x-mmm-accesstoken"`
592 } 612 }
@@ -16,6 +16,7 @@ type UserLoveFlag struct { @@ -16,6 +16,7 @@ type UserLoveFlag struct {
16 ArticleAuthor int64 // 文章的发布人 16 ArticleAuthor int64 // 文章的发布人
17 CommentAuthor int64 // 评论的填写人 17 CommentAuthor int64 // 评论的填写人
18 UserId int64 18 UserId int64
  19 + ToUserId int64
19 CreatedAt int64 20 CreatedAt int64
20 UpdatedAt int64 21 UpdatedAt int64
21 DeletedAt int64 22 DeletedAt int64
@@ -132,6 +132,9 @@ func (repository *UserLoveFlagRepository) Find(ctx context.Context, conn transac @@ -132,6 +132,9 @@ func (repository *UserLoveFlagRepository) Find(ctx context.Context, conn transac
132 if v, ok := queryOptions["userId"]; ok { 132 if v, ok := queryOptions["userId"]; ok {
133 tx = tx.Where("user_id=?", v) 133 tx = tx.Where("user_id=?", v)
134 } 134 }
  135 + if v, ok := queryOptions["toUserId"]; ok {
  136 + tx = tx.Where("to_user_id=?", v)
  137 + }
135 if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { 138 if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
136 return dms, tx.Error 139 return dms, tx.Error
137 } 140 }
@@ -160,6 +163,7 @@ func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLo @@ -160,6 +163,7 @@ func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLo
160 CommentAuthor: from.CommentAuthor, 163 CommentAuthor: from.CommentAuthor,
161 CommentId: from.CommentId, 164 CommentId: from.CommentId,
162 UserId: from.UserId, 165 UserId: from.UserId,
  166 + ToUserId: from.ToUserId,
163 CreatedAt: from.CreatedAt, 167 CreatedAt: from.CreatedAt,
164 UpdatedAt: from.UpdatedAt, 168 UpdatedAt: from.UpdatedAt,
165 DeletedAt: from.DeletedAt, 169 DeletedAt: from.DeletedAt,
@@ -177,6 +181,7 @@ func (repository *UserLoveFlagRepository) DomainModelToModel(from *domain.UserLo @@ -177,6 +181,7 @@ func (repository *UserLoveFlagRepository) DomainModelToModel(from *domain.UserLo
177 ArticleAuthor: from.ArticleAuthor, 181 ArticleAuthor: from.ArticleAuthor,
178 CommentAuthor: from.CommentAuthor, 182 CommentAuthor: from.CommentAuthor,
179 UserId: from.UserId, 183 UserId: from.UserId,
  184 + ToUserId: from.ToUserId,
180 CreatedAt: from.CreatedAt, 185 CreatedAt: from.CreatedAt,
181 UpdatedAt: from.UpdatedAt, 186 UpdatedAt: from.UpdatedAt,
182 DeletedAt: from.DeletedAt, 187 DeletedAt: from.DeletedAt,
@@ -14,7 +14,8 @@ type UserLoveFlag struct { @@ -14,7 +14,8 @@ type UserLoveFlag struct {
14 ArticleAuthor int64 `json:"articleAuthor"` // 文章的发布人 14 ArticleAuthor int64 `json:"articleAuthor"` // 文章的发布人
15 CommentId int64 `json:"commentId"` // 点赞评论时,填评论id 15 CommentId int64 `json:"commentId"` // 点赞评论时,填评论id
16 CommentAuthor int64 `json:"commentAuthor"` // 评论的填写人 16 CommentAuthor int64 `json:"commentAuthor"` // 评论的填写人
17 - UserId int64 `json:"userId"` 17 + ToUserId int64 `json:"toUserId"` // 点赞的接受人
  18 + UserId int64 `json:"userId"` // 点赞的人
18 CreatedAt int64 `json:"createdAt,omitempty"` 19 CreatedAt int64 `json:"createdAt,omitempty"`
19 UpdatedAt int64 `json:"updatedAt,omitempty"` 20 UpdatedAt int64 `json:"updatedAt,omitempty"`
20 DeletedAt int64 `json:"deletedAt,omitempty"` 21 DeletedAt int64 `json:"deletedAt,omitempty"`