作者 yangfu

Merge branch 'dev' into test

@@ -15,6 +15,22 @@ @@ -15,6 +15,22 @@
15 "application/json" 15 "application/json"
16 ], 16 ],
17 "paths": { 17 "paths": {
  18 + "v1/clear": {
  19 + "get": {
  20 + "summary": "清理缓存",
  21 + "operationId": "commonGetClearCache",
  22 + "responses": {
  23 + "200": {
  24 + "description": "A successful response.",
  25 + "schema": {}
  26 + }
  27 + },
  28 + "requestBody": {},
  29 + "tags": [
  30 + "common"
  31 + ]
  32 + }
  33 + },
18 "v1/common/sms/code": { 34 "v1/common/sms/code": {
19 "post": { 35 "post": {
20 "summary": "短信验证码", 36 "summary": "短信验证码",
@@ -401,6 +417,34 @@ @@ -401,6 +417,34 @@
401 ] 417 ]
402 } 418 }
403 }, 419 },
  420 + "v1/mini/article_comment/list_reply": {
  421 + "post": {
  422 + "summary": "小程序展示评论对应的一级回复列表",
  423 + "operationId": "MiniListReplyArticleComment",
  424 + "responses": {
  425 + "200": {
  426 + "description": "A successful response.",
  427 + "schema": {
  428 + "$ref": "#/definitions/MiniListReplyArticleCommentResponse"
  429 + }
  430 + }
  431 + },
  432 + "parameters": [
  433 + {
  434 + "name": "body",
  435 + "in": "body",
  436 + "required": true,
  437 + "schema": {
  438 + "$ref": "#/definitions/MiniListReplyArticleCommentRequest"
  439 + }
  440 + }
  441 + ],
  442 + "requestBody": {},
  443 + "tags": [
  444 + "comment"
  445 + ]
  446 + }
  447 + },
404 "v1/mini/article_comment/top5": { 448 "v1/mini/article_comment/top5": {
405 "post": { 449 "post": {
406 "summary": "小程序展示文章的评论列表TOP5", 450 "summary": "小程序展示文章的评论列表TOP5",
@@ -719,6 +763,118 @@ @@ -719,6 +763,118 @@
719 ] 763 ]
720 } 764 }
721 }, 765 },
  766 + "v1/mini/homepage/user_beliked": {
  767 + "post": {
  768 + "summary": "个人主页-获赞的列表",
  769 + "operationId": "miniHomepageUserBeliked",
  770 + "responses": {
  771 + "200": {
  772 + "description": "A successful response.",
  773 + "schema": {
  774 + "$ref": "#/definitions/MiniHomePageUserBeLikedResponse"
  775 + }
  776 + }
  777 + },
  778 + "parameters": [
  779 + {
  780 + "name": "body",
  781 + "in": "body",
  782 + "required": true,
  783 + "schema": {
  784 + "$ref": "#/definitions/MiniHomePageUserBeLikedRequest"
  785 + }
  786 + }
  787 + ],
  788 + "requestBody": {},
  789 + "tags": [
  790 + "user"
  791 + ]
  792 + }
  793 + },
  794 + "v1/mini/homepage/user_follower": {
  795 + "post": {
  796 + "summary": "个人主页-关注我的人",
  797 + "operationId": "miniHomepageUserFollower",
  798 + "responses": {
  799 + "200": {
  800 + "description": "A successful response.",
  801 + "schema": {
  802 + "$ref": "#/definitions/MiniHomePageUserFollowerSearchResponse"
  803 + }
  804 + }
  805 + },
  806 + "parameters": [
  807 + {
  808 + "name": "body",
  809 + "in": "body",
  810 + "required": true,
  811 + "schema": {
  812 + "$ref": "#/definitions/MiniHomePageUserFollowerSearchRequest"
  813 + }
  814 + }
  815 + ],
  816 + "requestBody": {},
  817 + "tags": [
  818 + "user"
  819 + ]
  820 + }
  821 + },
  822 + "v1/mini/homepage/user_info": {
  823 + "post": {
  824 + "summary": "个人主页用户信息",
  825 + "operationId": "miniHomePageUserInfo",
  826 + "responses": {
  827 + "200": {
  828 + "description": "A successful response.",
  829 + "schema": {
  830 + "$ref": "#/definitions/MiniHomePageUserInfoResponse"
  831 + }
  832 + }
  833 + },
  834 + "parameters": [
  835 + {
  836 + "name": "body",
  837 + "in": "body",
  838 + "required": true,
  839 + "schema": {
  840 + "$ref": "#/definitions/MiniHomePageUserInfoRequest"
  841 + }
  842 + }
  843 + ],
  844 + "requestBody": {},
  845 + "tags": [
  846 + "user"
  847 + ]
  848 + }
  849 + },
  850 + "v1/mini/homepage/user_news": {
  851 + "post": {
  852 + "summary": "个人主页-用户发布的信息",
  853 + "operationId": "miniHomepageUserNews",
  854 + "responses": {
  855 + "200": {
  856 + "description": "A successful response.",
  857 + "schema": {
  858 + "$ref": "#/definitions/MiniHomepageUserNewsResposne"
  859 + }
  860 + }
  861 + },
  862 + "parameters": [
  863 + {
  864 + "name": "body",
  865 + "in": "body",
  866 + "required": true,
  867 + "schema": {
  868 + "$ref": "#/definitions/MiniHomepageUserNewsRequest"
  869 + }
  870 + }
  871 + ],
  872 + "requestBody": {},
  873 + "tags": [
  874 + "user"
  875 + ]
  876 + }
  877 + },
722 "v1/mini/message/comment": { 878 "v1/mini/message/comment": {
723 "post": { 879 "post": {
724 "summary": "评论消息", 880 "summary": "评论消息",
@@ -803,6 +959,32 @@ @@ -803,6 +959,32 @@
803 ] 959 ]
804 } 960 }
805 }, 961 },
  962 + "v1/mini/qrcode": {
  963 + "post": {
  964 + "summary": "微信二维码",
  965 + "operationId": "miniQrcodeInvite",
  966 + "responses": {
  967 + "200": {
  968 + "description": "A successful response.",
  969 + "schema": {}
  970 + }
  971 + },
  972 + "parameters": [
  973 + {
  974 + "name": "body",
  975 + "in": "body",
  976 + "required": true,
  977 + "schema": {
  978 + "$ref": "#/definitions/MiniQrCodeRequest"
  979 + }
  980 + }
  981 + ],
  982 + "requestBody": {},
  983 + "tags": [
  984 + "common"
  985 + ]
  986 + }
  987 + },
806 "v1/mini/show/home_page": { 988 "v1/mini/show/home_page": {
807 "get": { 989 "get": {
808 "summary": "小程序首页数据展示", 990 "summary": "小程序首页数据展示",
@@ -1121,6 +1303,34 @@ @@ -1121,6 +1303,34 @@
1121 ] 1303 ]
1122 } 1304 }
1123 }, 1305 },
  1306 + "v1/mini/user/info/edit": {
  1307 + "post": {
  1308 + "summary": "编辑用户信息",
  1309 + "operationId": "miniEditUserInfo",
  1310 + "responses": {
  1311 + "200": {
  1312 + "description": "A successful response.",
  1313 + "schema": {
  1314 + "$ref": "#/definitions/MiniEditUserInfoResponse"
  1315 + }
  1316 + }
  1317 + },
  1318 + "parameters": [
  1319 + {
  1320 + "name": "body",
  1321 + "in": "body",
  1322 + "required": true,
  1323 + "schema": {
  1324 + "$ref": "#/definitions/MiniEditUserInfoRequest"
  1325 + }
  1326 + }
  1327 + ],
  1328 + "requestBody": {},
  1329 + "tags": [
  1330 + "user"
  1331 + ]
  1332 + }
  1333 + },
1124 "v1/mini/user/login": { 1334 "v1/mini/user/login": {
1125 "post": { 1335 "post": {
1126 "summary": "用户登录", 1336 "summary": "用户登录",
@@ -1149,9 +1359,65 @@ @@ -1149,9 +1359,65 @@
1149 ] 1359 ]
1150 } 1360 }
1151 }, 1361 },
  1362 + "v1/mini/user/my_following_news": {
  1363 + "post": {
  1364 + "summary": "我关注人发布的信息",
  1365 + "operationId": "miniUserMyFollowingNews",
  1366 + "responses": {
  1367 + "200": {
  1368 + "description": "A successful response.",
  1369 + "schema": {
  1370 + "$ref": "#/definitions/MiniUserNewsResposne"
  1371 + }
  1372 + }
  1373 + },
  1374 + "parameters": [
  1375 + {
  1376 + "name": "body",
  1377 + "in": "body",
  1378 + "required": true,
  1379 + "schema": {
  1380 + "$ref": "#/definitions/MiniUserNewsRequest"
  1381 + }
  1382 + }
  1383 + ],
  1384 + "requestBody": {},
  1385 + "tags": [
  1386 + "user"
  1387 + ]
  1388 + }
  1389 + },
  1390 + "v1/mini/user/mybeliked": {
  1391 + "post": {
  1392 + "summary": "我被点赞-文章或评论列表",
  1393 + "operationId": "miniMyBeLiked",
  1394 + "responses": {
  1395 + "200": {
  1396 + "description": "A successful response.",
  1397 + "schema": {
  1398 + "$ref": "#/definitions/MiniBeLikedResponse"
  1399 + }
  1400 + }
  1401 + },
  1402 + "parameters": [
  1403 + {
  1404 + "name": "body",
  1405 + "in": "body",
  1406 + "required": true,
  1407 + "schema": {
  1408 + "$ref": "#/definitions/MiniBeLikedRequest"
  1409 + }
  1410 + }
  1411 + ],
  1412 + "requestBody": {},
  1413 + "tags": [
  1414 + "user"
  1415 + ]
  1416 + }
  1417 + },
1152 "v1/mini/user/mylike": { 1418 "v1/mini/user/mylike": {
1153 "post": { 1419 "post": {
1154 - "summary": "我点赞的文章或评论", 1420 + "summary": "我点赞的-文章或评论列表",
1155 "operationId": "miniMyLike", 1421 "operationId": "miniMyLike",
1156 "responses": { 1422 "responses": {
1157 "200": { 1423 "200": {
@@ -1677,6 +1943,34 @@ @@ -1677,6 +1943,34 @@
1677 ] 1943 ]
1678 } 1944 }
1679 }, 1945 },
  1946 + "v1/system/article_comment/edit/love": {
  1947 + "post": {
  1948 + "summary": "编辑评论的运营点赞数",
  1949 + "operationId": "SystemEditAticleCommentLove",
  1950 + "responses": {
  1951 + "200": {
  1952 + "description": "A successful response.",
  1953 + "schema": {
  1954 + "$ref": "#/definitions/SystemEditCommentLoveResponse"
  1955 + }
  1956 + }
  1957 + },
  1958 + "parameters": [
  1959 + {
  1960 + "name": "body",
  1961 + "in": "body",
  1962 + "required": true,
  1963 + "schema": {
  1964 + "$ref": "#/definitions/SystemEditCommentLoveRequest"
  1965 + }
  1966 + }
  1967 + ],
  1968 + "requestBody": {},
  1969 + "tags": [
  1970 + "comment"
  1971 + ]
  1972 + }
  1973 + },
1680 "v1/system/article_comment/edit_show": { 1974 "v1/system/article_comment/edit_show": {
1681 "post": { 1975 "post": {
1682 "summary": "管理后台变更评论的显示状态", 1976 "summary": "管理后台变更评论的显示状态",
@@ -2203,21 +2497,37 @@ @@ -2203,21 +2497,37 @@
2203 ] 2497 ]
2204 } 2498 }
2205 }, 2499 },
2206 - "v1/system/role/search": {  
2207 - "post": {  
2208 - "summary": "角色列表搜索",  
2209 - "operationId": "systemSearchRole", 2500 + "v1/system/role/auths": {
  2501 + "get": {
  2502 + "summary": "角色权限列表",
  2503 + "operationId": "systemGetRoleAuths",
2210 "responses": { 2504 "responses": {
2211 "200": { 2505 "200": {
2212 "description": "A successful response.", 2506 "description": "A successful response.",
2213 - "schema": {  
2214 - "$ref": "#/definitions/RoleSearchResponse"  
2215 - } 2507 + "schema": {}
2216 } 2508 }
2217 }, 2509 },
2218 - "parameters": [  
2219 - {  
2220 - "name": "body", 2510 + "requestBody": {},
  2511 + "tags": [
  2512 + "role"
  2513 + ]
  2514 + }
  2515 + },
  2516 + "v1/system/role/search": {
  2517 + "post": {
  2518 + "summary": "角色列表搜索",
  2519 + "operationId": "systemSearchRole",
  2520 + "responses": {
  2521 + "200": {
  2522 + "description": "A successful response.",
  2523 + "schema": {
  2524 + "$ref": "#/definitions/RoleSearchResponse"
  2525 + }
  2526 + }
  2527 + },
  2528 + "parameters": [
  2529 + {
  2530 + "name": "body",
2221 "in": "body", 2531 "in": "body",
2222 "required": true, 2532 "required": true,
2223 "schema": { 2533 "schema": {
@@ -2661,6 +2971,10 @@ @@ -2661,6 +2971,10 @@
2661 }, 2971 },
2662 "description": " 填写评论时@的人" 2972 "description": " 填写评论时@的人"
2663 }, 2973 },
  2974 + "matchUrl": {
  2975 + "type": "object",
  2976 + "description": " 评论内容中的url文本"
  2977 + },
2664 "createdAt": { 2978 "createdAt": {
2665 "type": "integer", 2979 "type": "integer",
2666 "format": "int64" 2980 "format": "int64"
@@ -2668,7 +2982,7 @@ @@ -2668,7 +2982,7 @@
2668 "meLoveFlag": { 2982 "meLoveFlag": {
2669 "type": "integer", 2983 "type": "integer",
2670 "format": "int32", 2984 "format": "int32",
2671 - "description": "当前人员对评论的点赞标识 (0 没有点赞 1有点赞)" 2985 + "description": " 当前人员对评论的点赞标识 (0 没有点赞 1有点赞)"
2672 }, 2986 },
2673 "content": { 2987 "content": {
2674 "type": "string", 2988 "type": "string",
@@ -2691,6 +3005,7 @@ @@ -2691,6 +3005,7 @@
2691 "countUserLove", 3005 "countUserLove",
2692 "countAdminLove", 3006 "countAdminLove",
2693 "atWho", 3007 "atWho",
  3008 + "matchUrl",
2694 "createdAt", 3009 "createdAt",
2695 "meLoveFlag", 3010 "meLoveFlag",
2696 "content" 3011 "content"
@@ -2725,11 +3040,16 @@ @@ -2725,11 +3040,16 @@
2725 "format": "int32", 3040 "format": "int32",
2726 "description": "点赞数量" 3041 "description": "点赞数量"
2727 }, 3042 },
2728 - "CountComment": { 3043 + "countComment": {
2729 "type": "integer", 3044 "type": "integer",
2730 "format": "int32", 3045 "format": "int32",
2731 "description": "评论数量" 3046 "description": "评论数量"
2732 }, 3047 },
  3048 + "countRead": {
  3049 + "type": "integer",
  3050 + "format": "int32",
  3051 + "description": "浏览数量"
  3052 + },
2733 "show": { 3053 "show": {
2734 "type": "integer", 3054 "type": "integer",
2735 "format": "int32", 3055 "format": "int32",
@@ -2743,7 +3063,8 @@ @@ -2743,7 +3063,8 @@
2743 "images", 3063 "images",
2744 "createdAt", 3064 "createdAt",
2745 "countLove", 3065 "countLove",
2746 - "CountComment", 3066 + "countComment",
  3067 + "countRead",
2747 "show" 3068 "show"
2748 ] 3069 ]
2749 }, 3070 },
@@ -2811,6 +3132,11 @@ @@ -2811,6 +3132,11 @@
2811 "type": "integer", 3132 "type": "integer",
2812 "format": "int32", 3133 "format": "int32",
2813 "description": " 已读的标签数量" 3134 "description": " 已读的标签数量"
  3135 + },
  3136 + "sortBy": {
  3137 + "type": "integer",
  3138 + "format": "int32",
  3139 + "description": " 排序"
2814 } 3140 }
2815 }, 3141 },
2816 "title": "ArticleTagCount", 3142 "title": "ArticleTagCount",
@@ -2821,7 +3147,8 @@ @@ -2821,7 +3147,8 @@
2821 "tagName", 3147 "tagName",
2822 "tagRemark", 3148 "tagRemark",
2823 "totalArticle", 3149 "totalArticle",
2824 - "readArticle" 3150 + "readArticle",
  3151 + "sortBy"
2825 ] 3152 ]
2826 }, 3153 },
2827 "ArticleTagGroup": { 3154 "ArticleTagGroup": {
@@ -2858,6 +3185,10 @@ @@ -2858,6 +3185,10 @@
2858 }, 3185 },
2859 "image": { 3186 "image": {
2860 "type": "string" 3187 "type": "string"
  3188 + },
  3189 + "sortBy": {
  3190 + "type": "integer",
  3191 + "format": "int32"
2861 } 3192 }
2862 }, 3193 },
2863 "title": "ArticleTagItem", 3194 "title": "ArticleTagItem",
@@ -2865,7 +3196,8 @@ @@ -2865,7 +3196,8 @@
2865 "id", 3196 "id",
2866 "category", 3197 "category",
2867 "name", 3198 "name",
2868 - "image" 3199 + "image",
  3200 + "sortBy"
2869 ] 3201 ]
2870 }, 3202 },
2871 "Auth": { 3203 "Auth": {
@@ -2899,6 +3231,10 @@ @@ -2899,6 +3231,10 @@
2899 "type": "integer", 3231 "type": "integer",
2900 "format": "int64" 3232 "format": "int64"
2901 }, 3233 },
  3234 + "avatar": {
  3235 + "type": "string",
  3236 + "description": " 人员头像URL"
  3237 + },
2902 "name": { 3238 "name": {
2903 "type": "string" 3239 "type": "string"
2904 }, 3240 },
@@ -3268,7 +3604,7 @@ @@ -3268,7 +3604,7 @@
3268 "optType": { 3604 "optType": {
3269 "type": "integer", 3605 "type": "integer",
3270 "format": "int32", 3606 "format": "int32",
3271 - "description": " 操作类型(1针对文章、1针对评论、2针对圆桌)" 3607 + "description": " 操作类型(1针对文章或段落、2针对评论、3针对圆桌)"
3272 }, 3608 },
3273 "companyId": { 3609 "companyId": {
3274 "type": "integer", 3610 "type": "integer",
@@ -3290,25 +3626,6 @@ @@ -3290,25 +3626,6 @@
3290 "format": "int64", 3626 "format": "int64",
3291 "description": " 文章ID" 3627 "description": " 文章ID"
3292 }, 3628 },
3293 - "commentId": {  
3294 - "type": "integer",  
3295 - "format": "int64",  
3296 - "description": " 评论ID"  
3297 - },  
3298 - "discussionId": {  
3299 - "type": "integer",  
3300 - "format": "int64",  
3301 - "description": " 圆桌ID"  
3302 - },  
3303 - "discussionOpinionId": {  
3304 - "type": "integer",  
3305 - "format": "int64",  
3306 - "description": " 观点ID"  
3307 - },  
3308 - "content": {  
3309 - "type": "string",  
3310 - "description": " 消息内容"  
3311 - },  
3312 "createdAt": { 3629 "createdAt": {
3313 "type": "integer", 3630 "type": "integer",
3314 "format": "int64", 3631 "format": "int64",
@@ -3324,7 +3641,11 @@ @@ -3324,7 +3641,11 @@
3324 }, 3641 },
3325 "comment": { 3642 "comment": {
3326 "$ref": "#/definitions/SimpleComment", 3643 "$ref": "#/definitions/SimpleComment",
3327 - "description": " 评论(不一定是自己,可能是被人@到)" 3644 + "description": " 评论"
  3645 + },
  3646 + "commentParent": {
  3647 + "$ref": "#/definitions/SimpleComment",
  3648 + "description": " 被回复的评论"
3328 } 3649 }
3329 }, 3650 },
3330 "title": "MessageBusinessItem", 3651 "title": "MessageBusinessItem",
@@ -3336,14 +3657,11 @@ @@ -3336,14 +3657,11 @@
3336 "userId", 3657 "userId",
3337 "recipientId", 3658 "recipientId",
3338 "articleId", 3659 "articleId",
3339 - "commentId",  
3340 - "discussionId",  
3341 - "discussionOpinionId",  
3342 - "content",  
3343 "createdAt", 3660 "createdAt",
3344 "user", 3661 "user",
3345 "article", 3662 "article",
3346 - "comment" 3663 + "comment",
  3664 + "commentParent"
3347 ] 3665 ]
3348 }, 3666 },
3349 "MessageBusinessResponse": { 3667 "MessageBusinessResponse": {
@@ -3637,12 +3955,17 @@ @@ -3637,12 +3955,17 @@
3637 "location": { 3955 "location": {
3638 "$ref": "#/definitions/Location", 3956 "$ref": "#/definitions/Location",
3639 "description": "定位坐标" 3957 "description": "定位坐标"
  3958 + },
  3959 + "matchUrl": {
  3960 + "type": "object",
  3961 + "description": " 匹配文章内容中的url文本"
3640 } 3962 }
3641 }, 3963 },
3642 "title": "MiniArticleCreateRequest", 3964 "title": "MiniArticleCreateRequest",
3643 "required": [ 3965 "required": [
3644 "title", 3966 "title",
3645 - "section" 3967 + "section",
  3968 + "matchUrl"
3646 ] 3969 ]
3647 }, 3970 },
3648 "MiniArticleCreateResponse": { 3971 "MiniArticleCreateResponse": {
@@ -3712,6 +4035,10 @@ @@ -3712,6 +4035,10 @@
3712 "location": { 4035 "location": {
3713 "$ref": "#/definitions/Location", 4036 "$ref": "#/definitions/Location",
3714 "description": " 坐标" 4037 "description": " 坐标"
  4038 + },
  4039 + "matchUrl": {
  4040 + "type": "object",
  4041 + "description": " 匹配文章内容中的url文本"
3715 } 4042 }
3716 }, 4043 },
3717 "title": "MiniArticleDraftCreateRequest", 4044 "title": "MiniArticleDraftCreateRequest",
@@ -3722,7 +4049,8 @@ @@ -3722,7 +4049,8 @@
3722 "images", 4049 "images",
3723 "whoRead", 4050 "whoRead",
3724 "whoReview", 4051 "whoReview",
3725 - "location" 4052 + "location",
  4053 + "matchUrl"
3726 ] 4054 ]
3727 }, 4055 },
3728 "MiniArticleDraftCreateResponse": { 4056 "MiniArticleDraftCreateResponse": {
@@ -3846,6 +4174,9 @@ @@ -3846,6 +4174,9 @@
3846 "location": { 4174 "location": {
3847 "$ref": "#/definitions/Location", 4175 "$ref": "#/definitions/Location",
3848 "description": " 坐标" 4176 "description": " 坐标"
  4177 + },
  4178 + "matchUrl": {
  4179 + "type": "object"
3849 } 4180 }
3850 }, 4181 },
3851 "title": "MiniArticleDraftGetMeResponse", 4182 "title": "MiniArticleDraftGetMeResponse",
@@ -3857,7 +4188,8 @@ @@ -3857,7 +4188,8 @@
3857 "images", 4188 "images",
3858 "whoRead", 4189 "whoRead",
3859 "whoReview", 4190 "whoReview",
3860 - "location" 4191 + "location",
  4192 + "matchUrl"
3861 ] 4193 ]
3862 }, 4194 },
3863 "MiniArticleDraftItem": { 4195 "MiniArticleDraftItem": {
@@ -3893,6 +4225,10 @@ @@ -3893,6 +4225,10 @@
3893 "createdAt": { 4225 "createdAt": {
3894 "type": "integer", 4226 "type": "integer",
3895 "format": "int64" 4227 "format": "int64"
  4228 + },
  4229 + "matchUrl": {
  4230 + "type": "object",
  4231 + "description": "匹配内容中的url文本"
3896 } 4232 }
3897 }, 4233 },
3898 "title": "MiniArticleDraftItem", 4234 "title": "MiniArticleDraftItem",
@@ -3902,7 +4238,8 @@ @@ -3902,7 +4238,8 @@
3902 "section", 4238 "section",
3903 "title", 4239 "title",
3904 "images", 4240 "images",
3905 - "createdAt" 4241 + "createdAt",
  4242 + "matchUrl"
3906 ] 4243 ]
3907 }, 4244 },
3908 "MiniArticleDraftSearchMeRequest": { 4245 "MiniArticleDraftSearchMeRequest": {
@@ -4011,6 +4348,10 @@ @@ -4011,6 +4348,10 @@
4011 "location": { 4348 "location": {
4012 "$ref": "#/definitions/Location", 4349 "$ref": "#/definitions/Location",
4013 "description": " 坐标" 4350 "description": " 坐标"
  4351 + },
  4352 + "matchUrl": {
  4353 + "type": "object",
  4354 + "description": " 匹配文章内容中的url文本"
4014 } 4355 }
4015 }, 4356 },
4016 "title": "MiniArticleDraftUpdateRequest", 4357 "title": "MiniArticleDraftUpdateRequest",
@@ -4022,7 +4363,8 @@ @@ -4022,7 +4363,8 @@
4022 "images", 4363 "images",
4023 "whoRead", 4364 "whoRead",
4024 "whoReview", 4365 "whoReview",
4025 - "location" 4366 + "location",
  4367 + "matchUrl"
4026 ] 4368 ]
4027 }, 4369 },
4028 "MiniArticleDraftUpdateResponse": { 4370 "MiniArticleDraftUpdateResponse": {
@@ -4102,6 +4444,13 @@ @@ -4102,6 +4444,13 @@
4102 }, 4444 },
4103 "description": "图片" 4445 "description": "图片"
4104 }, 4446 },
  4447 + "videos": {
  4448 + "type": "array",
  4449 + "items": {
  4450 + "$ref": "#/definitions/Video"
  4451 + },
  4452 + "description": "视频"
  4453 + },
4105 "whoRead": { 4454 "whoRead": {
4106 "type": "array", 4455 "type": "array",
4107 "items": { 4456 "items": {
@@ -4163,6 +4512,10 @@ @@ -4163,6 +4512,10 @@
4163 "type": "string" 4512 "type": "string"
4164 }, 4513 },
4165 "description": " 文章的标签" 4514 "description": " 文章的标签"
  4515 + },
  4516 + "matchUrl": {
  4517 + "type": "object",
  4518 + "description": " 匹配文章内容中的url文本"
4166 } 4519 }
4167 }, 4520 },
4168 "title": "MiniArticleGetResponse", 4521 "title": "MiniArticleGetResponse",
@@ -4174,6 +4527,7 @@ @@ -4174,6 +4527,7 @@
4174 "createdAt", 4527 "createdAt",
4175 "section", 4528 "section",
4176 "images", 4529 "images",
  4530 + "videos",
4177 "whoRead", 4531 "whoRead",
4178 "whoReview", 4532 "whoReview",
4179 "location", 4533 "location",
@@ -4184,7 +4538,8 @@ @@ -4184,7 +4538,8 @@
4184 "edit", 4538 "edit",
4185 "meLoveFlag", 4539 "meLoveFlag",
4186 "meFollowFlag", 4540 "meFollowFlag",
4187 - "tags" 4541 + "tags",
  4542 + "matchUrl"
4188 ] 4543 ]
4189 }, 4544 },
4190 "MiniArticleMarkItem": { 4545 "MiniArticleMarkItem": {
@@ -4369,8 +4724,11 @@ @@ -4369,8 +4724,11 @@
4369 "description": " 文章id" 4724 "description": " 文章id"
4370 }, 4725 },
4371 "tagId": { 4726 "tagId": {
4372 - "type": "integer",  
4373 - "format": "int64", 4727 + "type": "array",
  4728 + "items": {
  4729 + "type": "integer",
  4730 + "format": "int64"
  4731 + },
4374 "description": " 标签id" 4732 "description": " 标签id"
4375 } 4733 }
4376 }, 4734 },
@@ -4384,8 +4742,11 @@ @@ -4384,8 +4742,11 @@
4384 "type": "object", 4742 "type": "object",
4385 "properties": { 4743 "properties": {
4386 "id": { 4744 "id": {
4387 - "type": "integer",  
4388 - "format": "int64" 4745 + "type": "array",
  4746 + "items": {
  4747 + "type": "integer",
  4748 + "format": "int64"
  4749 + }
4389 } 4750 }
4390 }, 4751 },
4391 "title": "MiniArticleSetTagResponse", 4752 "title": "MiniArticleSetTagResponse",
@@ -4393,6 +4754,44 @@ @@ -4393,6 +4754,44 @@
4393 "id" 4754 "id"
4394 ] 4755 ]
4395 }, 4756 },
  4757 + "MiniBeLikedRequest": {
  4758 + "type": "object",
  4759 + "properties": {
  4760 + "page": {
  4761 + "type": "integer",
  4762 + "format": "int32"
  4763 + },
  4764 + "size": {
  4765 + "type": "integer",
  4766 + "format": "int32"
  4767 + }
  4768 + },
  4769 + "title": "MiniBeLikedRequest",
  4770 + "required": [
  4771 + "page",
  4772 + "size"
  4773 + ]
  4774 + },
  4775 + "MiniBeLikedResponse": {
  4776 + "type": "object",
  4777 + "properties": {
  4778 + "list": {
  4779 + "type": "array",
  4780 + "items": {
  4781 + "$ref": "#/definitions/MyBeLikedItem"
  4782 + }
  4783 + },
  4784 + "total": {
  4785 + "type": "integer",
  4786 + "format": "int64"
  4787 + }
  4788 + },
  4789 + "title": "MiniBeLikedResponse",
  4790 + "required": [
  4791 + "list",
  4792 + "total"
  4793 + ]
  4794 + },
4396 "MiniCreateArticleCommentRequest": { 4795 "MiniCreateArticleCommentRequest": {
4397 "type": "object", 4796 "type": "object",
4398 "properties": { 4797 "properties": {
@@ -4431,15 +4830,17 @@ @@ -4431,15 +4830,17 @@
4431 "$ref": "#/definitions/CommentAtWho" 4830 "$ref": "#/definitions/CommentAtWho"
4432 }, 4831 },
4433 "description": " 填写评论时@的人" 4832 "description": " 填写评论时@的人"
  4833 + },
  4834 + "matchUrl": {
  4835 + "type": "object",
  4836 + "description": " 评论内容中的url文本"
4434 } 4837 }
4435 }, 4838 },
4436 "title": "MiniCreateArticleCommentRequest", 4839 "title": "MiniCreateArticleCommentRequest",
4437 "required": [ 4840 "required": [
4438 "articleId", 4841 "articleId",
4439 "sectionId", 4842 "sectionId",
4440 - "pid",  
4441 - "content",  
4442 - "atWho" 4843 + "content"
4443 ] 4844 ]
4444 }, 4845 },
4445 "MiniCreateArticleCommentResponse": { 4846 "MiniCreateArticleCommentResponse": {
@@ -4511,6 +4912,10 @@ @@ -4511,6 +4912,10 @@
4511 }, 4912 },
4512 "description": " 填写评论时@的人" 4913 "description": " 填写评论时@的人"
4513 }, 4914 },
  4915 + "matchUrl": {
  4916 + "type": "object",
  4917 + "description": " 评论内容中的url文本"
  4918 + },
4514 "createdAt": { 4919 "createdAt": {
4515 "type": "integer", 4920 "type": "integer",
4516 "format": "int64" 4921 "format": "int64"
@@ -4532,6 +4937,7 @@ @@ -4532,6 +4937,7 @@
4532 "countUserLove", 4937 "countUserLove",
4533 "countAdminLove", 4938 "countAdminLove",
4534 "atWho", 4939 "atWho",
  4940 + "matchUrl",
4535 "createdAt" 4941 "createdAt"
4536 ] 4942 ]
4537 }, 4943 },
@@ -4569,6 +4975,22 @@ @@ -4569,6 +4975,22 @@
4569 "id" 4975 "id"
4570 ] 4976 ]
4571 }, 4977 },
  4978 + "MiniEditUserInfoRequest": {
  4979 + "type": "object",
  4980 + "properties": {
  4981 + "avatar": {
  4982 + "$ref": "#/definitions/string"
  4983 + }
  4984 + },
  4985 + "title": "MiniEditUserInfoRequest",
  4986 + "required": [
  4987 + "avatar"
  4988 + ]
  4989 + },
  4990 + "MiniEditUserInfoResponse": {
  4991 + "type": "object",
  4992 + "title": "MiniEditUserInfoResponse"
  4993 + },
4572 "MiniGetArticleCommentRequest": { 4994 "MiniGetArticleCommentRequest": {
4573 "type": "object", 4995 "type": "object",
4574 "properties": { 4996 "properties": {
@@ -4622,29 +5044,281 @@ @@ -4622,29 +5044,281 @@
4622 "type": "string" 5044 "type": "string"
4623 } 5045 }
4624 }, 5046 },
4625 - "tags": { 5047 + "tags": {
  5048 + "type": "array",
  5049 + "items": {
  5050 + "$ref": "#/definitions/ArticleTagCount"
  5051 + }
  5052 + }
  5053 + },
  5054 + "title": "MiniHomePageResponse",
  5055 + "required": [
  5056 + "tagCategory",
  5057 + "tags"
  5058 + ]
  5059 + },
  5060 + "MiniHomePageUserBeLikedRequest": {
  5061 + "type": "object",
  5062 + "properties": {
  5063 + "userId": {
  5064 + "type": "integer",
  5065 + "format": "int32"
  5066 + },
  5067 + "page": {
  5068 + "type": "integer",
  5069 + "format": "int32"
  5070 + },
  5071 + "size": {
  5072 + "type": "integer",
  5073 + "format": "int32"
  5074 + }
  5075 + },
  5076 + "title": "MiniHomePageUserBeLikedRequest",
  5077 + "required": [
  5078 + "userId",
  5079 + "page",
  5080 + "size"
  5081 + ]
  5082 + },
  5083 + "MiniHomePageUserBeLikedResponse": {
  5084 + "type": "object",
  5085 + "properties": {
  5086 + "list": {
  5087 + "type": "array",
  5088 + "items": {
  5089 + "$ref": "#/definitions/MyBeLikedItem"
  5090 + }
  5091 + },
  5092 + "total": {
  5093 + "type": "integer",
  5094 + "format": "int64"
  5095 + }
  5096 + },
  5097 + "title": "MiniHomePageUserBeLikedResponse",
  5098 + "required": [
  5099 + "list",
  5100 + "total"
  5101 + ]
  5102 + },
  5103 + "MiniHomePageUserFollowerSearchRequest": {
  5104 + "type": "object",
  5105 + "properties": {
  5106 + "userId": {
  5107 + "type": "integer",
  5108 + "format": "int32"
  5109 + },
  5110 + "page": {
  5111 + "type": "integer",
  5112 + "format": "int32"
  5113 + },
  5114 + "size": {
  5115 + "type": "integer",
  5116 + "format": "int32"
  5117 + }
  5118 + },
  5119 + "title": "MiniHomePageUserFollowerSearchRequest",
  5120 + "required": [
  5121 + "userId"
  5122 + ]
  5123 + },
  5124 + "MiniHomePageUserFollowerSearchResponse": {
  5125 + "type": "object",
  5126 + "properties": {
  5127 + "users": {
  5128 + "type": "array",
  5129 + "items": {
  5130 + "$ref": "#/definitions/UserFollowItem"
  5131 + }
  5132 + },
  5133 + "total": {
  5134 + "type": "integer",
  5135 + "format": "int64"
  5136 + }
  5137 + },
  5138 + "title": "MiniHomePageUserFollowerSearchResponse",
  5139 + "required": [
  5140 + "users",
  5141 + "total"
  5142 + ]
  5143 + },
  5144 + "MiniHomePageUserInfoRequest": {
  5145 + "type": "object",
  5146 + "properties": {
  5147 + "userId": {
  5148 + "type": "integer",
  5149 + "format": "int64",
  5150 + "description": " 用户ID"
  5151 + }
  5152 + },
  5153 + "title": "MiniHomePageUserInfoRequest",
  5154 + "required": [
  5155 + "userId"
  5156 + ]
  5157 + },
  5158 + "MiniHomePageUserInfoResponse": {
  5159 + "type": "object",
  5160 + "properties": {
  5161 + "user": {
  5162 + "$ref": "#/definitions/UserItem",
  5163 + "description": " 用户信息"
  5164 + },
  5165 + "totalFollower": {
  5166 + "type": "integer",
  5167 + "format": "int32",
  5168 + "description": " 关注他的人数"
  5169 + },
  5170 + "totalBeLoved": {
  5171 + "type": "integer",
  5172 + "format": "int32",
  5173 + "description": " 获赞数"
  5174 + },
  5175 + "followed": {
  5176 + "type": "boolean",
  5177 + "format": "boolean",
  5178 + "description": " 关注"
  5179 + },
  5180 + "mutualFollowed": {
  5181 + "type": "boolean",
  5182 + "format": "boolean",
  5183 + "description": " 互相关注标识"
  5184 + }
  5185 + },
  5186 + "title": "MiniHomePageUserInfoResponse",
  5187 + "required": [
  5188 + "user",
  5189 + "totalFollower",
  5190 + "totalBeLoved",
  5191 + "followed",
  5192 + "mutualFollowed"
  5193 + ]
  5194 + },
  5195 + "MiniHomepageUserNewsRequest": {
  5196 + "type": "object",
  5197 + "properties": {
  5198 + "authorId": {
  5199 + "type": "integer",
  5200 + "format": "int64",
  5201 + "description": " 特定作者ID"
  5202 + },
  5203 + "lastArticleId": {
  5204 + "type": "integer",
  5205 + "format": "int64",
  5206 + "description": " 最后文章ID"
  5207 + },
  5208 + "size": {
  5209 + "type": "integer",
  5210 + "format": "int32",
  5211 + "description": " 数量"
  5212 + },
  5213 + "orderByHotScore": {
  5214 + "type": "string",
  5215 + "default": "desc",
  5216 + "description": " 热度排序 升序 asc 降序 desc"
  5217 + },
  5218 + "keywords": {
  5219 + "type": "string",
  5220 + "description": " 关键字"
  5221 + },
  5222 + "beginTime": {
  5223 + "type": "integer",
  5224 + "format": "int64",
  5225 + "description": " 开始时间"
  5226 + },
  5227 + "beginTime": {
  5228 + "type": "integer",
  5229 + "format": "int64",
  5230 + "description": " 结束时间"
  5231 + }
  5232 + },
  5233 + "title": "MiniHomepageUserNewsRequest",
  5234 + "required": [
  5235 + "authorId",
  5236 + "size",
  5237 + "orderByHotScore"
  5238 + ]
  5239 + },
  5240 + "MiniHomepageUserNewsResposne": {
  5241 + "type": "object",
  5242 + "properties": {
  5243 + "list": {
  5244 + "type": "array",
  5245 + "items": {
  5246 + "$ref": "#/definitions/UserNewsItem"
  5247 + }
  5248 + },
  5249 + "lastArticleId": {
  5250 + "type": "integer",
  5251 + "format": "int64",
  5252 + "description": " 最后文章ID"
  5253 + }
  5254 + },
  5255 + "title": "MiniHomepageUserNewsResposne",
  5256 + "required": [
  5257 + "list",
  5258 + "lastArticleId"
  5259 + ]
  5260 + },
  5261 + "MiniListArticleCommentRequest": {
  5262 + "type": "object",
  5263 + "properties": {
  5264 + "page": {
  5265 + "type": "integer",
  5266 + "format": "int32"
  5267 + },
  5268 + "size": {
  5269 + "type": "integer",
  5270 + "format": "int32"
  5271 + },
  5272 + "": {
  5273 + "type": "integer",
  5274 + "format": "int64"
  5275 + },
  5276 + "": {
  5277 + "type": "integer",
  5278 + "format": "int64"
  5279 + },
  5280 + "articleId": {
  5281 + "type": "integer",
  5282 + "format": "int64"
  5283 + },
  5284 + "sectionId": {
  5285 + "type": "integer",
  5286 + "format": "int64"
  5287 + }
  5288 + },
  5289 + "title": "MiniListArticleCommentRequest",
  5290 + "required": [
  5291 + "page",
  5292 + "size",
  5293 + "articleId"
  5294 + ]
  5295 + },
  5296 + "MiniListArticleCommentResponse": {
  5297 + "type": "object",
  5298 + "properties": {
  5299 + "total": {
  5300 + "type": "integer",
  5301 + "format": "int64"
  5302 + },
  5303 + "list": {
4626 "type": "array", 5304 "type": "array",
4627 "items": { 5305 "items": {
4628 - "$ref": "#/definitions/ArticleTagCount" 5306 + "$ref": "#/definitions/ArticleCommentAndReply"
4629 } 5307 }
4630 } 5308 }
4631 }, 5309 },
4632 - "title": "MiniHomePageResponse", 5310 + "title": "MiniListArticleCommentResponse",
4633 "required": [ 5311 "required": [
4634 - "tagCategory",  
4635 - "tags" 5312 + "total",
  5313 + "list"
4636 ] 5314 ]
4637 }, 5315 },
4638 - "MiniListArticleCommentRequest": { 5316 + "MiniListReplyArticleCommentRequest": {
4639 "type": "object", 5317 "type": "object",
4640 "properties": { 5318 "properties": {
4641 - "page": {  
4642 - "type": "integer",  
4643 - "format": "int32"  
4644 - },  
4645 - "size": { 5319 + "commentId": {
4646 "type": "integer", 5320 "type": "integer",
4647 - "format": "int32" 5321 + "format": "int64"
4648 }, 5322 },
4649 "": { 5323 "": {
4650 "type": "integer", 5324 "type": "integer",
@@ -4654,23 +5328,23 @@ @@ -4654,23 +5328,23 @@
4654 "type": "integer", 5328 "type": "integer",
4655 "format": "int64" 5329 "format": "int64"
4656 }, 5330 },
4657 - "articleId": { 5331 + "page": {
4658 "type": "integer", 5332 "type": "integer",
4659 - "format": "int64" 5333 + "format": "int32"
4660 }, 5334 },
4661 - "sectionId": { 5335 + "size": {
4662 "type": "integer", 5336 "type": "integer",
4663 - "format": "int64" 5337 + "format": "int32"
4664 } 5338 }
4665 }, 5339 },
4666 - "title": "MiniListArticleCommentRequest", 5340 + "title": "MiniListReplyArticleCommentRequest",
4667 "required": [ 5341 "required": [
  5342 + "commentId",
4668 "page", 5343 "page",
4669 - "size",  
4670 - "articleId" 5344 + "size"
4671 ] 5345 ]
4672 }, 5346 },
4673 - "MiniListArticleCommentResponse": { 5347 + "MiniListReplyArticleCommentResponse": {
4674 "type": "object", 5348 "type": "object",
4675 "properties": { 5349 "properties": {
4676 "total": { 5350 "total": {
@@ -4680,11 +5354,11 @@ @@ -4680,11 +5354,11 @@
4680 "list": { 5354 "list": {
4681 "type": "array", 5355 "type": "array",
4682 "items": { 5356 "items": {
4683 - "$ref": "#/definitions/ArticleCommentAndReply" 5357 + "$ref": "#/definitions/ArticleCommentItem"
4684 } 5358 }
4685 } 5359 }
4686 }, 5360 },
4687 - "title": "MiniListArticleCommentResponse", 5361 + "title": "MiniListReplyArticleCommentResponse",
4688 "required": [ 5362 "required": [
4689 "total", 5363 "total",
4690 "list" 5364 "list"
@@ -4728,6 +5402,24 @@ @@ -4728,6 +5402,24 @@
4728 "total" 5402 "total"
4729 ] 5403 ]
4730 }, 5404 },
  5405 + "MiniQrCodeRequest": {
  5406 + "type": "object",
  5407 + "properties": {
  5408 + "page": {
  5409 + "type": "string",
  5410 + "description": " 微信页面入口"
  5411 + },
  5412 + "scene": {
  5413 + "type": "string",
  5414 + "description": " 参数"
  5415 + }
  5416 + },
  5417 + "title": "MiniQrCodeRequest",
  5418 + "required": [
  5419 + "page",
  5420 + "scene"
  5421 + ]
  5422 + },
4731 "MiniSearchArticleItem": { 5423 "MiniSearchArticleItem": {
4732 "type": "object", 5424 "type": "object",
4733 "properties": { 5425 "properties": {
@@ -4738,6 +5430,10 @@ @@ -4738,6 +5430,10 @@
4738 "title": { 5430 "title": {
4739 "type": "string" 5431 "type": "string"
4740 }, 5432 },
  5433 + "authorId": {
  5434 + "type": "integer",
  5435 + "format": "int64"
  5436 + },
4741 "author": { 5437 "author": {
4742 "type": "string", 5438 "type": "string",
4743 "description": " 发布人" 5439 "description": " 发布人"
@@ -4766,6 +5462,7 @@ @@ -4766,6 +5462,7 @@
4766 "required": [ 5462 "required": [
4767 "articleId", 5463 "articleId",
4768 "title", 5464 "title",
  5465 + "authorId",
4769 "author", 5466 "author",
4770 "avatar", 5467 "avatar",
4771 "images", 5468 "images",
@@ -5281,10 +5978,61 @@ @@ -5281,10 +5978,61 @@
5281 "type": "integer", 5978 "type": "integer",
5282 "format": "int64", 5979 "format": "int64",
5283 "description": " 按角色角色关联的用户" 5980 "description": " 按角色角色关联的用户"
  5981 + },
  5982 + "keywords": {
  5983 + "type": "string",
  5984 + "description": " 按关键字搜索(名称)"
5284 } 5985 }
5285 }, 5986 },
5286 "title": "MiniUsersListRequest" 5987 "title": "MiniUsersListRequest"
5287 }, 5988 },
  5989 + "MyBeLikedItem": {
  5990 + "type": "object",
  5991 + "properties": {
  5992 + "userId": {
  5993 + "type": "integer",
  5994 + "format": "int64",
  5995 + "description": " 点赞人id"
  5996 + },
  5997 + "articleId": {
  5998 + "type": "integer",
  5999 + "format": "int64",
  6000 + "description": " 文章id"
  6001 + },
  6002 + "commentId": {
  6003 + "type": "integer",
  6004 + "format": "int64",
  6005 + "description": " 评论id"
  6006 + },
  6007 + "createdAt": {
  6008 + "type": "integer",
  6009 + "format": "int64",
  6010 + "description": " 创建时间"
  6011 + },
  6012 + "user": {
  6013 + "$ref": "#/definitions/SimpleUser",
  6014 + "description": " 点赞人"
  6015 + },
  6016 + "article": {
  6017 + "$ref": "#/definitions/SimpleArticle",
  6018 + "description": " 文章"
  6019 + },
  6020 + "comment": {
  6021 + "$ref": "#/definitions/SimpleComment",
  6022 + "description": " 评论"
  6023 + }
  6024 + },
  6025 + "title": "MyBeLikedItem",
  6026 + "required": [
  6027 + "userId",
  6028 + "articleId",
  6029 + "commentId",
  6030 + "createdAt",
  6031 + "user",
  6032 + "article",
  6033 + "comment"
  6034 + ]
  6035 + },
5288 "MyLikeItem": { 6036 "MyLikeItem": {
5289 "type": "object", 6037 "type": "object",
5290 "properties": { 6038 "properties": {
@@ -5602,29 +6350,42 @@ @@ -5602,29 +6350,42 @@
5602 "type": "string", 6350 "type": "string",
5603 "description": " 评论内容" 6351 "description": " 评论内容"
5604 }, 6352 },
5605 - "countLove": { 6353 + "show": {
5606 "type": "integer", 6354 "type": "integer",
5607 "format": "int32", 6355 "format": "int32",
5608 - "description": " 点赞数量" 6356 + "description": " 评论的展示状态(0显示、1不显示)"
5609 }, 6357 },
5610 - "countComment": { 6358 + "atWho": {
  6359 + "type": "array",
  6360 + "items": {
  6361 + "$ref": "#/definitions/CommentAtWho"
  6362 + },
  6363 + "description": " 填写评论时@的人"
  6364 + },
  6365 + "matchUrl": {
  6366 + "type": "object",
  6367 + "description": " 评论内容中的url文本"
  6368 + },
  6369 + "countReply": {
5611 "type": "integer", 6370 "type": "integer",
5612 "format": "int32", 6371 "format": "int32",
5613 - "description": " 评论数量" 6372 + "description": " 用户回复数量"
5614 }, 6373 },
5615 - "show": { 6374 + "countUserLove": {
5616 "type": "integer", 6375 "type": "integer",
5617 "format": "int32", 6376 "format": "int32",
5618 - "description": " 评论的展示状态(0显示、1不显示)" 6377 + "description": " 用户点赞数量"
5619 } 6378 }
5620 }, 6379 },
5621 "title": "SimpleComment", 6380 "title": "SimpleComment",
5622 "required": [ 6381 "required": [
5623 "id", 6382 "id",
5624 "content", 6383 "content",
5625 - "countLove",  
5626 - "countComment",  
5627 - "show" 6384 + "show",
  6385 + "atWho",
  6386 + "matchUrl",
  6387 + "countReply",
  6388 + "countUserLove"
5628 ] 6389 ]
5629 }, 6390 },
5630 "SimpleUser": { 6391 "SimpleUser": {
@@ -5744,6 +6505,17 @@ @@ -5744,6 +6505,17 @@
5744 "type": "string", 6505 "type": "string",
5745 "description": " 评论的内容" 6506 "description": " 评论的内容"
5746 }, 6507 },
  6508 + "atWho": {
  6509 + "type": "array",
  6510 + "items": {
  6511 + "$ref": "#/definitions/CommentAtWho"
  6512 + },
  6513 + "description": " 填写评论时@的人"
  6514 + },
  6515 + "matchUrl": {
  6516 + "type": "object",
  6517 + "description": " 评论内容中的url文本"
  6518 + },
5747 "show": { 6519 "show": {
5748 "type": "integer", 6520 "type": "integer",
5749 "format": "int32", 6521 "format": "int32",
@@ -5764,6 +6536,8 @@ @@ -5764,6 +6536,8 @@
5764 "countAdminLove", 6536 "countAdminLove",
5765 "createdAt", 6537 "createdAt",
5766 "content", 6538 "content",
  6539 + "atWho",
  6540 + "matchUrl",
5767 "show" 6541 "show"
5768 ] 6542 ]
5769 }, 6543 },
@@ -5843,7 +6617,8 @@ @@ -5843,7 +6617,8 @@
5843 "description": " 文章顶层ID" 6617 "description": " 文章顶层ID"
5844 }, 6618 },
5845 "author": { 6619 "author": {
5846 - "type": "string", 6620 + "type": "integer",
  6621 + "format": "int64",
5847 "description": " 用户" 6622 "description": " 用户"
5848 }, 6623 },
5849 "show": { 6624 "show": {
@@ -5943,6 +6718,12 @@ @@ -5943,6 +6718,12 @@
5943 }, 6718 },
5944 "description": " 图片" 6719 "description": " 图片"
5945 }, 6720 },
  6721 + "video": {
  6722 + "type": "array",
  6723 + "items": {
  6724 + "$ref": "#/definitions/Video"
  6725 + }
  6726 + },
5946 "whoRead": { 6727 "whoRead": {
5947 "type": "array", 6728 "type": "array",
5948 "items": { 6729 "items": {
@@ -5999,6 +6780,7 @@ @@ -5999,6 +6780,7 @@
5999 "createdAt", 6780 "createdAt",
6000 "section", 6781 "section",
6001 "images", 6782 "images",
  6783 + "video",
6002 "whoRead", 6784 "whoRead",
6003 "whoReadInfo", 6785 "whoReadInfo",
6004 "whoReview", 6786 "whoReview",
@@ -6066,6 +6848,13 @@ @@ -6066,6 +6848,13 @@
6066 }, 6848 },
6067 "description": " 图片" 6849 "description": " 图片"
6068 }, 6850 },
  6851 + "videos": {
  6852 + "type": "array",
  6853 + "items": {
  6854 + "$ref": "#/definitions/Video"
  6855 + },
  6856 + "description": " 视频"
  6857 + },
6069 "whoRead": { 6858 "whoRead": {
6070 "type": "array", 6859 "type": "array",
6071 "items": { 6860 "items": {
@@ -6142,6 +6931,7 @@ @@ -6142,6 +6931,7 @@
6142 "createdAt", 6931 "createdAt",
6143 "section", 6932 "section",
6144 "images", 6933 "images",
  6934 + "videos",
6145 "whoRead", 6935 "whoRead",
6146 "whoReadInfo", 6936 "whoReadInfo",
6147 "whoReview", 6937 "whoReview",
@@ -6296,6 +7086,11 @@ @@ -6296,6 +7086,11 @@
6296 "type": "string", 7086 "type": "string",
6297 "description": "标题" 7087 "description": "标题"
6298 }, 7088 },
  7089 + "authorId": {
  7090 + "type": "integer",
  7091 + "format": "int64",
  7092 + "description": "发布人ID"
  7093 + },
6299 "author": { 7094 "author": {
6300 "type": "string", 7095 "type": "string",
6301 "description": "发布人" 7096 "description": "发布人"
@@ -6317,7 +7112,7 @@ @@ -6317,7 +7112,7 @@
6317 "format": "int32", 7112 "format": "int32",
6318 "description": "点赞数量" 7113 "description": "点赞数量"
6319 }, 7114 },
6320 - "CountComment": { 7115 + "countComment": {
6321 "type": "integer", 7116 "type": "integer",
6322 "format": "int32", 7117 "format": "int32",
6323 "description": "评论数量" 7118 "description": "评论数量"
@@ -6344,11 +7139,12 @@ @@ -6344,11 +7139,12 @@
6344 "required": [ 7139 "required": [
6345 "id", 7140 "id",
6346 "title", 7141 "title",
  7142 + "authorId",
6347 "author", 7143 "author",
6348 "images", 7144 "images",
6349 "createdAt", 7145 "createdAt",
6350 "countLove", 7146 "countLove",
6351 - "CountComment", 7147 + "countComment",
6352 "show", 7148 "show",
6353 "tags", 7149 "tags",
6354 "targetUser" 7150 "targetUser"
@@ -6420,7 +7216,8 @@ @@ -6420,7 +7216,8 @@
6420 "description": "标题" 7216 "description": "标题"
6421 }, 7217 },
6422 "author": { 7218 "author": {
6423 - "type": "string", 7219 + "type": "integer",
  7220 + "format": "int64",
6424 "description": "发布人" 7221 "description": "发布人"
6425 }, 7222 },
6426 "beginTime": { 7223 "beginTime": {
@@ -6512,6 +7309,13 @@ @@ -6512,6 +7309,13 @@
6512 }, 7309 },
6513 "description": " 图片" 7310 "description": " 图片"
6514 }, 7311 },
  7312 + "video": {
  7313 + "type": "array",
  7314 + "items": {
  7315 + "$ref": "#/definitions/Video"
  7316 + },
  7317 + "description": " 视频"
  7318 + },
6515 "whoRead": { 7319 "whoRead": {
6516 "type": "array", 7320 "type": "array",
6517 "items": { 7321 "items": {
@@ -6553,6 +7357,7 @@ @@ -6553,6 +7357,7 @@
6553 "section", 7357 "section",
6554 "title", 7358 "title",
6555 "images", 7359 "images",
  7360 + "video",
6556 "whoRead", 7361 "whoRead",
6557 "whoReview", 7362 "whoReview",
6558 "targetUser", 7363 "targetUser",
@@ -6593,6 +7398,13 @@ @@ -6593,6 +7398,13 @@
6593 "format": "int32", 7398 "format": "int32",
6594 "description": "点赞数量" 7399 "description": "点赞数量"
6595 }, 7400 },
  7401 + "video": {
  7402 + "type": "array",
  7403 + "items": {
  7404 + "$ref": "#/definitions/Video"
  7405 + },
  7406 + "description": " 视频"
  7407 + },
6596 "countComment": { 7408 "countComment": {
6597 "type": "integer", 7409 "type": "integer",
6598 "format": "int32", 7410 "format": "int32",
@@ -6625,6 +7437,7 @@ @@ -6625,6 +7437,7 @@
6625 "images", 7437 "images",
6626 "createdAt", 7438 "createdAt",
6627 "countLove", 7439 "countLove",
  7440 + "video",
6628 "countComment", 7441 "countComment",
6629 "show", 7442 "show",
6630 "tags", 7443 "tags",
@@ -6712,6 +7525,40 @@ @@ -6712,6 +7525,40 @@
6712 "countAdminLove" 7525 "countAdminLove"
6713 ] 7526 ]
6714 }, 7527 },
  7528 + "SystemEditCommentLoveRequest": {
  7529 + "type": "object",
  7530 + "properties": {
  7531 + "": {
  7532 + "type": "integer",
  7533 + "format": "int64"
  7534 + },
  7535 + "paramList": {
  7536 + "type": "array",
  7537 + "items": {
  7538 + "$ref": "#/definitions/SystemEditLove"
  7539 + }
  7540 + }
  7541 + },
  7542 + "title": "SystemEditCommentLoveRequest",
  7543 + "required": [
  7544 + "paramList"
  7545 + ]
  7546 + },
  7547 + "SystemEditCommentLoveResponse": {
  7548 + "type": "object",
  7549 + "properties": {
  7550 + "paramList": {
  7551 + "type": "array",
  7552 + "items": {
  7553 + "$ref": "#/definitions/SystemEditLove"
  7554 + }
  7555 + }
  7556 + },
  7557 + "title": "SystemEditCommentLoveResponse",
  7558 + "required": [
  7559 + "paramList"
  7560 + ]
  7561 + },
6715 "SystemEditCommentRequest": { 7562 "SystemEditCommentRequest": {
6716 "type": "object", 7563 "type": "object",
6717 "properties": { 7564 "properties": {
@@ -6728,6 +7575,9 @@ @@ -6728,6 +7575,9 @@
6728 "format": "int32", 7575 "format": "int32",
6729 "description": "[1 显示评论] [2: 隐藏评论]" 7576 "description": "[1 显示评论] [2: 隐藏评论]"
6730 }, 7577 },
  7578 + "content": {
  7579 + "type": "string"
  7580 + },
6731 "countAdminLove": { 7581 "countAdminLove": {
6732 "type": "integer", 7582 "type": "integer",
6733 "format": "int32" 7583 "format": "int32"
@@ -6794,6 +7644,23 @@ @@ -6794,6 +7644,23 @@
6794 "id" 7644 "id"
6795 ] 7645 ]
6796 }, 7646 },
  7647 + "SystemEditLove": {
  7648 + "type": "object",
  7649 + "properties": {
  7650 + "id": {
  7651 + "type": "integer",
  7652 + "format": "int64"
  7653 + },
  7654 + "countAdminLove": {
  7655 + "type": "integer",
  7656 + "format": "int32"
  7657 + }
  7658 + },
  7659 + "title": "SystemEditLove",
  7660 + "required": [
  7661 + "id"
  7662 + ]
  7663 + },
6797 "SystemGetCommentRequest": { 7664 "SystemGetCommentRequest": {
6798 "type": "object", 7665 "type": "object",
6799 "properties": { 7666 "properties": {
@@ -6917,8 +7784,9 @@ @@ -6917,8 +7784,9 @@
6917 "format": "int64", 7784 "format": "int64",
6918 "description": " 评论的顶层ID" 7785 "description": " 评论的顶层ID"
6919 }, 7786 },
6920 - "fromUser": {  
6921 - "type": "string", 7787 + "fromUserId": {
  7788 + "type": "integer",
  7789 + "format": "int64",
6922 "description": " 用户" 7790 "description": " 用户"
6923 }, 7791 },
6924 "show": { 7792 "show": {
@@ -7430,6 +8298,11 @@ @@ -7430,6 +8298,11 @@
7430 }, 8298 },
7431 "other": { 8299 "other": {
7432 "type": "string" 8300 "type": "string"
  8301 + },
  8302 + "sortBy": {
  8303 + "type": "integer",
  8304 + "format": "int32",
  8305 + "description": "排序"
7433 } 8306 }
7434 }, 8307 },
7435 "title": "TagCreateRequest", 8308 "title": "TagCreateRequest",
@@ -7510,6 +8383,11 @@ @@ -7510,6 +8383,11 @@
7510 }, 8383 },
7511 "other": { 8384 "other": {
7512 "type": "string" 8385 "type": "string"
  8386 + },
  8387 + "sortBy": {
  8388 + "type": "integer",
  8389 + "format": "int32",
  8390 + "description": " 排序"
7513 } 8391 }
7514 }, 8392 },
7515 "title": "TagEditRequest", 8393 "title": "TagEditRequest",
@@ -7574,6 +8452,11 @@ @@ -7574,6 +8452,11 @@
7574 }, 8452 },
7575 "other": { 8453 "other": {
7576 "type": "string" 8454 "type": "string"
  8455 + },
  8456 + "sortBy": {
  8457 + "type": "integer",
  8458 + "format": "int32",
  8459 + "description": " 排序"
7577 } 8460 }
7578 }, 8461 },
7579 "title": "TagGetResponse", 8462 "title": "TagGetResponse",
@@ -7611,6 +8494,11 @@ @@ -7611,6 +8494,11 @@
7611 "createdAt": { 8494 "createdAt": {
7612 "type": "integer", 8495 "type": "integer",
7613 "format": "int64" 8496 "format": "int64"
  8497 + },
  8498 + "sortBy": {
  8499 + "type": "integer",
  8500 + "format": "int32",
  8501 + "description": " 排序"
7614 } 8502 }
7615 }, 8503 },
7616 "title": "TagItem", 8504 "title": "TagItem",
@@ -7846,6 +8734,11 @@ @@ -7846,6 +8734,11 @@
7846 "$ref": "#/definitions/int", 8734 "$ref": "#/definitions/int",
7847 "description": " 审核状态 0:待审核 1:审核通过 2:拒绝" 8735 "description": " 审核状态 0:待审核 1:审核通过 2:拒绝"
7848 }, 8736 },
  8737 + "auditAt": {
  8738 + "type": "integer",
  8739 + "format": "int64",
  8740 + "description": " 审核时间"
  8741 + },
7849 "followers": { 8742 "followers": {
7850 "type": "array", 8743 "type": "array",
7851 "items": { 8744 "items": {
@@ -7889,6 +8782,7 @@ @@ -7889,6 +8782,7 @@
7889 "position", 8782 "position",
7890 "enable", 8783 "enable",
7891 "auditStatus", 8784 "auditStatus",
  8785 + "auditAt",
7892 "followers", 8786 "followers",
7893 "following", 8787 "following",
7894 "departments", 8788 "departments",
@@ -8027,22 +8921,58 @@ @@ -8027,22 +8921,58 @@
8027 "properties": { 8921 "properties": {
8028 "totalArticle": { 8922 "totalArticle": {
8029 "type": "integer", 8923 "type": "integer",
8030 - "format": "int32" 8924 + "format": "int32",
  8925 + "description": " 累计发布文章"
8031 }, 8926 },
8032 "totalComment": { 8927 "totalComment": {
8033 "type": "integer", 8928 "type": "integer",
8034 - "format": "int32" 8929 + "format": "int32",
  8930 + "description": " 累计发布评论"
8035 }, 8931 },
8036 "totalLoved": { 8932 "totalLoved": {
8037 "type": "integer", 8933 "type": "integer",
8038 - "format": "int32" 8934 + "format": "int32",
  8935 + "description": " 累计赞别人"
  8936 + },
  8937 + "totalBeLoved": {
  8938 + "type": "integer",
  8939 + "format": "int32",
  8940 + "description": " 累计收到的赞"
8039 } 8941 }
8040 }, 8942 },
8041 "title": "UserStatisticsResponse", 8943 "title": "UserStatisticsResponse",
8042 "required": [ 8944 "required": [
8043 "totalArticle", 8945 "totalArticle",
8044 "totalComment", 8946 "totalComment",
8045 - "totalLoved" 8947 + "totalLoved",
  8948 + "totalBeLoved"
  8949 + ]
  8950 + },
  8951 + "Video": {
  8952 + "type": "object",
  8953 + "properties": {
  8954 + "url": {
  8955 + "type": "string",
  8956 + "description": "视频文件的地址"
  8957 + },
  8958 + "cover": {
  8959 + "type": "string",
  8960 + "description": "封面"
  8961 + },
  8962 + "width": {
  8963 + "type": "integer",
  8964 + "format": "int32",
  8965 + "description": "封面图片宽"
  8966 + },
  8967 + "height": {
  8968 + "type": "integer",
  8969 + "format": "int32",
  8970 + "description": "封面图片长"
  8971 + }
  8972 + },
  8973 + "title": "Video",
  8974 + "required": [
  8975 + "url"
8046 ] 8976 ]
8047 }, 8977 },
8048 "WhichUserLikeArticle": { 8978 "WhichUserLikeArticle": {
@@ -82,6 +82,19 @@ service Core { @@ -82,6 +82,19 @@ service Core {
82 @doc "我被点赞-文章或评论列表" 82 @doc "我被点赞-文章或评论列表"
83 @handler miniMyBeLiked 83 @handler miniMyBeLiked
84 post /mini/user/mybeliked (MiniBeLikedRequest)returns (MiniBeLikedResponse) 84 post /mini/user/mybeliked (MiniBeLikedRequest)returns (MiniBeLikedResponse)
  85 +
  86 + @doc "个人主页用户信息"
  87 + @handler miniHomePageUserInfo
  88 + post /mini/homepage/user_info (MiniHomePageUserInfoRequest) returns (MiniHomePageUserInfoResponse)
  89 + @doc "个人主页-关注我的人"
  90 + @handler miniHomepageUserFollower
  91 + post /mini/homepage/user_follower (MiniHomePageUserFollowerSearchRequest)returns(MiniHomePageUserFollowerSearchResponse)
  92 + @doc "个人主页-获赞的列表"
  93 + @handler miniHomepageUserBeLiked
  94 + post /mini/homepage/user_beliked (MiniHomePageUserBeLikedRequest)returns(MiniHomePageUserBeLikedResponse)
  95 + @doc "个人主页-用户发布的信息"
  96 + @handler miniHomepageUserNews
  97 + post /mini/homepage/user_news (MiniHomepageUserNewsRequest)returns(MiniHomepageUserNewsResposne)
85 } 98 }
86 99
87 type( 100 type(
@@ -93,6 +106,56 @@ type( @@ -93,6 +106,56 @@ type(
93 } 106 }
94 ) 107 )
95 108
  109 +// 个人主页
  110 +type(
  111 + MiniHomePageUserInfoRequest {
  112 + UserId int64 `json:"userId"` // 用户ID
  113 + }
  114 + MiniHomePageUserInfoResponse {
  115 + User *UserItem `json:"user,omitempty"` // 用户信息
  116 + TotalFollower int `json:"totalFollower"` // 关注他的人数
  117 + TotalBeLoved int `json:"totalBeLoved"` // 获赞数
  118 + Followed bool `json:"followed"` // 关注
  119 + MutualFollowed bool `json:"mutualFollowed"` // 互相关注标识
  120 + }
  121 +
  122 + MiniHomePageUserFollowerSearchRequest{
  123 + UserId int `json:"userId"`
  124 + Page int `json:"page,optional"`
  125 + Size int `json:"size,optional"`
  126 + Name string `json:"name,optional"`
  127 + }
  128 + MiniHomePageUserFollowerSearchResponse{
  129 + List []*UserFollowItem `json:"users"`
  130 + Total int64 `json:"total"`
  131 + }
  132 +
  133 + MiniHomePageUserBeLikedRequest{
  134 + UserId int `json:"userId"`
  135 + Page int `json:"page"`
  136 + Size int `json:"size"`
  137 + }
  138 + MiniHomePageUserBeLikedResponse {
  139 + List []MyBeLikedItem `json:"list"`
  140 + Total int64 `json:"total"`
  141 + }
  142 +
  143 + MiniHomepageUserNewsRequest{
  144 + AuthorId int64 `json:"authorId"` // 特定作者ID
  145 + LastArticleId int64 `json:"lastArticleId,optional"`// 最后文章ID
  146 + Size int `json:"size"` // 数量
  147 + OrderByHotScore string `json:"orderByHotScore,options=asc|desc,optional,default=desc"` // 热度排序 升序 asc 降序 desc
  148 + Keywords string `json:"keywords,optional"` // 关键字
  149 + BeginTime int64 `json:"beginTime,optional"`// 开始时间
  150 + EndTime int64 `json:"endTime,optional"`// 结束时间
  151 + }
  152 + MiniHomepageUserNewsResposne{
  153 + List []UserNewsItem `json:"list"`
  154 + LastArticleId int64 `json:"lastArticleId"`// 最后文章ID
  155 + Total int64 `json:"total"`
  156 + }
  157 +)
  158 +
96 type( 159 type(
97 MiniUserLoginRequest { 160 MiniUserLoginRequest {
98 LoginType string `json:"loginType"` // 登录类型 wechat-login whchat-phone-login phone-password-login phone-smscode-login 161 LoginType string `json:"loginType"` // 登录类型 wechat-login whchat-phone-login phone-password-login phone-smscode-login
@@ -143,6 +206,7 @@ type( @@ -143,6 +206,7 @@ type(
143 MiniUsersListRequest{ 206 MiniUsersListRequest{
144 ArticleId int64 `json:"articleId,optional"` // 按文章ID(返回文章可见的用户) 207 ArticleId int64 `json:"articleId,optional"` // 按文章ID(返回文章可见的用户)
145 RoleId int64 `json:"roleId,optional"` // 按角色角色关联的用户 208 RoleId int64 `json:"roleId,optional"` // 按角色角色关联的用户
  209 + Keywords string `json:"keywords,optional"` // 按关键字搜索(名称)
146 } 210 }
147 MiniUserNewsRequest{ 211 MiniUserNewsRequest{
148 AuthorId int64 `json:"authorId,optional"` // 特定作者ID 212 AuthorId int64 `json:"authorId,optional"` // 特定作者ID
@@ -319,6 +319,26 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { @@ -319,6 +319,26 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
319 Path: "/mini/user/mybeliked", 319 Path: "/mini/user/mybeliked",
320 Handler: user.MiniMyBeLikedHandler(serverCtx), 320 Handler: user.MiniMyBeLikedHandler(serverCtx),
321 }, 321 },
  322 + {
  323 + Method: http.MethodPost,
  324 + Path: "/mini/homepage/user_info",
  325 + Handler: user.MiniHomePageUserInfoHandler(serverCtx),
  326 + },
  327 + {
  328 + Method: http.MethodPost,
  329 + Path: "/mini/homepage/user_follower",
  330 + Handler: user.MiniHomepageUserFollowerHandler(serverCtx),
  331 + },
  332 + {
  333 + Method: http.MethodPost,
  334 + Path: "/mini/homepage/user_beliked",
  335 + Handler: user.MiniHomepageUserBeLikedHandler(serverCtx),
  336 + },
  337 + {
  338 + Method: http.MethodPost,
  339 + Path: "/mini/homepage/user_news",
  340 + Handler: user.MiniHomepageUserNewsHandler(serverCtx),
  341 + },
322 }..., 342 }...,
323 ), 343 ),
324 rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), 344 rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret),
1 package user 1 package user
2 2
3 import ( 3 import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
4 "net/http" 5 "net/http"
5 6
6 "github.com/zeromicro/go-zero/rest/httpx" 7 "github.com/zeromicro/go-zero/rest/httpx"
@@ -19,10 +20,6 @@ func MiniEditUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { @@ -19,10 +20,6 @@ func MiniEditUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
19 20
20 l := user.NewMiniEditUserInfoLogic(r.Context(), svcCtx) 21 l := user.NewMiniEditUserInfoLogic(r.Context(), svcCtx)
21 resp, err := l.MiniEditUserInfo(&req) 22 resp, err := l.MiniEditUserInfo(&req)
22 - if err != nil {  
23 - httpx.ErrorCtx(r.Context(), w, err)  
24 - } else {  
25 - httpx.OkJsonCtx(r.Context(), w, resp)  
26 - } 23 + result.HttpResult(r, w, resp, err)
27 } 24 }
28 } 25 }
  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 MiniHomePageUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  14 + return func(w http.ResponseWriter, r *http.Request) {
  15 + var req types.MiniHomePageUserInfoRequest
  16 + if err := httpx.Parse(r, &req); err != nil {
  17 + httpx.ErrorCtx(r.Context(), w, err)
  18 + return
  19 + }
  20 +
  21 + l := user.NewMiniHomePageUserInfoLogic(r.Context(), svcCtx)
  22 + resp, err := l.MiniHomePageUserInfo(&req)
  23 + result.HttpResult(r, w, resp, err)
  24 + }
  25 +}
  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 MiniHomepageUserBeLikedHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  14 + return func(w http.ResponseWriter, r *http.Request) {
  15 + var req types.MiniHomePageUserBeLikedRequest
  16 + if err := httpx.Parse(r, &req); err != nil {
  17 + httpx.ErrorCtx(r.Context(), w, err)
  18 + return
  19 + }
  20 +
  21 + l := user.NewMiniHomepageUserBeLikedLogic(r.Context(), svcCtx)
  22 + resp, err := l.MiniHomepageUserBeLiked(&req)
  23 + result.HttpResult(r, w, resp, err)
  24 + }
  25 +}
  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 MiniHomepageUserFollowerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  14 + return func(w http.ResponseWriter, r *http.Request) {
  15 + var req types.MiniHomePageUserFollowerSearchRequest
  16 + if err := httpx.Parse(r, &req); err != nil {
  17 + httpx.ErrorCtx(r.Context(), w, err)
  18 + return
  19 + }
  20 +
  21 + l := user.NewMiniHomepageUserFollowerLogic(r.Context(), svcCtx)
  22 + resp, err := l.MiniHomepageUserFollower(&req)
  23 + result.HttpResult(r, w, resp, err)
  24 + }
  25 +}
  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 MiniHomepageUserNewsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  14 + return func(w http.ResponseWriter, r *http.Request) {
  15 + var req types.MiniHomepageUserNewsRequest
  16 + if err := httpx.Parse(r, &req); err != nil {
  17 + httpx.ErrorCtx(r.Context(), w, err)
  18 + return
  19 + }
  20 +
  21 + l := user.NewMiniHomepageUserNewsLogic(r.Context(), svcCtx)
  22 + resp, err := l.MiniHomepageUserNews(&req)
  23 + result.HttpResult(r, w, resp, err)
  24 + }
  25 +}
  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 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr"
  9 +
  10 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
  11 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  12 +
  13 + "github.com/zeromicro/go-zero/core/logx"
  14 +)
  15 +
  16 +type MiniHomePageUserInfoLogic struct {
  17 + logx.Logger
  18 + ctx context.Context
  19 + svcCtx *svc.ServiceContext
  20 +}
  21 +
  22 +func NewMiniHomePageUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniHomePageUserInfoLogic {
  23 + return &MiniHomePageUserInfoLogic{
  24 + Logger: logx.WithContext(ctx),
  25 + ctx: ctx,
  26 + svcCtx: svcCtx,
  27 + }
  28 +}
  29 +
  30 +func (l *MiniHomePageUserInfoLogic) MiniHomePageUserInfo(req *types.MiniHomePageUserInfoRequest) (resp *types.MiniHomePageUserInfoResponse, err error) {
  31 + var (
  32 + userToken = contextdata.GetUserTokenFromCtx(l.ctx)
  33 + user *domain.User
  34 + conn = l.svcCtx.DefaultDBConn()
  35 + companyMap = make(map[int64]*domain.Company)
  36 + currentUser *domain.User
  37 + )
  38 + if user, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, req.UserId); err != nil {
  39 + return nil, xerr.NewErrMsgErr("用户不存在", err)
  40 + }
  41 + if currentUser, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, userToken.UserId); err != nil {
  42 + return nil, xerr.NewErrMsgErr("用户不存在", err)
  43 + }
  44 + if user.CompanyId != currentUser.CompanyId {
  45 + return nil, xerr.NewErrMsgErr("无查看权限", err)
  46 + }
  47 + resp = &types.MiniHomePageUserInfoResponse{
  48 + User: &types.UserItem{
  49 + Id: user.Id,
  50 + Name: user.Name,
  51 + Avatar: lo.ToPtr(user.Avatar),
  52 + Position: user.Position,
  53 + AuditStatus: lo.ToPtr(user.AuditStatus),
  54 + Enable: user.Enable,
  55 + },
  56 + TotalFollower: len(user.Follower),
  57 + Followed: lo.Contains(currentUser.Following, user.Id),
  58 + MutualFollowed: lo.Contains(user.Following, currentUser.Id),
  59 + }
  60 + if company, _ := domain.LazyLoad(companyMap, l.ctx, conn, user.CompanyId, l.svcCtx.CompanyRepository.FindOne); company != nil {
  61 + resp.User.CompanyName = company.Name
  62 + resp.User.CompanyCode = company.Code
  63 + resp.User.CompanyLogo = lo.ToPtr(company.Logo)
  64 + }
  65 +
  66 + var total int64
  67 + total, _, _ = l.svcCtx.UserLoveFlagRepository.Find(l.ctx, conn, domain.IndexCompanyId(0)().WithCountOnly().MustWithKV("toUserId", user.Id))
  68 + resp.TotalBeLoved = int(total)
  69 +
  70 + return
  71 +}
  1 +package user
  2 +
  3 +import (
  4 + "context"
  5 + "github.com/samber/lo"
  6 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
  7 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  8 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
  9 +
  10 + "github.com/zeromicro/go-zero/core/logx"
  11 +)
  12 +
  13 +type MiniHomepageUserBeLikedLogic struct {
  14 + logx.Logger
  15 + ctx context.Context
  16 + svcCtx *svc.ServiceContext
  17 +}
  18 +
  19 +func NewMiniHomepageUserBeLikedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniHomepageUserBeLikedLogic {
  20 + return &MiniHomepageUserBeLikedLogic{
  21 + Logger: logx.WithContext(ctx),
  22 + ctx: ctx,
  23 + svcCtx: svcCtx,
  24 + }
  25 +}
  26 +
  27 +func (l *MiniHomepageUserBeLikedLogic) MiniHomepageUserBeLiked(req *types.MiniHomePageUserBeLikedRequest) (resp *types.MiniHomePageUserBeLikedResponse, err error) {
  28 + var conn = l.svcCtx.DefaultDBConn()
  29 +
  30 + total, list, err := l.svcCtx.UserLoveFlagRepository.Find(l.ctx, conn, domain.NewQueryOptions().
  31 + WithOffsetLimit(req.Page, req.Size).
  32 + //WithKV("companyId", userToken.CompanyId). 不存在字段
  33 + WithKV("toUserId", req.UserId))
  34 + if err != nil {
  35 + return nil, err
  36 + }
  37 +
  38 + resp = &types.MiniHomePageUserBeLikedResponse{}
  39 + resp.Total = total
  40 + resp.List = make([]types.MyBeLikedItem, 0)
  41 + if total == 0 || len(list) == 0 {
  42 + return resp, nil
  43 + }
  44 +
  45 + var companyMap = make(map[int64]*domain.Company)
  46 + var userMap = make(map[int64]*domain.User)
  47 + var articleMap = make(map[int64]*domain.Article)
  48 + var commentMap = make(map[int64]*domain.ArticleComment)
  49 +
  50 + lo.ForEach(list, func(item *domain.UserLoveFlag, index int) {
  51 + var (
  52 + company *domain.Company
  53 + user *domain.User
  54 + article *domain.Article
  55 + comment *domain.ArticleComment
  56 + )
  57 + user, _ = domain.LazyLoad(userMap, l.ctx, conn, item.UserId, l.svcCtx.UserRepository.FindOne)
  58 + if user != nil {
  59 + company, _ = domain.LazyLoad(companyMap, l.ctx, conn, user.CompanyId, l.svcCtx.CompanyRepository.FindOne)
  60 + }
  61 + article, _ = domain.LazyLoad(articleMap, l.ctx, conn, item.ArticleId, l.svcCtx.ArticleRepository.FindOne)
  62 + // 点赞评论
  63 + if item.CommentId != 0 {
  64 + comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne)
  65 + }
  66 + itemBeLiked := NewItemSimple(item, company, user, article, comment)
  67 + // 无权限的隐藏
  68 + resp.List = append(resp.List, itemBeLiked)
  69 + })
  70 +
  71 + return resp, nil
  72 +}
  1 +package user
  2 +
  3 +import (
  4 + "context"
  5 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
  6 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata"
  7 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr"
  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 MiniHomepageUserFollowerLogic struct {
  16 + logx.Logger
  17 + ctx context.Context
  18 + svcCtx *svc.ServiceContext
  19 +}
  20 +
  21 +func NewMiniHomepageUserFollowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniHomepageUserFollowerLogic {
  22 + return &MiniHomepageUserFollowerLogic{
  23 + Logger: logx.WithContext(ctx),
  24 + ctx: ctx,
  25 + svcCtx: svcCtx,
  26 + }
  27 +}
  28 +
  29 +func (l *MiniHomepageUserFollowerLogic) MiniHomepageUserFollower(req *types.MiniHomePageUserFollowerSearchRequest) (resp *types.MiniHomePageUserFollowerSearchResponse, err error) {
  30 + var (
  31 + userToken = contextdata.GetUserTokenFromCtx(l.ctx)
  32 + user *domain.User
  33 + conn = l.svcCtx.DefaultDBConn()
  34 + currentUser *domain.User
  35 + )
  36 + if user, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, int64(req.UserId)); err != nil {
  37 + return nil, xerr.NewErrMsgErr("用户不存在", err)
  38 + }
  39 + if currentUser, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, userToken.UserId); err != nil {
  40 + return nil, xerr.NewErrMsgErr("用户不存在", err)
  41 + }
  42 + if user.CompanyId != currentUser.CompanyId {
  43 + return nil, xerr.NewErrMsgErr("无查看权限", err)
  44 + }
  45 + resp = &types.MiniHomePageUserFollowerSearchResponse{}
  46 + resp.Total, resp.List = follower(l.ctx, l.svcCtx, user, req.Page, req.Size, req.Name)
  47 + return
  48 +}
  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 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr"
  9 +
  10 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
  11 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  12 +
  13 + "github.com/zeromicro/go-zero/core/logx"
  14 +)
  15 +
  16 +type MiniHomepageUserNewsLogic struct {
  17 + logx.Logger
  18 + ctx context.Context
  19 + svcCtx *svc.ServiceContext
  20 +}
  21 +
  22 +func NewMiniHomepageUserNewsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniHomepageUserNewsLogic {
  23 + return &MiniHomepageUserNewsLogic{
  24 + Logger: logx.WithContext(ctx),
  25 + ctx: ctx,
  26 + svcCtx: svcCtx,
  27 + }
  28 +}
  29 +
  30 +func (l *MiniHomepageUserNewsLogic) MiniHomepageUserNews(req *types.MiniHomepageUserNewsRequest) (resp *types.MiniHomepageUserNewsResposne, err error) {
  31 + var (
  32 + userToken = contextdata.GetUserTokenFromCtx(l.ctx)
  33 + user *domain.User
  34 + conn = l.svcCtx.DefaultDBConn()
  35 + currentUser *domain.User
  36 + articles []*domain.Article
  37 + readArticles = make([]*domain.UserReadArticle, 0)
  38 + userMap = make(map[int64]*domain.User)
  39 + )
  40 + if user, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, req.AuthorId); err != nil {
  41 + return nil, xerr.NewErrMsgErr("用户不存在", err)
  42 + }
  43 + if currentUser, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, userToken.UserId); err != nil {
  44 + return nil, xerr.NewErrMsgErr("用户不存在", err)
  45 + }
  46 + if user.CompanyId != currentUser.CompanyId {
  47 + return nil, xerr.NewErrMsgErr("无查看权限", err)
  48 + }
  49 +
  50 + queryOptions := domain.IndexCompanyId(userToken.CompanyId)().
  51 + WithKV("beginTime", req.BeginTime).
  52 + WithKV("endTime", req.EndTime).
  53 + WithKV("keywords", req.Keywords).
  54 + WithKV("orderByHotScore", req.OrderByHotScore)
  55 +
  56 + var users = []int64{req.AuthorId}
  57 + if _, articles, err = l.svcCtx.ArticleRepository.FindAuthorsLatestArticle(l.ctx, conn, user.CompanyId, users, currentUser.Id, req.LastArticleId, req.Size, queryOptions.Copy().WithFindOnly()); err != nil {
  58 + return nil, xerr.NewErrMsgErr("获取快讯异常", err)
  59 + }
  60 + var total int64
  61 + if total, _, err = l.svcCtx.ArticleRepository.FindAuthorsLatestArticle(l.ctx, conn, user.CompanyId, users, currentUser.Id, 0, 1, queryOptions.Copy().WithCountOnly()); err != nil {
  62 + return nil, xerr.NewErrMsgErr("获取快讯异常", err)
  63 + }
  64 + resp = &types.MiniHomepageUserNewsResposne{
  65 + List: make([]types.UserNewsItem, 0),
  66 + Total: total,
  67 + }
  68 + articleIds := domain.Values(articles, func(item *domain.Article) int64 {
  69 + return item.Id
  70 + })
  71 + if len(articleIds) > 0 {
  72 + resp.LastArticleId = articleIds[len(articleIds)-1]
  73 + _, readArticles, _ = l.svcCtx.UserReadArticleRepository.Find(l.ctx, conn, domain.IndexCompanyId(userToken.CompanyId)().WithFindOnly().WithKV("articleIds", articleIds))
  74 + }
  75 + readArticlesMap := lo.KeyBy(readArticles, func(item *domain.UserReadArticle) int64 {
  76 + return item.ArticleId
  77 + })
  78 + lo.ForEach(articles, func(item *domain.Article, index int) {
  79 + newsItem := types.UserNewsItem{
  80 + NewsId: item.Id,
  81 + Type: "article",
  82 + Title: item.Title,
  83 + Summary: item.Summary,
  84 + Time: item.CreatedAt,
  85 + Images: make([]string, 0),
  86 + ReadFlag: false,
  87 + }
  88 + if author, _ := domain.LazyLoad(userMap, l.ctx, conn, item.AuthorId, l.svcCtx.UserRepository.FindOne); author != nil {
  89 + newsItem.Author = types.UserItem{
  90 + Id: author.Id,
  91 + Name: author.Name,
  92 + Avatar: lo.ToPtr(author.Avatar),
  93 + }
  94 + }
  95 + for _, img := range item.Images {
  96 + newsItem.Images = append(newsItem.Images, img.Url)
  97 + }
  98 + if _, ok := readArticlesMap[item.Id]; ok {
  99 + newsItem.ReadFlag = true
  100 + }
  101 + resp.List = append(resp.List, newsItem)
  102 + })
  103 + return
  104 +}
@@ -67,13 +67,13 @@ func (l *MiniMyBeLikedLogic) MiniMyBeLiked(req *types.MiniBeLikedRequest) (resp @@ -67,13 +67,13 @@ func (l *MiniMyBeLikedLogic) MiniMyBeLiked(req *types.MiniBeLikedRequest) (resp
67 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne) 67 comment, _ = domain.LazyLoad(commentMap, l.ctx, conn, item.CommentId, l.svcCtx.ArticleCommentRepository.FindOne)
68 } 68 }
69 69
70 - resp.List = append(resp.List, l.NewItemSimple(item, company, user, article, comment)) 70 + resp.List = append(resp.List, NewItemSimple(item, company, user, article, comment))
71 }) 71 })
72 72
73 return resp, nil 73 return resp, nil
74 } 74 }
75 75
76 -func (l *MiniMyBeLikedLogic) NewItemSimple(love *domain.UserLoveFlag, company *domain.Company, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyBeLikedItem { 76 +func NewItemSimple(love *domain.UserLoveFlag, company *domain.Company, user *domain.User, article *domain.Article, comment *domain.ArticleComment) types.MyBeLikedItem {
77 item := types.MyBeLikedItem{ 77 item := types.MyBeLikedItem{
78 UserId: love.UserId, 78 UserId: love.UserId,
79 ArticleId: love.ArticleId, 79 ArticleId: love.ArticleId,
@@ -30,39 +30,46 @@ func NewMiniUserFollowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) * @@ -30,39 +30,46 @@ func NewMiniUserFollowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
30 30
31 func (l *MiniUserFollowerLogic) MiniUserFollower(req *types.MiniUserFollowedSearchRequest) (resp *types.MiniUserFollowedSearchResponse, err error) { 31 func (l *MiniUserFollowerLogic) MiniUserFollower(req *types.MiniUserFollowedSearchRequest) (resp *types.MiniUserFollowedSearchResponse, err error) {
32 var ( 32 var (
33 - conn = l.svcCtx.DefaultDBConn()  
34 - user *domain.User  
35 - userToken = contextdata.GetUserTokenFromCtx(l.ctx)  
36 - companyMap = make(map[int64]*domain.Company) 33 + conn = l.svcCtx.DefaultDBConn()
  34 + user *domain.User
  35 + userToken = contextdata.GetUserTokenFromCtx(l.ctx)
37 ) 36 )
38 if user, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, userToken.UserId); err != nil { 37 if user, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, userToken.UserId); err != nil {
39 return nil, xerr.NewErrMsgErr("用户不存在", err) 38 return nil, xerr.NewErrMsgErr("用户不存在", err)
40 } 39 }
  40 + resp = &types.MiniUserFollowedSearchResponse{
  41 + Total: 0,
  42 + List: make([]*types.UserFollowItem, 0),
  43 + }
  44 + resp.Total, resp.List = follower(l.ctx, l.svcCtx, user, req.Page, req.Size, req.Name)
  45 + return
  46 +}
  47 +
  48 +func follower(ctx context.Context, svcCtx *svc.ServiceContext, user *domain.User, page, size int, name string) (total int64, list []*types.UserFollowItem) {
41 var ( 49 var (
42 users = user.Follower 50 users = user.Follower
43 - total = int64(len(users))  
44 - offset, limit = domain.OffsetLimit(req.Page, req.Size) 51 + offset, limit = domain.OffsetLimit(page, size)
  52 + conn = svcCtx.DefaultDBConn()
  53 + companyMap = make(map[int64]*domain.Company)
45 ) 54 )
  55 + total = int64(len(users))
46 users = lo.Slice(users, offset, offset+limit) 56 users = lo.Slice(users, offset, offset+limit)
47 - resp = &types.MiniUserFollowedSearchResponse{  
48 - Total: total,  
49 - List: make([]*types.UserFollowItem, 0),  
50 - } 57 + list = make([]*types.UserFollowItem, 0)
51 for { 58 for {
52 if offset > len(user.Follower) { 59 if offset > len(user.Follower) {
53 break 60 break
54 } 61 }
55 users = lo.Slice(users, offset, offset+limit) 62 users = lo.Slice(users, offset, offset+limit)
56 lo.ForEach(users, func(item int64, index int) { 63 lo.ForEach(users, func(item int64, index int) {
57 - if foundUser, _ := l.svcCtx.UserRepository.FindOne(l.ctx, conn, item); foundUser != nil {  
58 - if len(req.Name) > 0 && !strings.Contains(foundUser.Name, req.Name) { 64 + if foundUser, _ := svcCtx.UserRepository.FindOne(ctx, conn, item); foundUser != nil {
  65 + if len(name) > 0 && !strings.Contains(foundUser.Name, name) {
59 return 66 return
60 } 67 }
61 var companyName = "" 68 var companyName = ""
62 - if company, _ := domain.LazyLoad(companyMap, l.ctx, conn, foundUser.CompanyId, l.svcCtx.CompanyRepository.FindOne); company != nil { 69 + if company, _ := domain.LazyLoad(companyMap, ctx, conn, foundUser.CompanyId, svcCtx.CompanyRepository.FindOne); company != nil {
63 companyName = company.Name 70 companyName = company.Name
64 } 71 }
65 - resp.List = append(resp.List, &types.UserFollowItem{ 72 + list = append(list, &types.UserFollowItem{
66 Id: foundUser.Id, 73 Id: foundUser.Id,
67 Name: foundUser.Name, 74 Name: foundUser.Name,
68 CompanyName: companyName, 75 CompanyName: companyName,
@@ -73,12 +80,11 @@ func (l *MiniUserFollowerLogic) MiniUserFollower(req *types.MiniUserFollowedSear @@ -73,12 +80,11 @@ func (l *MiniUserFollowerLogic) MiniUserFollower(req *types.MiniUserFollowedSear
73 }) 80 })
74 } 81 }
75 }) 82 })
76 - if len(resp.List) >= limit { 83 + if len(list) >= limit {
77 break 84 break
78 } 85 }
79 - req.Page += 1  
80 - offset, limit = domain.OffsetLimit(req.Page, req.Size) 86 + page += 1
  87 + offset, limit = domain.OffsetLimit(page, size)
81 } 88 }
82 -  
83 return 89 return
84 } 90 }
@@ -45,7 +45,7 @@ func (l *MiniUserMyFollowingNewsLogic) MiniUserMyFollowingNews(req *types.MiniUs @@ -45,7 +45,7 @@ func (l *MiniUserMyFollowingNewsLogic) MiniUserMyFollowingNews(req *types.MiniUs
45 if req.AuthorId > 0 { 45 if req.AuthorId > 0 {
46 users = []int64{req.AuthorId} 46 users = []int64{req.AuthorId}
47 } 47 }
48 - if _, articles, err = l.svcCtx.ArticleRepository.FindAuthorsLatestArticle(l.ctx, conn, user.CompanyId, users, user.Id, req.LastArticleId, req.Size); err != nil { 48 + if _, articles, err = l.svcCtx.ArticleRepository.FindAuthorsLatestArticle(l.ctx, conn, user.CompanyId, users, user.Id, req.LastArticleId, req.Size, domain.NewQueryOptions().WithFindOnly()); err != nil {
49 return nil, xerr.NewErrMsgErr("获取快讯异常", err) 49 return nil, xerr.NewErrMsgErr("获取快讯异常", err)
50 } 50 }
51 resp = &types.MiniUserNewsResposne{ 51 resp = &types.MiniUserNewsResposne{
@@ -43,7 +43,7 @@ func (l *MiniAtUsersListLogic) MiniAtUsersList(req *types.MiniUsersListRequest) @@ -43,7 +43,7 @@ func (l *MiniAtUsersListLogic) MiniAtUsersList(req *types.MiniUsersListRequest)
43 onlyUsers = article.WhoRead 43 onlyUsers = article.WhoRead
44 } 44 }
45 } 45 }
46 - if _, users, err = l.svcCtx.UserRepository.FindDepartmentUsers(l.ctx, conn, userToken.CompanyId, domain.NewQueryOptions().WithFindOnly()); err != nil { 46 + if _, users, err = l.svcCtx.UserRepository.FindDepartmentUsers(l.ctx, conn, userToken.CompanyId, domain.NewQueryOptions().WithKV("name", req.Keywords).WithFindOnly()); err != nil {
47 return nil, xerr.NewErrMsgErr("用户列表获取失败", err) 47 return nil, xerr.NewErrMsgErr("用户列表获取失败", err)
48 } 48 }
49 if len(onlyUsers) > 0 { 49 if len(onlyUsers) > 0 {
@@ -63,6 +63,7 @@ func (l *MiniAtUsersListLogic) MiniAtUsersList(req *types.MiniUsersListRequest) @@ -63,6 +63,7 @@ func (l *MiniAtUsersListLogic) MiniAtUsersList(req *types.MiniUsersListRequest)
63 Id: item.Id, 63 Id: item.Id,
64 Name: item.Name, 64 Name: item.Name,
65 PinYinName: item.PinYinName, 65 PinYinName: item.PinYinName,
  66 + Avatar: item.Avatar,
66 }) 67 })
67 }) 68 })
68 return map[string]interface{}{ 69 return map[string]interface{}{
@@ -449,6 +449,57 @@ type MiniEditUserInfoRequest struct { @@ -449,6 +449,57 @@ type MiniEditUserInfoRequest struct {
449 type MiniEditUserInfoResponse struct { 449 type MiniEditUserInfoResponse struct {
450 } 450 }
451 451
  452 +type MiniHomePageUserInfoRequest struct {
  453 + UserId int64 `json:"userId"` // 用户ID
  454 +}
  455 +
  456 +type MiniHomePageUserInfoResponse struct {
  457 + User *UserItem `json:"user,omitempty"` // 用户信息
  458 + TotalFollower int `json:"totalFollower"` // 关注他的人数
  459 + TotalBeLoved int `json:"totalBeLoved"` // 获赞数
  460 + Followed bool `json:"followed"` // 关注
  461 + MutualFollowed bool `json:"mutualFollowed"` // 互相关注标识
  462 +}
  463 +
  464 +type MiniHomePageUserFollowerSearchRequest struct {
  465 + UserId int `json:"userId"`
  466 + Page int `json:"page,optional"`
  467 + Size int `json:"size,optional"`
  468 + Name string `json:"name,optional"`
  469 +}
  470 +
  471 +type MiniHomePageUserFollowerSearchResponse struct {
  472 + List []*UserFollowItem `json:"users"`
  473 + Total int64 `json:"total"`
  474 +}
  475 +
  476 +type MiniHomePageUserBeLikedRequest struct {
  477 + UserId int `json:"userId"`
  478 + Page int `json:"page"`
  479 + Size int `json:"size"`
  480 +}
  481 +
  482 +type MiniHomePageUserBeLikedResponse struct {
  483 + List []MyBeLikedItem `json:"list"`
  484 + Total int64 `json:"total"`
  485 +}
  486 +
  487 +type MiniHomepageUserNewsRequest struct {
  488 + AuthorId int64 `json:"authorId"` // 特定作者ID
  489 + LastArticleId int64 `json:"lastArticleId,optional"` // 最后文章ID
  490 + Size int `json:"size"` // 数量
  491 + OrderByHotScore string `json:"orderByHotScore,options=asc|desc,optional,default=desc"` // 热度排序 升序 asc 降序 desc
  492 + Keywords string `json:"keywords,optional"` // 关键字
  493 + BeginTime int64 `json:"beginTime,optional"` // 开始时间
  494 + EndTime int64 `json:"endTime,optional"` // 结束时间
  495 +}
  496 +
  497 +type MiniHomepageUserNewsResposne struct {
  498 + List []UserNewsItem `json:"list"`
  499 + LastArticleId int64 `json:"lastArticleId"` // 最后文章ID
  500 + Total int64 `json:"total"`
  501 +}
  502 +
452 type MiniUserLoginRequest struct { 503 type MiniUserLoginRequest struct {
453 LoginType string `json:"loginType"` // 登录类型 wechat-login whchat-phone-login phone-password-login phone-smscode-login 504 LoginType string `json:"loginType"` // 登录类型 wechat-login whchat-phone-login phone-password-login phone-smscode-login
454 WechatAuthCode string `json:"wechatAuthcode,optional"` // 微信登录 授权码 505 WechatAuthCode string `json:"wechatAuthcode,optional"` // 微信登录 授权码
@@ -503,8 +554,9 @@ type MiniUserDepartmentUsersResponse struct { @@ -503,8 +554,9 @@ type MiniUserDepartmentUsersResponse struct {
503 } 554 }
504 555
505 type MiniUsersListRequest struct { 556 type MiniUsersListRequest struct {
506 - ArticleId int64 `json:"articleId,optional"` // 按文章ID(返回文章可见的用户)  
507 - RoleId int64 `json:"roleId,optional"` // 按角色角色关联的用户 557 + ArticleId int64 `json:"articleId,optional"` // 按文章ID(返回文章可见的用户)
  558 + RoleId int64 `json:"roleId,optional"` // 按角色角色关联的用户
  559 + Keywords string `json:"keywords,optional"` // 按关键字搜索(名称)
508 } 560 }
509 561
510 type MiniUserNewsRequest struct { 562 type MiniUserNewsRequest struct {
@@ -207,7 +207,7 @@ func (repository *ArticleRepository) FindLatestAccessibleArticle(ctx context.Con @@ -207,7 +207,7 @@ func (repository *ArticleRepository) FindLatestAccessibleArticle(ctx context.Con
207 207
208 // FindAuthorsLatestArticle 作者最新的文章 208 // FindAuthorsLatestArticle 作者最新的文章
209 func (repository *ArticleRepository) FindAuthorsLatestArticle(ctx context.Context, conn transaction.Conn, 209 func (repository *ArticleRepository) FindAuthorsLatestArticle(ctx context.Context, conn transaction.Conn,
210 - companyId int64, authors []int64, whoRead int64, lastId int64, limit int) (int64, []*domain.Article, error) { 210 + companyId int64, authors []int64, whoRead int64, lastId int64, limit int, queryOptions map[string]interface{}) (int64, []*domain.Article, error) {
211 var ( 211 var (
212 tx = conn.DB() 212 tx = conn.DB()
213 ms []*models.Article 213 ms []*models.Article
@@ -223,11 +223,24 @@ func (repository *ArticleRepository) FindAuthorsLatestArticle(ctx context.Contex @@ -223,11 +223,24 @@ func (repository *ArticleRepository) FindAuthorsLatestArticle(ctx context.Contex
223 if lastId > 0 { 223 if lastId > 0 {
224 tx.Where("id < ?", lastId) 224 tx.Where("id < ?", lastId)
225 } 225 }
226 - tx.Order("id desc") 226 + if v, ok := queryOptions["beginTime"]; ok {
  227 + tx.Where("created_at >= ?", v)
  228 + }
  229 + if v, ok := queryOptions["endTime"]; ok {
  230 + tx.Where("created_at < ?", v)
  231 + }
  232 + if v, ok := queryOptions["keywords"]; ok {
  233 + tx.Where("title like ?", fmt.Sprintf("%%%v%%", v))
  234 + }
  235 + if v, ok := queryOptions["orderByHotScore"]; ok {
  236 + tx.Order(fmt.Sprintf("(count_comment+count_love) %v", v))
  237 + } else {
  238 + tx.Order("id desc")
  239 + }
227 if limit > 0 { 240 if limit > 0 {
228 tx.Limit(limit) 241 tx.Limit(limit)
229 } 242 }
230 - if total, tx = transaction.PaginationAndCount(ctx, tx, domain.NewQueryOptions().WithFindOnly(), &ms); tx.Error != nil { 243 + if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
231 return dms, tx.Error 244 return dms, tx.Error
232 } 245 }
233 return dms, nil 246 return dms, nil
@@ -158,6 +158,45 @@ func (repository *UserLoveFlagRepository) Find(ctx context.Context, conn transac @@ -158,6 +158,45 @@ func (repository *UserLoveFlagRepository) Find(ctx context.Context, conn transac
158 return total, dms, nil 158 return total, dms, nil
159 } 159 }
160 160
  161 +//func (repository *UserLoveFlagRepository) FindByUserVisible(ctx context.Context, conn transaction.Conn,companyId, toUserId int64,currentUserId, queryOptions map[string]interface{}) (int64, []*domain.UserLoveFlag, error) {
  162 +// var (
  163 +// tx = conn.DB()
  164 +// ms []*models.UserLoveFlag
  165 +// dms = make([]*domain.UserLoveFlag, 0)
  166 +// total int64
  167 +// )
  168 +// queryFunc := func() (interface{}, error) {
  169 +// tx = tx.Model(&ms).Order("id desc")
  170 +// if v, ok := queryOptions["companyId"]; ok {
  171 +// tx = tx.Where("company_id=?", v)
  172 +// }
  173 +// tx = tx.Where("article_id in (SELECT id FROM \"article\" WHERE company_id=? AND author_id in (?) AND (author_id = ? or target_user=0 or who_read @>'[?]') AND show = 1 AND \"article\".\"is_del\" = 0)", companyId,toUserId)
  174 +// if v, ok := queryOptions["toUserId"]; ok {
  175 +// tx = tx.Where("to_user_id=?", v)
  176 +// }
  177 +// if v, ok := queryOptions["commentIdList"]; ok {
  178 +// tx = tx.Where("comment_id in (?)", v)
  179 +// }
  180 +// if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
  181 +// return dms, tx.Error
  182 +// }
  183 +// return dms, nil
  184 +// }
  185 +//
  186 +// if _, err := repository.Query(queryFunc); err != nil {
  187 +// return 0, nil, err
  188 +// }
  189 +//
  190 +// for _, item := range ms {
  191 +// if dm, err := repository.ModelToDomainModel(item); err != nil {
  192 +// return 0, dms, err
  193 +// } else {
  194 +// dms = append(dms, dm)
  195 +// }
  196 +// }
  197 +// return total, dms, nil
  198 +//}
  199 +
161 func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLoveFlag) (*domain.UserLoveFlag, error) { 200 func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLoveFlag) (*domain.UserLoveFlag, error) {
162 to := &domain.UserLoveFlag{ 201 to := &domain.UserLoveFlag{
163 Id: from.Id, 202 Id: from.Id,
@@ -226,6 +226,9 @@ func (repository *UserRepository) FindDepartmentUsers(ctx context.Context, conn @@ -226,6 +226,9 @@ func (repository *UserRepository) FindDepartmentUsers(ctx context.Context, conn
226 tx.Where("company_id = ?", companyId) 226 tx.Where("company_id = ?", companyId)
227 tx.Where("audit_status in (?)", domain.UserAuditStatusPassed) 227 tx.Where("audit_status in (?)", domain.UserAuditStatusPassed)
228 tx.Where("enable = ?", domain.UserEnable) 228 tx.Where("enable = ?", domain.UserEnable)
  229 + if v, ok := queryOptions["name"]; ok {
  230 + tx.Where("name like ?", fmt.Sprintf("%%%v%%", v))
  231 + }
229 if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { 232 if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
230 return dms, tx.Error 233 return dms, tx.Error
231 } 234 }
@@ -43,7 +43,7 @@ type ArticleRepository interface { @@ -43,7 +43,7 @@ type ArticleRepository interface {
43 Find(ctx context.Context, conn transaction.Conn, companyId int64, queryOptions map[string]interface{}) (int64, []*Article, error) 43 Find(ctx context.Context, conn transaction.Conn, companyId int64, queryOptions map[string]interface{}) (int64, []*Article, error)
44 FindAuthorsLatestFirstArticle(ctx context.Context, conn transaction.Conn, companyId int64, authors []int64, whoRead int64, limit int) (int64, []*Article, error) 44 FindAuthorsLatestFirstArticle(ctx context.Context, conn transaction.Conn, companyId int64, authors []int64, whoRead int64, limit int) (int64, []*Article, error)
45 FindAuthorsLatestFirstUnreadArticle(ctx context.Context, conn transaction.Conn, companyId int64, authors []int64, whoRead int64, limit int) (int64, []*Article, error) 45 FindAuthorsLatestFirstUnreadArticle(ctx context.Context, conn transaction.Conn, companyId int64, authors []int64, whoRead int64, limit int) (int64, []*Article, error)
46 - FindAuthorsLatestArticle(ctx context.Context, conn transaction.Conn, companyId int64, authors []int64, whoRead int64, lastId int64, limit int) (int64, []*Article, error) 46 + FindAuthorsLatestArticle(ctx context.Context, conn transaction.Conn, companyId int64, authors []int64, whoRead int64, lastId int64, limit int, queryOptions map[string]interface{}) (int64, []*Article, error)
47 FindLatestAccessibleArticle(ctx context.Context, conn transaction.Conn, companyId int64, whoRead int64, lastId int64, limit int) (int64, []*Article, error) 47 FindLatestAccessibleArticle(ctx context.Context, conn transaction.Conn, companyId int64, whoRead int64, lastId int64, limit int) (int64, []*Article, error)
48 IncreaseCountLove(ctx context.Context, conn transaction.Conn, incr int, articleId int64) error //点赞数量变动 48 IncreaseCountLove(ctx context.Context, conn transaction.Conn, incr int, articleId int64) error //点赞数量变动
49 IncreaseCountComment(ctx context.Context, conn transaction.Conn, incr int, articleId int64) error //评论数量变动 49 IncreaseCountComment(ctx context.Context, conn transaction.Conn, incr int, articleId int64) error //评论数量变动