Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # cmd/discuss/api/dsl/core/article_type.api # cmd/discuss/api/internal/types/types.go
正在显示
17 个修改的文件
包含
1497 行增加
和
351 行删除
| @@ -43,6 +43,34 @@ | @@ -43,6 +43,34 @@ | ||
| 43 | ] | 43 | ] |
| 44 | } | 44 | } |
| 45 | }, | 45 | }, |
| 46 | + "v1/mini/article/mark/user_read": { | ||
| 47 | + "post": { | ||
| 48 | + "summary": "小程序标记当前人员查看的文章", | ||
| 49 | + "operationId": "MiniArticleMarkUserRead", | ||
| 50 | + "responses": { | ||
| 51 | + "200": { | ||
| 52 | + "description": "A successful response.", | ||
| 53 | + "schema": { | ||
| 54 | + "$ref": "#/definitions/MiniArticleMarkUserReadResponse" | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + }, | ||
| 58 | + "parameters": [ | ||
| 59 | + { | ||
| 60 | + "name": "body", | ||
| 61 | + "in": "body", | ||
| 62 | + "required": true, | ||
| 63 | + "schema": { | ||
| 64 | + "$ref": "#/definitions/MiniArticleMarkUserReadRequest" | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + ], | ||
| 68 | + "requestBody": {}, | ||
| 69 | + "tags": [ | ||
| 70 | + "article" | ||
| 71 | + ] | ||
| 72 | + } | ||
| 73 | + }, | ||
| 46 | "v1/mini/article/search/me": { | 74 | "v1/mini/article/search/me": { |
| 47 | "post": { | 75 | "post": { |
| 48 | "summary": "小程序获取我发布的文章", | 76 | "summary": "小程序获取我发布的文章", |
| @@ -153,6 +181,62 @@ | @@ -153,6 +181,62 @@ | ||
| 153 | ] | 181 | ] |
| 154 | } | 182 | } |
| 155 | }, | 183 | }, |
| 184 | + "v1/mini/article_backup/search": { | ||
| 185 | + "post": { | ||
| 186 | + "summary": "小程序获取文章的编辑记录", | ||
| 187 | + "operationId": "MiniArticleBackupSearch", | ||
| 188 | + "responses": { | ||
| 189 | + "200": { | ||
| 190 | + "description": "A successful response.", | ||
| 191 | + "schema": { | ||
| 192 | + "$ref": "#/definitions/MiniArticleBackupSearchResponse" | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | + }, | ||
| 196 | + "parameters": [ | ||
| 197 | + { | ||
| 198 | + "name": "body", | ||
| 199 | + "in": "body", | ||
| 200 | + "required": true, | ||
| 201 | + "schema": { | ||
| 202 | + "$ref": "#/definitions/MiniArticleBackupSearchRequest" | ||
| 203 | + } | ||
| 204 | + } | ||
| 205 | + ], | ||
| 206 | + "requestBody": {}, | ||
| 207 | + "tags": [ | ||
| 208 | + "article" | ||
| 209 | + ] | ||
| 210 | + } | ||
| 211 | + }, | ||
| 212 | + "v1/mini/article_draft": { | ||
| 213 | + "post": { | ||
| 214 | + "summary": "小程序创建文章进草稿箱", | ||
| 215 | + "operationId": "MiniCreateArticleDraft", | ||
| 216 | + "responses": { | ||
| 217 | + "200": { | ||
| 218 | + "description": "A successful response.", | ||
| 219 | + "schema": { | ||
| 220 | + "$ref": "#/definitions/MiniArticleSearchMeResponse" | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + }, | ||
| 224 | + "parameters": [ | ||
| 225 | + { | ||
| 226 | + "name": "body", | ||
| 227 | + "in": "body", | ||
| 228 | + "required": true, | ||
| 229 | + "schema": { | ||
| 230 | + "$ref": "#/definitions/MiniArticleSearchMeRequest" | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + ], | ||
| 234 | + "requestBody": {}, | ||
| 235 | + "tags": [ | ||
| 236 | + "article" | ||
| 237 | + ] | ||
| 238 | + } | ||
| 239 | + }, | ||
| 156 | "v1/mini/comment": { | 240 | "v1/mini/comment": { |
| 157 | "get": { | 241 | "get": { |
| 158 | "summary": "小程序评论", | 242 | "summary": "小程序评论", |
| @@ -173,7 +257,7 @@ | @@ -173,7 +257,7 @@ | ||
| 173 | }, | 257 | }, |
| 174 | "v1/mini/company/search": { | 258 | "v1/mini/company/search": { |
| 175 | "post": { | 259 | "post": { |
| 176 | - "summary": "公司搜索", | 260 | + "summary": "公司搜索(公开的)", |
| 177 | "operationId": "miniCompanySearch", | 261 | "operationId": "miniCompanySearch", |
| 178 | "responses": { | 262 | "responses": { |
| 179 | "200": { | 263 | "200": { |
| @@ -199,6 +283,34 @@ | @@ -199,6 +283,34 @@ | ||
| 199 | ] | 283 | ] |
| 200 | } | 284 | } |
| 201 | }, | 285 | }, |
| 286 | + "v1/mini/company/search-joined": { | ||
| 287 | + "post": { | ||
| 288 | + "summary": "搜索已加入的公司", | ||
| 289 | + "operationId": "miniCompanySearchJoined", | ||
| 290 | + "responses": { | ||
| 291 | + "200": { | ||
| 292 | + "description": "A successful response.", | ||
| 293 | + "schema": { | ||
| 294 | + "$ref": "#/definitions/CompanySearchResponse" | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + }, | ||
| 298 | + "parameters": [ | ||
| 299 | + { | ||
| 300 | + "name": "body", | ||
| 301 | + "in": "body", | ||
| 302 | + "required": true, | ||
| 303 | + "schema": { | ||
| 304 | + "$ref": "#/definitions/CompanySearchRequest" | ||
| 305 | + } | ||
| 306 | + } | ||
| 307 | + ], | ||
| 308 | + "requestBody": {}, | ||
| 309 | + "tags": [ | ||
| 310 | + "company" | ||
| 311 | + ] | ||
| 312 | + } | ||
| 313 | + }, | ||
| 202 | "v1/mini/message/business": { | 314 | "v1/mini/message/business": { |
| 203 | "post": { | 315 | "post": { |
| 204 | "summary": "业务消息", | 316 | "summary": "业务消息", |
| @@ -557,6 +669,60 @@ | @@ -557,6 +669,60 @@ | ||
| 557 | ] | 669 | ] |
| 558 | } | 670 | } |
| 559 | }, | 671 | }, |
| 672 | + "v1/system/article/search": { | ||
| 673 | + "post": { | ||
| 674 | + "summary": "管理后台获取文章列表", | ||
| 675 | + "operationId": "SystemSearchArticle", | ||
| 676 | + "responses": { | ||
| 677 | + "200": { | ||
| 678 | + "description": "A successful response.", | ||
| 679 | + "schema": { | ||
| 680 | + "$ref": "#/definitions/SystemArticleSearchResponse" | ||
| 681 | + } | ||
| 682 | + } | ||
| 683 | + }, | ||
| 684 | + "parameters": [ | ||
| 685 | + { | ||
| 686 | + "name": "body", | ||
| 687 | + "in": "body", | ||
| 688 | + "required": true, | ||
| 689 | + "schema": { | ||
| 690 | + "$ref": "#/definitions/SystemArticleSearchRequest" | ||
| 691 | + } | ||
| 692 | + } | ||
| 693 | + ], | ||
| 694 | + "requestBody": {}, | ||
| 695 | + "tags": [ | ||
| 696 | + "article" | ||
| 697 | + ] | ||
| 698 | + } | ||
| 699 | + }, | ||
| 700 | + "v1/system/article/{id}": { | ||
| 701 | + "get": { | ||
| 702 | + "summary": "管理后台获取文章内容详情", | ||
| 703 | + "operationId": "SystemGetArticle", | ||
| 704 | + "responses": { | ||
| 705 | + "200": { | ||
| 706 | + "description": "A successful response.", | ||
| 707 | + "schema": { | ||
| 708 | + "$ref": "#/definitions/SystemArticleGetResponse" | ||
| 709 | + } | ||
| 710 | + } | ||
| 711 | + }, | ||
| 712 | + "parameters": [ | ||
| 713 | + { | ||
| 714 | + "name": "id", | ||
| 715 | + "in": "path", | ||
| 716 | + "required": true, | ||
| 717 | + "type": "string" | ||
| 718 | + } | ||
| 719 | + ], | ||
| 720 | + "requestBody": {}, | ||
| 721 | + "tags": [ | ||
| 722 | + "article" | ||
| 723 | + ] | ||
| 724 | + } | ||
| 725 | + }, | ||
| 560 | "v1/system/article_tag": { | 726 | "v1/system/article_tag": { |
| 561 | "post": { | 727 | "post": { |
| 562 | "summary": "后台创建文章标签", | 728 | "summary": "后台创建文章标签", |
| @@ -798,6 +964,29 @@ | @@ -798,6 +964,29 @@ | ||
| 798 | } | 964 | } |
| 799 | }, | 965 | }, |
| 800 | "v1/system/role/{id}": { | 966 | "v1/system/role/{id}": { |
| 967 | + "get": { | ||
| 968 | + "operationId": "systemGetRole", | ||
| 969 | + "responses": { | ||
| 970 | + "200": { | ||
| 971 | + "description": "A successful response.", | ||
| 972 | + "schema": { | ||
| 973 | + "$ref": "#/definitions/RoleGetResponse" | ||
| 974 | + } | ||
| 975 | + } | ||
| 976 | + }, | ||
| 977 | + "parameters": [ | ||
| 978 | + { | ||
| 979 | + "name": "id", | ||
| 980 | + "in": "path", | ||
| 981 | + "required": true, | ||
| 982 | + "type": "string" | ||
| 983 | + } | ||
| 984 | + ], | ||
| 985 | + "requestBody": {}, | ||
| 986 | + "tags": [ | ||
| 987 | + "role" | ||
| 988 | + ] | ||
| 989 | + }, | ||
| 801 | "delete": { | 990 | "delete": { |
| 802 | "operationId": "systemDeleteRole", | 991 | "operationId": "systemDeleteRole", |
| 803 | "responses": { | 992 | "responses": { |
| @@ -829,13 +1018,13 @@ | @@ -829,13 +1018,13 @@ | ||
| 829 | "role" | 1018 | "role" |
| 830 | ] | 1019 | ] |
| 831 | }, | 1020 | }, |
| 832 | - "post": { | ||
| 833 | - "operationId": "systemGetRole", | 1021 | + "put": { |
| 1022 | + "operationId": "systemUpdateRole", | ||
| 834 | "responses": { | 1023 | "responses": { |
| 835 | "200": { | 1024 | "200": { |
| 836 | "description": "A successful response.", | 1025 | "description": "A successful response.", |
| 837 | "schema": { | 1026 | "schema": { |
| 838 | - "$ref": "#/definitions/RoleGetResponse" | 1027 | + "$ref": "#/definitions/RoleUpdateResponse" |
| 839 | } | 1028 | } |
| 840 | } | 1029 | } |
| 841 | }, | 1030 | }, |
| @@ -851,7 +1040,7 @@ | @@ -851,7 +1040,7 @@ | ||
| 851 | "in": "body", | 1040 | "in": "body", |
| 852 | "required": true, | 1041 | "required": true, |
| 853 | "schema": { | 1042 | "schema": { |
| 854 | - "$ref": "#/definitions/RoleGetRequest" | 1043 | + "$ref": "#/definitions/RoleUpdateRequest" |
| 855 | } | 1044 | } |
| 856 | } | 1045 | } |
| 857 | ], | 1046 | ], |
| @@ -859,36 +1048,61 @@ | @@ -859,36 +1048,61 @@ | ||
| 859 | "tags": [ | 1048 | "tags": [ |
| 860 | "role" | 1049 | "role" |
| 861 | ] | 1050 | ] |
| 862 | - }, | ||
| 863 | - "put": { | ||
| 864 | - "operationId": "systemUpdateRole", | 1051 | + } |
| 1052 | + }, | ||
| 1053 | + "v1/system/user/info": { | ||
| 1054 | + "post": { | ||
| 1055 | + "summary": "系统用户信息", | ||
| 1056 | + "operationId": "systemUserInfo", | ||
| 865 | "responses": { | 1057 | "responses": { |
| 866 | "200": { | 1058 | "200": { |
| 867 | "description": "A successful response.", | 1059 | "description": "A successful response.", |
| 868 | "schema": { | 1060 | "schema": { |
| 869 | - "$ref": "#/definitions/RoleUpdateResponse" | 1061 | + "$ref": "#/definitions/SystemUserInfoResponse" |
| 870 | } | 1062 | } |
| 871 | } | 1063 | } |
| 872 | }, | 1064 | }, |
| 873 | "parameters": [ | 1065 | "parameters": [ |
| 874 | { | 1066 | { |
| 875 | - "name": "id", | ||
| 876 | - "in": "path", | 1067 | + "name": "body", |
| 1068 | + "in": "body", | ||
| 877 | "required": true, | 1069 | "required": true, |
| 878 | - "type": "string" | ||
| 879 | - }, | 1070 | + "schema": { |
| 1071 | + "$ref": "#/definitions/SystemUserInfoRequest" | ||
| 1072 | + } | ||
| 1073 | + } | ||
| 1074 | + ], | ||
| 1075 | + "requestBody": {}, | ||
| 1076 | + "tags": [ | ||
| 1077 | + "user" | ||
| 1078 | + ] | ||
| 1079 | + } | ||
| 1080 | + }, | ||
| 1081 | + "v1/user/mylike": { | ||
| 1082 | + "post": { | ||
| 1083 | + "summary": "我点赞的文章或评论", | ||
| 1084 | + "operationId": "miniMyLike", | ||
| 1085 | + "responses": { | ||
| 1086 | + "200": { | ||
| 1087 | + "description": "A successful response.", | ||
| 1088 | + "schema": { | ||
| 1089 | + "$ref": "#/definitions/MiniMyLikeResponse" | ||
| 1090 | + } | ||
| 1091 | + } | ||
| 1092 | + }, | ||
| 1093 | + "parameters": [ | ||
| 880 | { | 1094 | { |
| 881 | "name": "body", | 1095 | "name": "body", |
| 882 | "in": "body", | 1096 | "in": "body", |
| 883 | "required": true, | 1097 | "required": true, |
| 884 | "schema": { | 1098 | "schema": { |
| 885 | - "$ref": "#/definitions/RoleUpdateRequest" | 1099 | + "$ref": "#/definitions/MiniMyLikeRequest" |
| 886 | } | 1100 | } |
| 887 | } | 1101 | } |
| 888 | ], | 1102 | ], |
| 889 | "requestBody": {}, | 1103 | "requestBody": {}, |
| 890 | "tags": [ | 1104 | "tags": [ |
| 891 | - "role" | 1105 | + "user" |
| 892 | ] | 1106 | ] |
| 893 | } | 1107 | } |
| 894 | } | 1108 | } |
| @@ -1142,21 +1356,22 @@ | @@ -1142,21 +1356,22 @@ | ||
| 1142 | "type": "integer", | 1356 | "type": "integer", |
| 1143 | "format": "int32" | 1357 | "format": "int32" |
| 1144 | }, | 1358 | }, |
| 1359 | + "flag": { | ||
| 1360 | + "type": "integer", | ||
| 1361 | + "format": "int32", | ||
| 1362 | + "description": " 1:用户已加入的 2:用户未加入的公司" | ||
| 1363 | + }, | ||
| 1145 | "userId": { | 1364 | "userId": { |
| 1146 | "type": "integer", | 1365 | "type": "integer", |
| 1147 | "format": "int64", | 1366 | "format": "int64", |
| 1148 | - "description": " 按用户搜索" | 1367 | + "description": " 按用户搜索(用户所加入的企业)" |
| 1149 | }, | 1368 | }, |
| 1150 | "code": { | 1369 | "code": { |
| 1151 | "type": "string", | 1370 | "type": "string", |
| 1152 | "description": " 按编码搜索" | 1371 | "description": " 按编码搜索" |
| 1153 | } | 1372 | } |
| 1154 | }, | 1373 | }, |
| 1155 | - "title": "CompanySearchRequest", | ||
| 1156 | - "required": [ | ||
| 1157 | - "page", | ||
| 1158 | - "size" | ||
| 1159 | - ] | 1374 | + "title": "CompanySearchRequest" |
| 1160 | }, | 1375 | }, |
| 1161 | "CompanySearchResponse": { | 1376 | "CompanySearchResponse": { |
| 1162 | "type": "object", | 1377 | "type": "object", |
| @@ -1304,7 +1519,7 @@ | @@ -1304,7 +1519,7 @@ | ||
| 1304 | "description": " 创建时间" | 1519 | "description": " 创建时间" |
| 1305 | }, | 1520 | }, |
| 1306 | "user": { | 1521 | "user": { |
| 1307 | - "$ref": "#/definitions/User", | 1522 | + "$ref": "#/definitions/SimpleUser", |
| 1308 | "description": " 操作人" | 1523 | "description": " 操作人" |
| 1309 | }, | 1524 | }, |
| 1310 | "article": { | 1525 | "article": { |
| @@ -1312,7 +1527,7 @@ | @@ -1312,7 +1527,7 @@ | ||
| 1312 | "description": " 文章" | 1527 | "description": " 文章" |
| 1313 | }, | 1528 | }, |
| 1314 | "comment": { | 1529 | "comment": { |
| 1315 | - "$ref": "#/definitions/Comment", | 1530 | + "$ref": "#/definitions/SimpleComment", |
| 1316 | "description": " 评论(不一定是自己,可能是被人@到)" | 1531 | "description": " 评论(不一定是自己,可能是被人@到)" |
| 1317 | } | 1532 | } |
| 1318 | }, | 1533 | }, |
| @@ -1452,47 +1667,132 @@ | @@ -1452,47 +1667,132 @@ | ||
| 1452 | "total" | 1667 | "total" |
| 1453 | ] | 1668 | ] |
| 1454 | }, | 1669 | }, |
| 1455 | - "MiniArticleCreateRequest": { | 1670 | + "MiniArticleBackupItem": { |
| 1456 | "type": "object", | 1671 | "type": "object", |
| 1457 | "properties": { | 1672 | "properties": { |
| 1458 | - "title": { | ||
| 1459 | - "type": "string", | ||
| 1460 | - "description": "标题" | 1673 | + "id": { |
| 1674 | + "type": "integer", | ||
| 1675 | + "format": "int64" | ||
| 1461 | }, | 1676 | }, |
| 1462 | - "section": { | ||
| 1463 | - "type": "array", | ||
| 1464 | - "items": { | ||
| 1465 | - "type": "string" | ||
| 1466 | - }, | ||
| 1467 | - "description": "文章的文本内容" | 1677 | + "title": { |
| 1678 | + "type": "string" | ||
| 1468 | }, | 1679 | }, |
| 1469 | - "authorId": { | ||
| 1470 | - "type": "integer", | ||
| 1471 | - "format": "int64", | ||
| 1472 | - "description": "发布人id" | 1680 | + "content": { |
| 1681 | + "type": "string" | ||
| 1473 | }, | 1682 | }, |
| 1474 | "images": { | 1683 | "images": { |
| 1475 | "type": "array", | 1684 | "type": "array", |
| 1476 | "items": { | 1685 | "items": { |
| 1477 | "type": "string" | 1686 | "type": "string" |
| 1478 | - }, | ||
| 1479 | - "description": "图片" | 1687 | + } |
| 1480 | }, | 1688 | }, |
| 1481 | - "whoRead": { | ||
| 1482 | - "type": "array", | ||
| 1483 | - "items": { | ||
| 1484 | - "type": "integer", | ||
| 1485 | - "format": "int64" | ||
| 1486 | - }, | ||
| 1487 | - "description": "谁可查看" | 1689 | + "createdAt": { |
| 1690 | + "type": "integer", | ||
| 1691 | + "format": "int64" | ||
| 1488 | }, | 1692 | }, |
| 1489 | - "whoReview": { | ||
| 1490 | - "type": "array", | ||
| 1491 | - "items": { | ||
| 1492 | - "type": "integer", | ||
| 1493 | - "format": "int64" | ||
| 1494 | - }, | ||
| 1495 | - "description": "谁可评论" | 1693 | + "location": { |
| 1694 | + "$ref": "#/definitions/Location" | ||
| 1695 | + } | ||
| 1696 | + }, | ||
| 1697 | + "title": "MiniArticleBackupItem", | ||
| 1698 | + "required": [ | ||
| 1699 | + "id", | ||
| 1700 | + "title", | ||
| 1701 | + "content", | ||
| 1702 | + "images", | ||
| 1703 | + "createdAt", | ||
| 1704 | + "location" | ||
| 1705 | + ] | ||
| 1706 | + }, | ||
| 1707 | + "MiniArticleBackupSearchRequest": { | ||
| 1708 | + "type": "object", | ||
| 1709 | + "properties": { | ||
| 1710 | + "page": { | ||
| 1711 | + "type": "integer", | ||
| 1712 | + "format": "int32" | ||
| 1713 | + }, | ||
| 1714 | + "size": { | ||
| 1715 | + "type": "integer", | ||
| 1716 | + "format": "int32" | ||
| 1717 | + }, | ||
| 1718 | + "articleId": { | ||
| 1719 | + "type": "integer", | ||
| 1720 | + "format": "int32" | ||
| 1721 | + }, | ||
| 1722 | + "": { | ||
| 1723 | + "type": "integer", | ||
| 1724 | + "format": "int64", | ||
| 1725 | + "description": " 服务端自动获取" | ||
| 1726 | + } | ||
| 1727 | + }, | ||
| 1728 | + "title": "MiniArticleBackupSearchRequest", | ||
| 1729 | + "required": [ | ||
| 1730 | + "page", | ||
| 1731 | + "size", | ||
| 1732 | + "articleId" | ||
| 1733 | + ] | ||
| 1734 | + }, | ||
| 1735 | + "MiniArticleBackupSearchResponse": { | ||
| 1736 | + "type": "object", | ||
| 1737 | + "properties": { | ||
| 1738 | + "total": { | ||
| 1739 | + "type": "integer", | ||
| 1740 | + "format": "int64" | ||
| 1741 | + }, | ||
| 1742 | + "list": { | ||
| 1743 | + "type": "array", | ||
| 1744 | + "items": { | ||
| 1745 | + "$ref": "#/definitions/MiniArticleBackupItem" | ||
| 1746 | + } | ||
| 1747 | + } | ||
| 1748 | + }, | ||
| 1749 | + "title": "MiniArticleBackupSearchResponse", | ||
| 1750 | + "required": [ | ||
| 1751 | + "total", | ||
| 1752 | + "list" | ||
| 1753 | + ] | ||
| 1754 | + }, | ||
| 1755 | + "MiniArticleCreateRequest": { | ||
| 1756 | + "type": "object", | ||
| 1757 | + "properties": { | ||
| 1758 | + "title": { | ||
| 1759 | + "type": "string", | ||
| 1760 | + "description": "标题" | ||
| 1761 | + }, | ||
| 1762 | + "section": { | ||
| 1763 | + "type": "array", | ||
| 1764 | + "items": { | ||
| 1765 | + "type": "string" | ||
| 1766 | + }, | ||
| 1767 | + "description": "文章的文本内容" | ||
| 1768 | + }, | ||
| 1769 | + "authorId": { | ||
| 1770 | + "type": "integer", | ||
| 1771 | + "format": "int64", | ||
| 1772 | + "description": "发布人id" | ||
| 1773 | + }, | ||
| 1774 | + "images": { | ||
| 1775 | + "type": "array", | ||
| 1776 | + "items": { | ||
| 1777 | + "type": "string" | ||
| 1778 | + }, | ||
| 1779 | + "description": "图片" | ||
| 1780 | + }, | ||
| 1781 | + "whoRead": { | ||
| 1782 | + "type": "array", | ||
| 1783 | + "items": { | ||
| 1784 | + "type": "integer", | ||
| 1785 | + "format": "int64" | ||
| 1786 | + }, | ||
| 1787 | + "description": "谁可查看" | ||
| 1788 | + }, | ||
| 1789 | + "whoReview": { | ||
| 1790 | + "type": "array", | ||
| 1791 | + "items": { | ||
| 1792 | + "type": "integer", | ||
| 1793 | + "format": "int64" | ||
| 1794 | + }, | ||
| 1795 | + "description": "谁可评论" | ||
| 1496 | }, | 1796 | }, |
| 1497 | "location": { | 1797 | "location": { |
| 1498 | "$ref": "#/definitions/Location", | 1798 | "$ref": "#/definitions/Location", |
| @@ -1518,6 +1818,45 @@ | @@ -1518,6 +1818,45 @@ | ||
| 1518 | "id" | 1818 | "id" |
| 1519 | ] | 1819 | ] |
| 1520 | }, | 1820 | }, |
| 1821 | + "MiniArticleDraftCreateRequest": { | ||
| 1822 | + "type": "object", | ||
| 1823 | + "properties": { | ||
| 1824 | + "template": { | ||
| 1825 | + "type": "integer", | ||
| 1826 | + "format": "int32", | ||
| 1827 | + "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式" | ||
| 1828 | + }, | ||
| 1829 | + "content": { | ||
| 1830 | + "type": "array", | ||
| 1831 | + "items": { | ||
| 1832 | + "type": "string" | ||
| 1833 | + }, | ||
| 1834 | + "description": " 填写的内容" | ||
| 1835 | + }, | ||
| 1836 | + "title": { | ||
| 1837 | + "type": "string", | ||
| 1838 | + "description": "标题" | ||
| 1839 | + }, | ||
| 1840 | + "images": { | ||
| 1841 | + "type": "array", | ||
| 1842 | + "items": { | ||
| 1843 | + "type": "string" | ||
| 1844 | + }, | ||
| 1845 | + "description": "图片" | ||
| 1846 | + } | ||
| 1847 | + }, | ||
| 1848 | + "title": "MiniArticleDraftCreateRequest", | ||
| 1849 | + "required": [ | ||
| 1850 | + "template", | ||
| 1851 | + "content", | ||
| 1852 | + "title", | ||
| 1853 | + "images" | ||
| 1854 | + ] | ||
| 1855 | + }, | ||
| 1856 | + "MiniArticleDraftCreateResponse": { | ||
| 1857 | + "type": "object", | ||
| 1858 | + "title": "MiniArticleDraftCreateResponse" | ||
| 1859 | + }, | ||
| 1521 | "MiniArticleGetRequest": { | 1860 | "MiniArticleGetRequest": { |
| 1522 | "type": "object", | 1861 | "type": "object", |
| 1523 | "properties": { | 1862 | "properties": { |
| @@ -1526,15 +1865,14 @@ | @@ -1526,15 +1865,14 @@ | ||
| 1526 | "format": "int64", | 1865 | "format": "int64", |
| 1527 | "description": "id" | 1866 | "description": "id" |
| 1528 | }, | 1867 | }, |
| 1529 | - "companyId": { | 1868 | + "": { |
| 1530 | "type": "integer", | 1869 | "type": "integer", |
| 1531 | "format": "int64" | 1870 | "format": "int64" |
| 1532 | } | 1871 | } |
| 1533 | }, | 1872 | }, |
| 1534 | "title": "MiniArticleGetRequest", | 1873 | "title": "MiniArticleGetRequest", |
| 1535 | "required": [ | 1874 | "required": [ |
| 1536 | - "id", | ||
| 1537 | - "-" | 1875 | + "id" |
| 1538 | ] | 1876 | ] |
| 1539 | }, | 1877 | }, |
| 1540 | "MiniArticleGetResponse": { | 1878 | "MiniArticleGetResponse": { |
| @@ -1616,6 +1954,11 @@ | @@ -1616,6 +1954,11 @@ | ||
| 1616 | "type": "integer", | 1954 | "type": "integer", |
| 1617 | "format": "int32", | 1955 | "format": "int32", |
| 1618 | "description": " 评论的展示状态(0显示、1不显示)" | 1956 | "description": " 评论的展示状态(0显示、1不显示)" |
| 1957 | + }, | ||
| 1958 | + "edit": { | ||
| 1959 | + "type": "integer", | ||
| 1960 | + "format": "int32", | ||
| 1961 | + "description": " 文章是否存在变更记录 (0 不存在 1存在)" | ||
| 1619 | } | 1962 | } |
| 1620 | }, | 1963 | }, |
| 1621 | "title": "MiniArticleGetResponse", | 1964 | "title": "MiniArticleGetResponse", |
| @@ -1633,17 +1976,55 @@ | @@ -1633,17 +1976,55 @@ | ||
| 1633 | "countLove", | 1976 | "countLove", |
| 1634 | "countComment", | 1977 | "countComment", |
| 1635 | "countRead", | 1978 | "countRead", |
| 1636 | - "show" | 1979 | + "show", |
| 1980 | + "edit" | ||
| 1981 | + ] | ||
| 1982 | + }, | ||
| 1983 | + "MiniArticleMarkUserReadRequest": { | ||
| 1984 | + "type": "object", | ||
| 1985 | + "properties": { | ||
| 1986 | + "": { | ||
| 1987 | + "type": "integer", | ||
| 1988 | + "format": "int64", | ||
| 1989 | + "description": " 当前操作人" | ||
| 1990 | + }, | ||
| 1991 | + "": { | ||
| 1992 | + "type": "integer", | ||
| 1993 | + "format": "int64", | ||
| 1994 | + "description": " 当前公司" | ||
| 1995 | + }, | ||
| 1996 | + "articleId": { | ||
| 1997 | + "type": "integer", | ||
| 1998 | + "format": "int64", | ||
| 1999 | + "description": " 文章id" | ||
| 2000 | + } | ||
| 2001 | + }, | ||
| 2002 | + "title": "MiniArticleMarkUserReadRequest", | ||
| 2003 | + "required": [ | ||
| 2004 | + "articleId" | ||
| 2005 | + ] | ||
| 2006 | + }, | ||
| 2007 | + "MiniArticleMarkUserReadResponse": { | ||
| 2008 | + "type": "object", | ||
| 2009 | + "properties": { | ||
| 2010 | + "id": { | ||
| 2011 | + "type": "integer", | ||
| 2012 | + "format": "int64" | ||
| 2013 | + } | ||
| 2014 | + }, | ||
| 2015 | + "title": "MiniArticleMarkUserReadResponse", | ||
| 2016 | + "required": [ | ||
| 2017 | + "id" | ||
| 1637 | ] | 2018 | ] |
| 1638 | }, | 2019 | }, |
| 1639 | "MiniArticleSearchMeRequest": { | 2020 | "MiniArticleSearchMeRequest": { |
| 1640 | "type": "object", | 2021 | "type": "object", |
| 1641 | "properties": { | 2022 | "properties": { |
| 1642 | - "authorId": { | 2023 | + "": { |
| 1643 | "type": "integer", | 2024 | "type": "integer", |
| 1644 | "format": "int64" | 2025 | "format": "int64" |
| 1645 | }, | 2026 | }, |
| 1646 | - "companyId": { | 2027 | + "": { |
| 1647 | "type": "integer", | 2028 | "type": "integer", |
| 1648 | "format": "int64" | 2029 | "format": "int64" |
| 1649 | }, | 2030 | }, |
| @@ -1658,7 +2039,6 @@ | @@ -1658,7 +2039,6 @@ | ||
| 1658 | }, | 2039 | }, |
| 1659 | "title": "MiniArticleSearchMeRequest", | 2040 | "title": "MiniArticleSearchMeRequest", |
| 1660 | "required": [ | 2041 | "required": [ |
| 1661 | - "-", | ||
| 1662 | "page", | 2042 | "page", |
| 1663 | "size" | 2043 | "size" |
| 1664 | ] | 2044 | ] |
| @@ -1683,6 +2063,44 @@ | @@ -1683,6 +2063,44 @@ | ||
| 1683 | "list" | 2063 | "list" |
| 1684 | ] | 2064 | ] |
| 1685 | }, | 2065 | }, |
| 2066 | + "MiniMyLikeRequest": { | ||
| 2067 | + "type": "object", | ||
| 2068 | + "properties": { | ||
| 2069 | + "page": { | ||
| 2070 | + "type": "integer", | ||
| 2071 | + "format": "int32" | ||
| 2072 | + }, | ||
| 2073 | + "size": { | ||
| 2074 | + "type": "integer", | ||
| 2075 | + "format": "int32" | ||
| 2076 | + } | ||
| 2077 | + }, | ||
| 2078 | + "title": "MiniMyLikeRequest", | ||
| 2079 | + "required": [ | ||
| 2080 | + "page", | ||
| 2081 | + "size" | ||
| 2082 | + ] | ||
| 2083 | + }, | ||
| 2084 | + "MiniMyLikeResponse": { | ||
| 2085 | + "type": "object", | ||
| 2086 | + "properties": { | ||
| 2087 | + "list": { | ||
| 2088 | + "type": "array", | ||
| 2089 | + "items": { | ||
| 2090 | + "$ref": "#/definitions/MyLikeItem" | ||
| 2091 | + } | ||
| 2092 | + }, | ||
| 2093 | + "total": { | ||
| 2094 | + "type": "integer", | ||
| 2095 | + "format": "int64" | ||
| 2096 | + } | ||
| 2097 | + }, | ||
| 2098 | + "title": "MiniMyLikeResponse", | ||
| 2099 | + "required": [ | ||
| 2100 | + "list", | ||
| 2101 | + "total" | ||
| 2102 | + ] | ||
| 2103 | + }, | ||
| 1686 | "MiniSetUserLikeRequset": { | 2104 | "MiniSetUserLikeRequset": { |
| 1687 | "type": "object", | 2105 | "type": "object", |
| 1688 | "properties": { | 2106 | "properties": { |
| @@ -1696,7 +2114,7 @@ | @@ -1696,7 +2114,7 @@ | ||
| 1696 | "format": "int64", | 2114 | "format": "int64", |
| 1697 | "description": "评论id" | 2115 | "description": "评论id" |
| 1698 | }, | 2116 | }, |
| 1699 | - "userId": { | 2117 | + "": { |
| 1700 | "type": "integer", | 2118 | "type": "integer", |
| 1701 | "format": "int64", | 2119 | "format": "int64", |
| 1702 | "description": "操作人" | 2120 | "description": "操作人" |
| @@ -1711,7 +2129,6 @@ | @@ -1711,7 +2129,6 @@ | ||
| 1711 | "required": [ | 2129 | "required": [ |
| 1712 | "articleId", | 2130 | "articleId", |
| 1713 | "commentId", | 2131 | "commentId", |
| 1714 | - "-", | ||
| 1715 | "flag" | 2132 | "flag" |
| 1716 | ] | 2133 | ] |
| 1717 | }, | 2134 | }, |
| @@ -1873,6 +2290,13 @@ | @@ -1873,6 +2290,13 @@ | ||
| 1873 | "$ref": "#/definitions/Account" | 2290 | "$ref": "#/definitions/Account" |
| 1874 | }, | 2291 | }, |
| 1875 | "description": " 公司账号" | 2292 | "description": " 公司账号" |
| 2293 | + }, | ||
| 2294 | + "auths": { | ||
| 2295 | + "type": "array", | ||
| 2296 | + "items": { | ||
| 2297 | + "$ref": "#/definitions/Auth" | ||
| 2298 | + }, | ||
| 2299 | + "description": " 权限列表" | ||
| 1876 | } | 2300 | } |
| 1877 | }, | 2301 | }, |
| 1878 | "title": "MiniUserInfoResponse", | 2302 | "title": "MiniUserInfoResponse", |
| @@ -1881,7 +2305,8 @@ | @@ -1881,7 +2305,8 @@ | ||
| 1881 | "totalArticle", | 2305 | "totalArticle", |
| 1882 | "totalLoved", | 2306 | "totalLoved", |
| 1883 | "totalAccepted", | 2307 | "totalAccepted", |
| 1884 | - "accounts" | 2308 | + "accounts", |
| 2309 | + "auths" | ||
| 1885 | ] | 2310 | ] |
| 1886 | }, | 2311 | }, |
| 1887 | "MiniUserLikeArticleRequest": { | 2312 | "MiniUserLikeArticleRequest": { |
| @@ -1892,7 +2317,7 @@ | @@ -1892,7 +2317,7 @@ | ||
| 1892 | "format": "int64", | 2317 | "format": "int64", |
| 1893 | "description": " 文章id" | 2318 | "description": " 文章id" |
| 1894 | }, | 2319 | }, |
| 1895 | - "companyId": { | 2320 | + "": { |
| 1896 | "type": "integer", | 2321 | "type": "integer", |
| 1897 | "format": "int64", | 2322 | "format": "int64", |
| 1898 | "description": "公司id" | 2323 | "description": "公司id" |
| @@ -1911,7 +2336,6 @@ | @@ -1911,7 +2336,6 @@ | ||
| 1911 | "title": "MiniUserLikeArticleRequest", | 2336 | "title": "MiniUserLikeArticleRequest", |
| 1912 | "required": [ | 2337 | "required": [ |
| 1913 | "articleId", | 2338 | "articleId", |
| 1914 | - "-", | ||
| 1915 | "page", | 2339 | "page", |
| 1916 | "size" | 2340 | "size" |
| 1917 | ] | 2341 | ] |
| @@ -2017,6 +2441,53 @@ | @@ -2017,6 +2441,53 @@ | ||
| 2017 | "companyId" | 2441 | "companyId" |
| 2018 | ] | 2442 | ] |
| 2019 | }, | 2443 | }, |
| 2444 | + "MyLikeItem": { | ||
| 2445 | + "type": "object", | ||
| 2446 | + "properties": { | ||
| 2447 | + "userId": { | ||
| 2448 | + "type": "integer", | ||
| 2449 | + "format": "int64", | ||
| 2450 | + "description": " 发布人id" | ||
| 2451 | + }, | ||
| 2452 | + "articleId": { | ||
| 2453 | + "type": "integer", | ||
| 2454 | + "format": "int64", | ||
| 2455 | + "description": " 文章id" | ||
| 2456 | + }, | ||
| 2457 | + "commentId": { | ||
| 2458 | + "type": "integer", | ||
| 2459 | + "format": "int64", | ||
| 2460 | + "description": " 评论id" | ||
| 2461 | + }, | ||
| 2462 | + "createdAt": { | ||
| 2463 | + "type": "integer", | ||
| 2464 | + "format": "int64", | ||
| 2465 | + "description": " 创建时间" | ||
| 2466 | + }, | ||
| 2467 | + "user": { | ||
| 2468 | + "$ref": "#/definitions/SimpleUser", | ||
| 2469 | + "description": " 发布人" | ||
| 2470 | + }, | ||
| 2471 | + "article": { | ||
| 2472 | + "$ref": "#/definitions/SimpleArticle", | ||
| 2473 | + "description": " 文章" | ||
| 2474 | + }, | ||
| 2475 | + "comment": { | ||
| 2476 | + "$ref": "#/definitions/SimpleComment", | ||
| 2477 | + "description": " 评论" | ||
| 2478 | + } | ||
| 2479 | + }, | ||
| 2480 | + "title": "MyLikeItem", | ||
| 2481 | + "required": [ | ||
| 2482 | + "userId", | ||
| 2483 | + "articleId", | ||
| 2484 | + "commentId", | ||
| 2485 | + "createdAt", | ||
| 2486 | + "user", | ||
| 2487 | + "article", | ||
| 2488 | + "comment" | ||
| 2489 | + ] | ||
| 2490 | + }, | ||
| 2020 | "RoleDeleteRequest": { | 2491 | "RoleDeleteRequest": { |
| 2021 | "type": "object", | 2492 | "type": "object", |
| 2022 | "properties": { | 2493 | "properties": { |
| @@ -2118,11 +2589,13 @@ | @@ -2118,11 +2589,13 @@ | ||
| 2118 | }, | 2589 | }, |
| 2119 | "title": "RoleItem", | 2590 | "title": "RoleItem", |
| 2120 | "required": [ | 2591 | "required": [ |
| 2592 | + "companyId", | ||
| 2121 | "name", | 2593 | "name", |
| 2122 | "authIds", | 2594 | "authIds", |
| 2123 | "authsDesc", | 2595 | "authsDesc", |
| 2124 | "usersDesc", | 2596 | "usersDesc", |
| 2125 | "remark", | 2597 | "remark", |
| 2598 | + "users", | ||
| 2126 | "updatedAt" | 2599 | "updatedAt" |
| 2127 | ] | 2600 | ] |
| 2128 | }, | 2601 | }, |
| @@ -2232,6 +2705,10 @@ | @@ -2232,6 +2705,10 @@ | ||
| 2232 | "type": "string", | 2705 | "type": "string", |
| 2233 | "description": " 文章标题" | 2706 | "description": " 文章标题" |
| 2234 | }, | 2707 | }, |
| 2708 | + "summary": { | ||
| 2709 | + "type": "string", | ||
| 2710 | + "description": " 文章概要" | ||
| 2711 | + }, | ||
| 2235 | "countLove": { | 2712 | "countLove": { |
| 2236 | "type": "integer", | 2713 | "type": "integer", |
| 2237 | "format": "int32", | 2714 | "format": "int32", |
| @@ -2241,24 +2718,385 @@ | @@ -2241,24 +2718,385 @@ | ||
| 2241 | "type": "integer", | 2718 | "type": "integer", |
| 2242 | "format": "int32", | 2719 | "format": "int32", |
| 2243 | "description": " 评论数量" | 2720 | "description": " 评论数量" |
| 2721 | + }, | ||
| 2722 | + "show": { | ||
| 2723 | + "type": "integer", | ||
| 2724 | + "format": "int32", | ||
| 2725 | + "description": " 文章的展示状态(0显示、1不显示)" | ||
| 2244 | } | 2726 | } |
| 2245 | }, | 2727 | }, |
| 2246 | "title": "SimpleArticle", | 2728 | "title": "SimpleArticle", |
| 2247 | "required": [ | 2729 | "required": [ |
| 2248 | "id", | 2730 | "id", |
| 2249 | "title", | 2731 | "title", |
| 2732 | + "summary", | ||
| 2250 | "countLove", | 2733 | "countLove", |
| 2251 | - "countComment" | 2734 | + "countComment", |
| 2735 | + "show" | ||
| 2252 | ] | 2736 | ] |
| 2253 | }, | 2737 | }, |
| 2254 | - "TagCreateRequest": { | 2738 | + "SimpleComment": { |
| 2255 | "type": "object", | 2739 | "type": "object", |
| 2256 | "properties": { | 2740 | "properties": { |
| 2257 | - "companyId": { | 2741 | + "id": { |
| 2258 | "type": "integer", | 2742 | "type": "integer", |
| 2259 | "format": "int64" | 2743 | "format": "int64" |
| 2260 | }, | 2744 | }, |
| 2261 | - "image": { | 2745 | + "content": { |
| 2746 | + "type": "string", | ||
| 2747 | + "description": " 评论内容" | ||
| 2748 | + }, | ||
| 2749 | + "countLove": { | ||
| 2750 | + "type": "integer", | ||
| 2751 | + "format": "int32", | ||
| 2752 | + "description": " 点赞数量" | ||
| 2753 | + }, | ||
| 2754 | + "countComment": { | ||
| 2755 | + "type": "integer", | ||
| 2756 | + "format": "int32", | ||
| 2757 | + "description": " 评论数量" | ||
| 2758 | + }, | ||
| 2759 | + "show": { | ||
| 2760 | + "type": "integer", | ||
| 2761 | + "format": "int32", | ||
| 2762 | + "description": " 评论的展示状态(0显示、1不显示)" | ||
| 2763 | + } | ||
| 2764 | + }, | ||
| 2765 | + "title": "SimpleComment", | ||
| 2766 | + "required": [ | ||
| 2767 | + "id", | ||
| 2768 | + "content", | ||
| 2769 | + "countLove", | ||
| 2770 | + "countComment", | ||
| 2771 | + "show" | ||
| 2772 | + ] | ||
| 2773 | + }, | ||
| 2774 | + "SimpleUser": { | ||
| 2775 | + "type": "object", | ||
| 2776 | + "properties": { | ||
| 2777 | + "id": { | ||
| 2778 | + "type": "integer", | ||
| 2779 | + "format": "int64" | ||
| 2780 | + }, | ||
| 2781 | + "companyId": { | ||
| 2782 | + "type": "integer", | ||
| 2783 | + "format": "int64", | ||
| 2784 | + "description": " 公司ID" | ||
| 2785 | + }, | ||
| 2786 | + "companyName": { | ||
| 2787 | + "type": "string", | ||
| 2788 | + "description": " 公司名称" | ||
| 2789 | + }, | ||
| 2790 | + "name": { | ||
| 2791 | + "type": "string", | ||
| 2792 | + "description": " 名称" | ||
| 2793 | + }, | ||
| 2794 | + "avatar": { | ||
| 2795 | + "type": "string", | ||
| 2796 | + "description": " 头像" | ||
| 2797 | + }, | ||
| 2798 | + "position": { | ||
| 2799 | + "type": "string", | ||
| 2800 | + "description": " 职位" | ||
| 2801 | + } | ||
| 2802 | + }, | ||
| 2803 | + "title": "SimpleUser", | ||
| 2804 | + "required": [ | ||
| 2805 | + "id", | ||
| 2806 | + "companyId", | ||
| 2807 | + "companyName", | ||
| 2808 | + "name", | ||
| 2809 | + "avatar", | ||
| 2810 | + "position" | ||
| 2811 | + ] | ||
| 2812 | + }, | ||
| 2813 | + "SystemArticleGetRequest": { | ||
| 2814 | + "type": "object", | ||
| 2815 | + "properties": { | ||
| 2816 | + "id": { | ||
| 2817 | + "type": "integer", | ||
| 2818 | + "format": "int64", | ||
| 2819 | + "description": "id" | ||
| 2820 | + }, | ||
| 2821 | + "": { | ||
| 2822 | + "type": "integer", | ||
| 2823 | + "format": "int64" | ||
| 2824 | + } | ||
| 2825 | + }, | ||
| 2826 | + "title": "SystemArticleGetRequest", | ||
| 2827 | + "required": [ | ||
| 2828 | + "id" | ||
| 2829 | + ] | ||
| 2830 | + }, | ||
| 2831 | + "SystemArticleGetResponse": { | ||
| 2832 | + "type": "object", | ||
| 2833 | + "properties": { | ||
| 2834 | + "id": { | ||
| 2835 | + "type": "integer", | ||
| 2836 | + "format": "int64", | ||
| 2837 | + "description": " id" | ||
| 2838 | + }, | ||
| 2839 | + "title": { | ||
| 2840 | + "type": "string", | ||
| 2841 | + "description": " 标题" | ||
| 2842 | + }, | ||
| 2843 | + "authorId": { | ||
| 2844 | + "type": "integer", | ||
| 2845 | + "format": "int64", | ||
| 2846 | + "description": " 发布人id" | ||
| 2847 | + }, | ||
| 2848 | + "author": { | ||
| 2849 | + "$ref": "#/definitions/Author", | ||
| 2850 | + "description": " 发布人" | ||
| 2851 | + }, | ||
| 2852 | + "createdAt": { | ||
| 2853 | + "type": "integer", | ||
| 2854 | + "format": "int64", | ||
| 2855 | + "description": " 文章的发布时间" | ||
| 2856 | + }, | ||
| 2857 | + "section": { | ||
| 2858 | + "type": "array", | ||
| 2859 | + "items": { | ||
| 2860 | + "$ref": "#/definitions/ArticleSection" | ||
| 2861 | + }, | ||
| 2862 | + "description": " 文章的文本内容" | ||
| 2863 | + }, | ||
| 2864 | + "images": { | ||
| 2865 | + "type": "array", | ||
| 2866 | + "items": { | ||
| 2867 | + "type": "string" | ||
| 2868 | + }, | ||
| 2869 | + "description": " 图片" | ||
| 2870 | + }, | ||
| 2871 | + "whoRead": { | ||
| 2872 | + "type": "array", | ||
| 2873 | + "items": { | ||
| 2874 | + "type": "integer", | ||
| 2875 | + "format": "int64" | ||
| 2876 | + }, | ||
| 2877 | + "description": " 谁可查看" | ||
| 2878 | + }, | ||
| 2879 | + "whoReadInfo": { | ||
| 2880 | + "type": "array", | ||
| 2881 | + "items": { | ||
| 2882 | + "$ref": "#/definitions/UserShowName" | ||
| 2883 | + }, | ||
| 2884 | + "description": " 谁可查看" | ||
| 2885 | + }, | ||
| 2886 | + "whoReview": { | ||
| 2887 | + "type": "array", | ||
| 2888 | + "items": { | ||
| 2889 | + "type": "integer", | ||
| 2890 | + "format": "int64" | ||
| 2891 | + }, | ||
| 2892 | + "description": " 谁可评论" | ||
| 2893 | + }, | ||
| 2894 | + "whoReviewInfo": { | ||
| 2895 | + "type": "array", | ||
| 2896 | + "items": { | ||
| 2897 | + "$ref": "#/definitions/UserShowName" | ||
| 2898 | + }, | ||
| 2899 | + "description": " 谁可评论" | ||
| 2900 | + }, | ||
| 2901 | + "location": { | ||
| 2902 | + "$ref": "#/definitions/Location", | ||
| 2903 | + "description": " 定位坐标" | ||
| 2904 | + }, | ||
| 2905 | + "countLove": { | ||
| 2906 | + "type": "integer", | ||
| 2907 | + "format": "int32", | ||
| 2908 | + "description": " 点赞数量" | ||
| 2909 | + }, | ||
| 2910 | + "countComment": { | ||
| 2911 | + "type": "integer", | ||
| 2912 | + "format": "int32", | ||
| 2913 | + "description": " 评论数量" | ||
| 2914 | + }, | ||
| 2915 | + "countRead": { | ||
| 2916 | + "type": "integer", | ||
| 2917 | + "format": "int32", | ||
| 2918 | + "description": " 浏览数量" | ||
| 2919 | + }, | ||
| 2920 | + "show": { | ||
| 2921 | + "type": "integer", | ||
| 2922 | + "format": "int32", | ||
| 2923 | + "description": " 评论的展示状态(0显示、1不显示)" | ||
| 2924 | + } | ||
| 2925 | + }, | ||
| 2926 | + "title": "SystemArticleGetResponse", | ||
| 2927 | + "required": [ | ||
| 2928 | + "id", | ||
| 2929 | + "title", | ||
| 2930 | + "authorId", | ||
| 2931 | + "author", | ||
| 2932 | + "createdAt", | ||
| 2933 | + "section", | ||
| 2934 | + "images", | ||
| 2935 | + "whoRead", | ||
| 2936 | + "whoReadInfo", | ||
| 2937 | + "whoReview", | ||
| 2938 | + "whoReviewInfo", | ||
| 2939 | + "location", | ||
| 2940 | + "countLove", | ||
| 2941 | + "countComment", | ||
| 2942 | + "countRead", | ||
| 2943 | + "show" | ||
| 2944 | + ] | ||
| 2945 | + }, | ||
| 2946 | + "SystemArticleSearch": { | ||
| 2947 | + "type": "object", | ||
| 2948 | + "properties": { | ||
| 2949 | + "id": { | ||
| 2950 | + "type": "integer", | ||
| 2951 | + "format": "int64", | ||
| 2952 | + "description": "id" | ||
| 2953 | + }, | ||
| 2954 | + "title": { | ||
| 2955 | + "type": "string", | ||
| 2956 | + "description": "标题" | ||
| 2957 | + }, | ||
| 2958 | + "author": { | ||
| 2959 | + "type": "string", | ||
| 2960 | + "description": "发布人" | ||
| 2961 | + }, | ||
| 2962 | + "images": { | ||
| 2963 | + "type": "array", | ||
| 2964 | + "items": { | ||
| 2965 | + "type": "string" | ||
| 2966 | + }, | ||
| 2967 | + "description": "图片" | ||
| 2968 | + }, | ||
| 2969 | + "createdAt": { | ||
| 2970 | + "type": "integer", | ||
| 2971 | + "format": "int64", | ||
| 2972 | + "description": "文章的创建日期" | ||
| 2973 | + }, | ||
| 2974 | + "countLove": { | ||
| 2975 | + "type": "integer", | ||
| 2976 | + "format": "int32", | ||
| 2977 | + "description": "点赞数量" | ||
| 2978 | + }, | ||
| 2979 | + "CountComment": { | ||
| 2980 | + "type": "integer", | ||
| 2981 | + "format": "int32", | ||
| 2982 | + "description": "评论数量" | ||
| 2983 | + }, | ||
| 2984 | + "show": { | ||
| 2985 | + "type": "integer", | ||
| 2986 | + "format": "int32", | ||
| 2987 | + "description": "是否隐藏 [0显示、1不显示]" | ||
| 2988 | + }, | ||
| 2989 | + "tags": { | ||
| 2990 | + "type": "array", | ||
| 2991 | + "items": { | ||
| 2992 | + "type": "string" | ||
| 2993 | + }, | ||
| 2994 | + "description": "标签" | ||
| 2995 | + }, | ||
| 2996 | + "targetUser": { | ||
| 2997 | + "type": "integer", | ||
| 2998 | + "format": "int32", | ||
| 2999 | + "description": "分发方式 [0分发给所有人、1分发给指定的人]" | ||
| 3000 | + } | ||
| 3001 | + }, | ||
| 3002 | + "title": "SystemArticleSearch", | ||
| 3003 | + "required": [ | ||
| 3004 | + "id", | ||
| 3005 | + "title", | ||
| 3006 | + "author", | ||
| 3007 | + "images", | ||
| 3008 | + "createdAt", | ||
| 3009 | + "countLove", | ||
| 3010 | + "CountComment", | ||
| 3011 | + "show", | ||
| 3012 | + "tags", | ||
| 3013 | + "targetUser" | ||
| 3014 | + ] | ||
| 3015 | + }, | ||
| 3016 | + "SystemArticleSearchRequest": { | ||
| 3017 | + "type": "object", | ||
| 3018 | + "properties": { | ||
| 3019 | + "": { | ||
| 3020 | + "type": "integer", | ||
| 3021 | + "format": "int64" | ||
| 3022 | + }, | ||
| 3023 | + "page": { | ||
| 3024 | + "type": "integer", | ||
| 3025 | + "format": "int32" | ||
| 3026 | + }, | ||
| 3027 | + "size": { | ||
| 3028 | + "type": "integer", | ||
| 3029 | + "format": "int32" | ||
| 3030 | + } | ||
| 3031 | + }, | ||
| 3032 | + "title": "SystemArticleSearchRequest", | ||
| 3033 | + "required": [ | ||
| 3034 | + "page", | ||
| 3035 | + "size" | ||
| 3036 | + ] | ||
| 3037 | + }, | ||
| 3038 | + "SystemArticleSearchResponse": { | ||
| 3039 | + "type": "object", | ||
| 3040 | + "properties": { | ||
| 3041 | + "total": { | ||
| 3042 | + "type": "integer", | ||
| 3043 | + "format": "int32" | ||
| 3044 | + }, | ||
| 3045 | + "list": { | ||
| 3046 | + "type": "array", | ||
| 3047 | + "items": { | ||
| 3048 | + "$ref": "#/definitions/SystemArticleSearch" | ||
| 3049 | + } | ||
| 3050 | + } | ||
| 3051 | + }, | ||
| 3052 | + "title": "SystemArticleSearchResponse", | ||
| 3053 | + "required": [ | ||
| 3054 | + "total", | ||
| 3055 | + "list" | ||
| 3056 | + ] | ||
| 3057 | + }, | ||
| 3058 | + "SystemUserInfoRequest": { | ||
| 3059 | + "type": "object", | ||
| 3060 | + "title": "SystemUserInfoRequest" | ||
| 3061 | + }, | ||
| 3062 | + "SystemUserInfoResponse": { | ||
| 3063 | + "type": "object", | ||
| 3064 | + "properties": { | ||
| 3065 | + "userId": { | ||
| 3066 | + "type": "integer", | ||
| 3067 | + "format": "int64" | ||
| 3068 | + }, | ||
| 3069 | + "userName": { | ||
| 3070 | + "type": "string" | ||
| 3071 | + }, | ||
| 3072 | + "avatar": { | ||
| 3073 | + "type": "string" | ||
| 3074 | + }, | ||
| 3075 | + "companyId": { | ||
| 3076 | + "type": "integer", | ||
| 3077 | + "format": "int64" | ||
| 3078 | + }, | ||
| 3079 | + "companyName": { | ||
| 3080 | + "type": "string" | ||
| 3081 | + } | ||
| 3082 | + }, | ||
| 3083 | + "title": "SystemUserInfoResponse", | ||
| 3084 | + "required": [ | ||
| 3085 | + "userId", | ||
| 3086 | + "userName", | ||
| 3087 | + "avatar", | ||
| 3088 | + "companyId", | ||
| 3089 | + "companyName" | ||
| 3090 | + ] | ||
| 3091 | + }, | ||
| 3092 | + "TagCreateRequest": { | ||
| 3093 | + "type": "object", | ||
| 3094 | + "properties": { | ||
| 3095 | + "companyId": { | ||
| 3096 | + "type": "integer", | ||
| 3097 | + "format": "int64" | ||
| 3098 | + }, | ||
| 3099 | + "image": { | ||
| 2262 | "type": "string" | 3100 | "type": "string" |
| 2263 | }, | 3101 | }, |
| 2264 | "name": { | 3102 | "name": { |
| @@ -2514,45 +3352,6 @@ | @@ -2514,45 +3352,6 @@ | ||
| 2514 | "list" | 3352 | "list" |
| 2515 | ] | 3353 | ] |
| 2516 | }, | 3354 | }, |
| 2517 | - "User": { | ||
| 2518 | - "type": "object", | ||
| 2519 | - "properties": { | ||
| 2520 | - "id": { | ||
| 2521 | - "type": "integer", | ||
| 2522 | - "format": "int64" | ||
| 2523 | - }, | ||
| 2524 | - "companyId": { | ||
| 2525 | - "type": "integer", | ||
| 2526 | - "format": "int64", | ||
| 2527 | - "description": " 公司ID" | ||
| 2528 | - }, | ||
| 2529 | - "companyName": { | ||
| 2530 | - "type": "string", | ||
| 2531 | - "description": " 公司名称" | ||
| 2532 | - }, | ||
| 2533 | - "name": { | ||
| 2534 | - "type": "string", | ||
| 2535 | - "description": " 名称" | ||
| 2536 | - }, | ||
| 2537 | - "avatar": { | ||
| 2538 | - "type": "string", | ||
| 2539 | - "description": " 头像" | ||
| 2540 | - }, | ||
| 2541 | - "position": { | ||
| 2542 | - "type": "string", | ||
| 2543 | - "description": " 职位" | ||
| 2544 | - } | ||
| 2545 | - }, | ||
| 2546 | - "title": "User", | ||
| 2547 | - "required": [ | ||
| 2548 | - "id", | ||
| 2549 | - "companyId", | ||
| 2550 | - "companyName", | ||
| 2551 | - "name", | ||
| 2552 | - "avatar", | ||
| 2553 | - "position" | ||
| 2554 | - ] | ||
| 2555 | - }, | ||
| 2556 | "UserFollowItem": { | 3355 | "UserFollowItem": { |
| 2557 | "type": "object", | 3356 | "type": "object", |
| 2558 | "properties": { | 3357 | "properties": { |
| @@ -2731,6 +3530,24 @@ | @@ -2731,6 +3530,24 @@ | ||
| 2731 | "total" | 3530 | "total" |
| 2732 | ] | 3531 | ] |
| 2733 | }, | 3532 | }, |
| 3533 | + "UserShowName": { | ||
| 3534 | + "type": "object", | ||
| 3535 | + "properties": { | ||
| 3536 | + "id": { | ||
| 3537 | + "type": "integer", | ||
| 3538 | + "format": "int32" | ||
| 3539 | + }, | ||
| 3540 | + "name": { | ||
| 3541 | + "type": "integer", | ||
| 3542 | + "format": "int32" | ||
| 3543 | + } | ||
| 3544 | + }, | ||
| 3545 | + "title": "UserShowName", | ||
| 3546 | + "required": [ | ||
| 3547 | + "id", | ||
| 3548 | + "name" | ||
| 3549 | + ] | ||
| 3550 | + }, | ||
| 2734 | "WhichUserLikeArticle": { | 3551 | "WhichUserLikeArticle": { |
| 2735 | "type": "object", | 3552 | "type": "object", |
| 2736 | "properties": { | 3553 | "properties": { |
| 1 | syntax = "v1" | 1 | syntax = "v1" |
| 2 | 2 | ||
| 3 | -import "article_type.api" | ||
| 4 | - | ||
| 5 | info( | 3 | info( |
| 6 | title: "文章内容处理" | 4 | title: "文章内容处理" |
| 7 | desc: "编辑处理文章内容" | 5 | desc: "编辑处理文章内容" |
| @@ -42,6 +40,10 @@ service Core { | @@ -42,6 +40,10 @@ service Core { | ||
| 42 | @handler MiniArticleSearchMe | 40 | @handler MiniArticleSearchMe |
| 43 | post /article/search/me (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse) | 41 | post /article/search/me (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse) |
| 44 | 42 | ||
| 43 | + @doc "小程序创建文章进草稿箱" | ||
| 44 | + @handler MiniCreateArticleDraft | ||
| 45 | + post /article_draft (MiniArticleSearchMeRequest) returns (MiniArticleSearchMeResponse) | ||
| 46 | + | ||
| 45 | @doc "小程序获取文章的编辑记录" | 47 | @doc "小程序获取文章的编辑记录" |
| 46 | @handler MiniArticleBackupSearch | 48 | @handler MiniArticleBackupSearch |
| 47 | post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse) | 49 | post /article_backup/search (MiniArticleBackupSearchRequest) returns (MiniArticleBackupSearchResponse) |
| @@ -147,7 +147,7 @@ type ( | @@ -147,7 +147,7 @@ type ( | ||
| 147 | Location Location `json:"location"` | 147 | Location Location `json:"location"` |
| 148 | } | 148 | } |
| 149 | ) | 149 | ) |
| 150 | - | 150 | +// 标记人员浏览了那个文章 |
| 151 | type ( | 151 | type ( |
| 152 | MiniArticleMarkUserReadRequest { | 152 | MiniArticleMarkUserReadRequest { |
| 153 | UserId int64 `json:",optional"` // 当前操作人 | 153 | UserId int64 `json:",optional"` // 当前操作人 |
| @@ -160,6 +160,18 @@ type ( | @@ -160,6 +160,18 @@ type ( | ||
| 160 | } | 160 | } |
| 161 | ) | 161 | ) |
| 162 | 162 | ||
| 163 | +//保存文章到草稿箱 | ||
| 164 | +type ( | ||
| 165 | + MiniArticleDraftCreateRequest { | ||
| 166 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 167 | + Content []string `json:"content"` // 填写的内容 | ||
| 168 | + Title string `json:"title"` //标题 | ||
| 169 | + Images []string `json:"images"` //图片 | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + MiniArticleDraftCreateResponse struct{} | ||
| 173 | +) | ||
| 174 | + | ||
| 163 | type ( | 175 | type ( |
| 164 | MiniArticleMarkListRequest { | 176 | MiniArticleMarkListRequest { |
| 165 | Page int `json:"page"` | 177 | Page int `json:"page"` |
| @@ -14,7 +14,7 @@ info( | @@ -14,7 +14,7 @@ info( | ||
| 14 | group: company | 14 | group: company |
| 15 | ) | 15 | ) |
| 16 | service Core { | 16 | service Core { |
| 17 | - @doc "公司搜索" | 17 | + @doc "公司搜索(公开的)" |
| 18 | @handler miniCompanySearch | 18 | @handler miniCompanySearch |
| 19 | post /mini/company/search(CompanySearchRequest) returns (CompanySearchResponse) | 19 | post /mini/company/search(CompanySearchRequest) returns (CompanySearchResponse) |
| 20 | } | 20 | } |
| @@ -23,6 +23,18 @@ service Core { | @@ -23,6 +23,18 @@ service Core { | ||
| 23 | @server( | 23 | @server( |
| 24 | prefix: v1 | 24 | prefix: v1 |
| 25 | group: company | 25 | group: company |
| 26 | + jwt : MiniAuth | ||
| 27 | +) | ||
| 28 | +service Core { | ||
| 29 | + @doc "搜索已加入的公司" | ||
| 30 | + @handler miniCompanySearchJoined | ||
| 31 | + post /mini/company/search-joined(CompanySearchRequest) returns (CompanySearchResponse) | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +// 小程序接口 | ||
| 35 | +@server( | ||
| 36 | + prefix: v1 | ||
| 37 | + group: company | ||
| 26 | jwt : SystemAuth | 38 | jwt : SystemAuth |
| 27 | ) | 39 | ) |
| 28 | service Core { | 40 | service Core { |
| @@ -33,9 +45,10 @@ service Core { | @@ -33,9 +45,10 @@ service Core { | ||
| 33 | 45 | ||
| 34 | type ( | 46 | type ( |
| 35 | CompanySearchRequest struct{ | 47 | CompanySearchRequest struct{ |
| 36 | - Page int `json:"page"` | ||
| 37 | - Size int `json:"size"` | ||
| 38 | - UserId int64 `json:"userId,optional"` // 按用户搜索 | 48 | + Page int `json:"page,optional"` |
| 49 | + Size int `json:"size,optional"` | ||
| 50 | + Flag int `json:"flag,optional"` // 1:用户已加入的 2:用户未加入的公司 | ||
| 51 | + UserId int64 `json:"userId,optional"` // 按用户搜索(用户所加入的企业) | ||
| 39 | Code string `json:"code,optional"` // 按编码搜索 | 52 | Code string `json:"code,optional"` // 按编码搜索 |
| 40 | } | 53 | } |
| 41 | CompanySearchResponse{ | 54 | CompanySearchResponse{ |
| @@ -206,13 +206,26 @@ type ( | @@ -206,13 +206,26 @@ type ( | ||
| 206 | 206 | ||
| 207 | 207 | ||
| 208 | // 后台接口 | 208 | // 后台接口 |
| 209 | -//@server( | ||
| 210 | -// prefix: v1 | ||
| 211 | -// group: user | ||
| 212 | -// jwt: SystemAuth | ||
| 213 | -//) | ||
| 214 | -//service Core { | ||
| 215 | -// @doc "系统评论" | ||
| 216 | -// @handler systemUser | ||
| 217 | -// get /system/user () returns () | ||
| 218 | -//} | ||
| 209 | +@server( | ||
| 210 | + prefix: v1 | ||
| 211 | + group: user | ||
| 212 | + jwt: SystemAuth | ||
| 213 | +) | ||
| 214 | +service Core { | ||
| 215 | + @doc "系统用户信息" | ||
| 216 | + @handler systemUserInfo | ||
| 217 | + post /system/user/info(SystemUserInfoRequest) returns (SystemUserInfoResponse) | ||
| 218 | +} | ||
| 219 | + | ||
| 220 | +type( | ||
| 221 | + SystemUserInfoRequest{ | ||
| 222 | + | ||
| 223 | + } | ||
| 224 | + SystemUserInfoResponse{ | ||
| 225 | + UserId int64 `json:"userId"` | ||
| 226 | + UserName string `json:"userName"` | ||
| 227 | + Avatar string `json:"avatar"` | ||
| 228 | + CompanyId int64 `json:"companyId"` | ||
| 229 | + CompanyName string `json:"companyName"` | ||
| 230 | + } | ||
| 231 | +) |
| 1 | +package article | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "net/http" | ||
| 5 | + | ||
| 6 | + "github.com/zeromicro/go-zero/rest/httpx" | ||
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/article" | ||
| 8 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
| 9 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
| 10 | +) | ||
| 11 | + | ||
| 12 | +func MiniCreateArticleDraftHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
| 13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
| 14 | + var req types.MiniArticleSearchMeRequest | ||
| 15 | + if err := httpx.Parse(r, &req); err != nil { | ||
| 16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
| 17 | + return | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + l := article.NewMiniCreateArticleDraftLogic(r.Context(), svcCtx) | ||
| 21 | + resp, err := l.MiniCreateArticleDraft(&req) | ||
| 22 | + if err != nil { | ||
| 23 | + httpx.ErrorCtx(r.Context(), w, err) | ||
| 24 | + } else { | ||
| 25 | + httpx.OkJsonCtx(r.Context(), w, resp) | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | +} |
| 1 | +package company | ||
| 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/company" | ||
| 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 MiniCompanySearchJoinedHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
| 14 | + return func(w http.ResponseWriter, r *http.Request) { | ||
| 15 | + var req types.CompanySearchRequest | ||
| 16 | + if err := httpx.Parse(r, &req); err != nil { | ||
| 17 | + httpx.ErrorCtx(r.Context(), w, err) | ||
| 18 | + return | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + l := company.NewMiniCompanySearchJoinedLogic(r.Context(), svcCtx) | ||
| 22 | + resp, err := l.MiniCompanySearchJoined(&req) | ||
| 23 | + result.HttpResult(r, w, resp, err) | ||
| 24 | + } | ||
| 25 | +} |
| @@ -167,6 +167,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -167,6 +167,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
| 167 | []rest.Route{ | 167 | []rest.Route{ |
| 168 | { | 168 | { |
| 169 | Method: http.MethodPost, | 169 | Method: http.MethodPost, |
| 170 | + Path: "/system/user/info", | ||
| 171 | + Handler: user.SystemUserInfoHandler(serverCtx), | ||
| 172 | + }, | ||
| 173 | + }, | ||
| 174 | + rest.WithJwt(serverCtx.Config.SystemAuth.AccessSecret), | ||
| 175 | + rest.WithPrefix("/v1"), | ||
| 176 | + ) | ||
| 177 | + | ||
| 178 | + server.AddRoutes( | ||
| 179 | + []rest.Route{ | ||
| 180 | + { | ||
| 181 | + Method: http.MethodPost, | ||
| 170 | Path: "/mini/company/search", | 182 | Path: "/mini/company/search", |
| 171 | Handler: company.MiniCompanySearchHandler(serverCtx), | 183 | Handler: company.MiniCompanySearchHandler(serverCtx), |
| 172 | }, | 184 | }, |
| @@ -178,6 +190,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -178,6 +190,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
| 178 | []rest.Route{ | 190 | []rest.Route{ |
| 179 | { | 191 | { |
| 180 | Method: http.MethodPost, | 192 | Method: http.MethodPost, |
| 193 | + Path: "/mini/company/search-joined", | ||
| 194 | + Handler: company.MiniCompanySearchJoinedHandler(serverCtx), | ||
| 195 | + }, | ||
| 196 | + }, | ||
| 197 | + rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), | ||
| 198 | + rest.WithPrefix("/v1"), | ||
| 199 | + ) | ||
| 200 | + | ||
| 201 | + server.AddRoutes( | ||
| 202 | + []rest.Route{ | ||
| 203 | + { | ||
| 204 | + Method: http.MethodPost, | ||
| 181 | Path: "/system/company/search", | 205 | Path: "/system/company/search", |
| 182 | Handler: company.SystemCompanySearchHandler(serverCtx), | 206 | Handler: company.SystemCompanySearchHandler(serverCtx), |
| 183 | }, | 207 | }, |
| @@ -225,6 +249,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | @@ -225,6 +249,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||
| 225 | }, | 249 | }, |
| 226 | { | 250 | { |
| 227 | Method: http.MethodPost, | 251 | Method: http.MethodPost, |
| 252 | + Path: "/article_draft", | ||
| 253 | + Handler: article.MiniCreateArticleDraftHandler(serverCtx), | ||
| 254 | + }, | ||
| 255 | + { | ||
| 256 | + Method: http.MethodPost, | ||
| 228 | Path: "/article_backup/search", | 257 | Path: "/article_backup/search", |
| 229 | Handler: article.MiniArticleBackupSearchHandler(serverCtx), | 258 | Handler: article.MiniArticleBackupSearchHandler(serverCtx), |
| 230 | }, | 259 | }, |
| 1 | +package user | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "net/http" | ||
| 5 | + | ||
| 6 | + "github.com/zeromicro/go-zero/rest/httpx" | ||
| 7 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/user" | ||
| 8 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | ||
| 9 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" | ||
| 10 | +) | ||
| 11 | + | ||
| 12 | +func SystemUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | ||
| 13 | + return func(w http.ResponseWriter, r *http.Request) { | ||
| 14 | + var req types.SystemUserInfoRequest | ||
| 15 | + if err := httpx.Parse(r, &req); err != nil { | ||
| 16 | + httpx.ErrorCtx(r.Context(), w, err) | ||
| 17 | + return | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + l := user.NewSystemUserInfoLogic(r.Context(), svcCtx) | ||
| 21 | + resp, err := l.SystemUserInfo(&req) | ||
| 22 | + if err != nil { | ||
| 23 | + httpx.ErrorCtx(r.Context(), w, err) | ||
| 24 | + } else { | ||
| 25 | + httpx.OkJsonCtx(r.Context(), w, resp) | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | +} |
| 1 | +package article | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "context" | ||
| 5 | + | ||
| 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 | + | ||
| 9 | + "github.com/zeromicro/go-zero/core/logx" | ||
| 10 | +) | ||
| 11 | + | ||
| 12 | +type MiniCreateArticleDraftLogic struct { | ||
| 13 | + logx.Logger | ||
| 14 | + ctx context.Context | ||
| 15 | + svcCtx *svc.ServiceContext | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +func NewMiniCreateArticleDraftLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniCreateArticleDraftLogic { | ||
| 19 | + return &MiniCreateArticleDraftLogic{ | ||
| 20 | + Logger: logx.WithContext(ctx), | ||
| 21 | + ctx: ctx, | ||
| 22 | + svcCtx: svcCtx, | ||
| 23 | + } | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +func (l *MiniCreateArticleDraftLogic) MiniCreateArticleDraft(req *types.MiniArticleSearchMeRequest) (resp *types.MiniArticleSearchMeResponse, err error) { | ||
| 27 | + // todo: add your logic here and delete this line | ||
| 28 | + | ||
| 29 | + return | ||
| 30 | +} |
| 1 | +package company | ||
| 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 MiniCompanySearchJoinedLogic struct { | ||
| 17 | + logx.Logger | ||
| 18 | + ctx context.Context | ||
| 19 | + svcCtx *svc.ServiceContext | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +func NewMiniCompanySearchJoinedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniCompanySearchJoinedLogic { | ||
| 23 | + return &MiniCompanySearchJoinedLogic{ | ||
| 24 | + Logger: logx.WithContext(ctx), | ||
| 25 | + ctx: ctx, | ||
| 26 | + svcCtx: svcCtx, | ||
| 27 | + } | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +func (l *MiniCompanySearchJoinedLogic) MiniCompanySearchJoined(req *types.CompanySearchRequest) (resp *types.CompanySearchResponse, err error) { | ||
| 31 | + var ( | ||
| 32 | + conn = l.svcCtx.DefaultDBConn() | ||
| 33 | + companyList []*domain.Company | ||
| 34 | + total int64 | ||
| 35 | + userToken = contextdata.GetUserTokenFromCtx(l.ctx) | ||
| 36 | + user *domain.User | ||
| 37 | + companyIds []int64 | ||
| 38 | + ) | ||
| 39 | + queryOptions := domain.NewQueryOptions() | ||
| 40 | + if req.Page != 0 { | ||
| 41 | + queryOptions.WithOffsetLimit(req.Page, req.Size) | ||
| 42 | + } | ||
| 43 | + user, err = l.svcCtx.UserRepository.FindOne(l.ctx, conn, userToken.UserId) | ||
| 44 | + if err != nil { | ||
| 45 | + return nil, xerr.NewErrMsgErr("账号有误", err) | ||
| 46 | + } | ||
| 47 | + resp = &types.CompanySearchResponse{ | ||
| 48 | + List: make([]types.Company, 0), | ||
| 49 | + } | ||
| 50 | + _, users, _ := l.svcCtx.UserRepository.Find(l.ctx, conn, domain.NewQueryOptions(). | ||
| 51 | + MustWithKV("phone", user.Phone). | ||
| 52 | + MustWithKV("auditStatus", []int{domain.UserAuditStatusPassed}). | ||
| 53 | + WithFindOnly()) | ||
| 54 | + lo.ForEach(users, func(item *domain.User, index int) { | ||
| 55 | + companyIds = append(companyIds, item.CompanyId) | ||
| 56 | + }) | ||
| 57 | + if req.Flag == 1 { | ||
| 58 | + total, companyList, err = l.svcCtx.CompanyRepository.Find(l.ctx, conn, queryOptions.MustWithKV("ids", companyIds)) | ||
| 59 | + if err != nil { | ||
| 60 | + return nil, xerr.NewErrMsgErr("公司列表获取失败", err) | ||
| 61 | + } | ||
| 62 | + } else { | ||
| 63 | + total, companyList, err = l.svcCtx.CompanyRepository.Find(l.ctx, conn, queryOptions.MustWithKV("excludeIds", companyIds)) | ||
| 64 | + if err != nil { | ||
| 65 | + return nil, xerr.NewErrMsgErr("公司列表获取失败", err) | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | + lo.ForEach(companyList, func(item *domain.Company, index int) { | ||
| 69 | + resp.List = append(resp.List, NewCompany(item)) | ||
| 70 | + }) | ||
| 71 | + resp.Total = total | ||
| 72 | + return | ||
| 73 | +} |
| @@ -2,9 +2,11 @@ package company | @@ -2,9 +2,11 @@ package company | ||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "context" | 4 | "context" |
| 5 | - | 5 | + "github.com/samber/lo" |
| 6 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" | 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" | 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 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr" | ||
| 8 | 10 | ||
| 9 | "github.com/zeromicro/go-zero/core/logx" | 11 | "github.com/zeromicro/go-zero/core/logx" |
| 10 | ) | 12 | ) |
| @@ -24,7 +26,37 @@ func NewMiniCompanySearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) | @@ -24,7 +26,37 @@ func NewMiniCompanySearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) | ||
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | func (l *MiniCompanySearchLogic) MiniCompanySearch(req *types.CompanySearchRequest) (resp *types.CompanySearchResponse, err error) { | 28 | func (l *MiniCompanySearchLogic) MiniCompanySearch(req *types.CompanySearchRequest) (resp *types.CompanySearchResponse, err error) { |
| 27 | - // todo: add your logic here and delete this line | ||
| 28 | - | 29 | + var ( |
| 30 | + conn = l.svcCtx.DefaultDBConn() | ||
| 31 | + companyList []*domain.Company | ||
| 32 | + total int64 | ||
| 33 | + ) | ||
| 34 | + queryOptions := domain.NewQueryOptions() | ||
| 35 | + if req.Page != 0 { | ||
| 36 | + queryOptions.WithOffsetLimit(req.Page, req.Size) | ||
| 37 | + } | ||
| 38 | + if req.Code != "" { | ||
| 39 | + queryOptions.WithKV("code", req.Code) | ||
| 40 | + } | ||
| 41 | + total, companyList, err = l.svcCtx.CompanyRepository.Find(l.ctx, conn, queryOptions) | ||
| 42 | + if err != nil { | ||
| 43 | + return nil, xerr.NewErrMsgErr("公司列表获取失败", err) | ||
| 44 | + } | ||
| 45 | + resp = &types.CompanySearchResponse{ | ||
| 46 | + Total: total, | ||
| 47 | + List: make([]types.Company, 0), | ||
| 48 | + } | ||
| 49 | + lo.ForEach(companyList, func(item *domain.Company, index int) { | ||
| 50 | + resp.List = append(resp.List, NewCompany(item)) | ||
| 51 | + }) | ||
| 29 | return | 52 | return |
| 30 | } | 53 | } |
| 54 | + | ||
| 55 | +func NewCompany(item *domain.Company) types.Company { | ||
| 56 | + return types.Company{ | ||
| 57 | + Id: item.Id, | ||
| 58 | + Name: item.Name, | ||
| 59 | + Code: item.Code, | ||
| 60 | + Logo: item.Logo, | ||
| 61 | + } | ||
| 62 | +} |
| 1 | +package user | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "context" | ||
| 5 | + | ||
| 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 | + | ||
| 9 | + "github.com/zeromicro/go-zero/core/logx" | ||
| 10 | +) | ||
| 11 | + | ||
| 12 | +type SystemUserInfoLogic struct { | ||
| 13 | + logx.Logger | ||
| 14 | + ctx context.Context | ||
| 15 | + svcCtx *svc.ServiceContext | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +func NewSystemUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SystemUserInfoLogic { | ||
| 19 | + return &SystemUserInfoLogic{ | ||
| 20 | + Logger: logx.WithContext(ctx), | ||
| 21 | + ctx: ctx, | ||
| 22 | + svcCtx: svcCtx, | ||
| 23 | + } | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +func (l *SystemUserInfoLogic) SystemUserInfo(req *types.SystemUserInfoRequest) (resp *types.SystemUserInfoResponse, err error) { | ||
| 27 | + // todo: add your logic here and delete this line | ||
| 28 | + | ||
| 29 | + return | ||
| 30 | +} |
| 1 | // Code generated by goctl. DO NOT EDIT. | 1 | // Code generated by goctl. DO NOT EDIT. |
| 2 | package types | 2 | package types |
| 3 | 3 | ||
| 4 | +type Location struct { | ||
| 5 | + Longitude float64 `json:"longitude,optional"` //经度 | ||
| 6 | + Latitude float64 `json:"latitude,optional"` //纬度 | ||
| 7 | + Descript string `json:"descript,optional"` //地点描述 | ||
| 8 | +} | ||
| 9 | + | ||
| 10 | +type Author struct { | ||
| 11 | + Id int64 `json:"id"` // 人员id | ||
| 12 | + Name string `json:"name"` // 人员的名字 | ||
| 13 | + Avatar string `json:"avatar"` // 人员头像URL | ||
| 14 | + Group string `json:"group"` // 人员的分组 | ||
| 15 | + Position string `json:"position"` // 职位 | ||
| 16 | + Company string `json:"company"` // 公司 | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +type MiniArticleCreateRequest struct { | ||
| 20 | + Title string `json:"title"` //标题 | ||
| 21 | + Section []string `json:"section"` //文章的文本内容 | ||
| 22 | + AuthorId int64 `json:"authorId,optional"` //发布人id | ||
| 23 | + Images []string `json:"images,optional"` //图片 | ||
| 24 | + WhoRead []int64 `json:"whoRead,optional"` //谁可查看 | ||
| 25 | + WhoReview []int64 `json:"whoReview,optional"` //谁可评论 | ||
| 26 | + Location Location `json:"location,optional"` //定位坐标 | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +type MiniArticleCreateResponse struct { | ||
| 30 | + Id int64 `json:"id"` | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +type MiniArticleGetRequest struct { | ||
| 34 | + Id int64 `path:"id"` //id | ||
| 35 | + CompanyId int64 `path:",optional"` | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +type MiniArticleGetResponse struct { | ||
| 39 | + Id int64 `json:"id"` //id | ||
| 40 | + Title string `json:"title"` //标题 | ||
| 41 | + AuthorId int64 `json:"authorId"` //发布人id | ||
| 42 | + Author Author `json:"author"` //发布人 | ||
| 43 | + CreatedAt int64 `json:"createdAt"` //文章的发布时间 | ||
| 44 | + Section []ArticleSection `json:"section"` //文章的文本内容 | ||
| 45 | + Images []string `json:"images"` //图片 | ||
| 46 | + WhoRead []int64 `json:"whoRead"` //谁可查看 | ||
| 47 | + WhoReview []int64 `json:"whoReview"` //谁可评论 | ||
| 48 | + Location Location `json:"location"` //定位坐标 | ||
| 49 | + CountLove int `json:"countLove"` // 点赞数量 | ||
| 50 | + CountComment int `json:"countComment"` // 评论数量 | ||
| 51 | + CountRead int `json:"countRead"` // 浏览数量 | ||
| 52 | + Show int `json:"show"` // 评论的展示状态(0显示、1不显示) | ||
| 53 | + Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在) | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +type ArticleSection struct { | ||
| 57 | + Id int64 `json:"id"` //段落id | ||
| 58 | + Content string `json:"content"` // 文本内容 | ||
| 59 | + SortBy int `json:"sortBy"` // 排序 | ||
| 60 | + TotalComment int `json:"totalComment"` // 评论的数量 | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +type MiniArticleSearchMeRequest struct { | ||
| 64 | + AuthorId int64 `json:",optional"` | ||
| 65 | + CompanyId int64 `json:",optional"` | ||
| 66 | + Page int `json:"page"` | ||
| 67 | + Size int `json:"size"` | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +type MiniArticleSearchMeResponse struct { | ||
| 71 | + Total int `json:"total"` | ||
| 72 | + List []ArticleSearchMe `json:"list"` | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +type ArticleSearchMe struct { | ||
| 76 | + Id int64 `json:"id"` //id | ||
| 77 | + Title string `json:"title"` //标题 | ||
| 78 | + Images []string `json:"images"` //图片 | ||
| 79 | + CreatedAt int64 `json:"createdAt"` //文章的创建日期 | ||
| 80 | + CountLove int `json:"countLove"` //点赞数量 | ||
| 81 | + CountComment int `json:"CountComment"` //评论数量 | ||
| 82 | + Show int `json:"show"` //是否隐藏 [0显示、1不显示] | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +type MiniUserLikeArticleRequest struct { | ||
| 86 | + ArticleId int64 `json:"articleId"` // 文章id | ||
| 87 | + CompanyId int64 `json:",optional"` //公司id | ||
| 88 | + Page int `json:"page"` //分页,第几页 | ||
| 89 | + Size int `json:"size"` //分页,每页几条 | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +type MiniUserLikeArticleResponse struct { | ||
| 93 | + Total int64 `json:"total"` //总数 | ||
| 94 | + List []WhichUserLikeArticle `json:"list"` //列表 | ||
| 95 | +} | ||
| 96 | + | ||
| 97 | +type WhichUserLikeArticle struct { | ||
| 98 | + ArticleId int64 `json:"articleId"` // 文章id | ||
| 99 | + UserId int64 `json:"userId"` // 人员id | ||
| 100 | + Name string `json:"name"` // 人员名称 | ||
| 101 | + Avatar string `json:"avatar"` // 人员头像 | ||
| 102 | + CreatedAt int64 `json:"createdAt"` // 点赞记录的时间 | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +type MiniSetUserLikeRequset struct { | ||
| 106 | + ArticleId int64 `json:"articleId"` //文章id | ||
| 107 | + CommentId int64 `json:"commentId"` //评论id | ||
| 108 | + UserId int64 `json:",optional"` //操作人 | ||
| 109 | + Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +type MiniSetUserLikeResponse struct { | ||
| 113 | + ArticleId int64 `json:"articleId"` //文章id | ||
| 114 | + CommentId int64 `json:"commentId"` //评论id | ||
| 115 | + Count int `json:"count"` //现有的点赞数量 | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +type MiniArticleBackupSearchRequest struct { | ||
| 119 | + Page int `json:"page"` | ||
| 120 | + Size int `json:"size"` | ||
| 121 | + ArticleId int `json:"articleId"` | ||
| 122 | + CompanyId int64 `json:",optional"` // 服务端自动获取 | ||
| 123 | +} | ||
| 124 | + | ||
| 125 | +type MiniArticleBackupSearchResponse struct { | ||
| 126 | + Total int64 `json:"total"` | ||
| 127 | + List []MiniArticleBackupItem `json:"list"` | ||
| 128 | +} | ||
| 129 | + | ||
| 130 | +type MiniArticleBackupItem struct { | ||
| 131 | + Id int64 `json:"id"` | ||
| 132 | + Title string `json:"title"` | ||
| 133 | + Content string `json:"content"` | ||
| 134 | + Images []string `json:"images"` | ||
| 135 | + CreatedAt int64 `json:"createdAt"` | ||
| 136 | + Location Location `json:"location"` | ||
| 137 | +} | ||
| 138 | + | ||
| 139 | +type MiniArticleMarkUserReadRequest struct { | ||
| 140 | + UserId int64 `json:",optional"` // 当前操作人 | ||
| 141 | + CompanyId int64 `json:",optional"` // 当前公司 | ||
| 142 | + ArticleId int64 `json:"articleId"` // 文章id | ||
| 143 | +} | ||
| 144 | + | ||
| 145 | +type MiniArticleMarkUserReadResponse struct { | ||
| 146 | + Id int64 `json:"id"` | ||
| 147 | +} | ||
| 148 | + | ||
| 149 | +type MiniArticleDraftCreateRequest struct { | ||
| 150 | + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式 | ||
| 151 | + Content []string `json:"content"` // 填写的内容 | ||
| 152 | + Title string `json:"title"` //标题 | ||
| 153 | + Images []string `json:"images"` //图片 | ||
| 154 | +} | ||
| 155 | + | ||
| 156 | +type MiniArticleDraftCreateResponse struct { | ||
| 157 | +} | ||
| 158 | + | ||
| 159 | +type SystemArticleGetRequest struct { | ||
| 160 | + Id int64 `path:"id"` //id | ||
| 161 | + CompanyId int64 `path:",optional"` | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | +type UserShowName struct { | ||
| 165 | + Id int `json:"id"` | ||
| 166 | + Name int `json:"name"` | ||
| 167 | +} | ||
| 168 | + | ||
| 169 | +type SystemArticleGetResponse struct { | ||
| 170 | + Id int64 `json:"id"` // id | ||
| 171 | + Title string `json:"title"` // 标题 | ||
| 172 | + AuthorId int64 `json:"authorId"` // 发布人id | ||
| 173 | + Author Author `json:"author"` // 发布人 | ||
| 174 | + CreatedAt int64 `json:"createdAt"` // 文章的发布时间 | ||
| 175 | + Section []ArticleSection `json:"section"` // 文章的文本内容 | ||
| 176 | + Images []string `json:"images"` // 图片 | ||
| 177 | + WhoRead []int64 `json:"whoRead"` // 谁可查看 | ||
| 178 | + WhoReadInfo []UserShowName `json:"whoReadInfo"` // 谁可查看 | ||
| 179 | + WhoReview []int64 `json:"whoReview"` // 谁可评论 | ||
| 180 | + WhoReviewInfo []UserShowName `json:"whoReviewInfo"` // 谁可评论 | ||
| 181 | + Location Location `json:"location"` // 定位坐标 | ||
| 182 | + CountLove int `json:"countLove"` // 点赞数量 | ||
| 183 | + CountComment int `json:"countComment"` // 评论数量 | ||
| 184 | + CountRead int `json:"countRead"` // 浏览数量 | ||
| 185 | + Show int `json:"show"` // 评论的展示状态(0显示、1不显示) | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +type SystemArticleSearchRequest struct { | ||
| 189 | + CompanyId int64 `json:",optional"` | ||
| 190 | + Page int `json:"page"` | ||
| 191 | + Size int `json:"size"` | ||
| 192 | +} | ||
| 193 | + | ||
| 194 | +type SystemArticleSearchResponse struct { | ||
| 195 | + Total int `json:"total"` | ||
| 196 | + List []SystemArticleSearch `json:"list"` | ||
| 197 | +} | ||
| 198 | + | ||
| 199 | +type SystemArticleSearch struct { | ||
| 200 | + Id int64 `json:"id"` //id | ||
| 201 | + Title string `json:"title"` //标题 | ||
| 202 | + Author string `json:"author"` //发布人 | ||
| 203 | + Images []string `json:"images"` //图片 | ||
| 204 | + CreatedAt int64 `json:"createdAt"` //文章的创建日期 | ||
| 205 | + CountLove int `json:"countLove"` //点赞数量 | ||
| 206 | + CountComment int `json:"CountComment"` //评论数量 | ||
| 207 | + Show int `json:"show"` //是否隐藏 [0显示、1不显示] | ||
| 208 | + Tags []string `json:"tags"` //标签 | ||
| 209 | + TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人] | ||
| 210 | +} | ||
| 211 | + | ||
| 4 | type CommentRequest struct { | 212 | type CommentRequest struct { |
| 5 | } | 213 | } |
| 6 | 214 | ||
| @@ -296,10 +504,22 @@ type SimpleComment struct { | @@ -296,10 +504,22 @@ type SimpleComment struct { | ||
| 296 | Show int `json:"show"` // 评论的展示状态(0显示、1不显示) | 504 | Show int `json:"show"` // 评论的展示状态(0显示、1不显示) |
| 297 | } | 505 | } |
| 298 | 506 | ||
| 507 | +type SystemUserInfoRequest struct { | ||
| 508 | +} | ||
| 509 | + | ||
| 510 | +type SystemUserInfoResponse struct { | ||
| 511 | + UserId int64 `json:"userId"` | ||
| 512 | + UserName string `json:"userName"` | ||
| 513 | + Avatar string `json:"avatar"` | ||
| 514 | + CompanyId int64 `json:"companyId"` | ||
| 515 | + CompanyName string `json:"companyName"` | ||
| 516 | +} | ||
| 517 | + | ||
| 299 | type CompanySearchRequest struct { | 518 | type CompanySearchRequest struct { |
| 300 | - Page int `json:"page"` | ||
| 301 | - Size int `json:"size"` | ||
| 302 | - UserId int64 `json:"userId,optional"` // 按用户搜索 | 519 | + Page int `json:"page,optional"` |
| 520 | + Size int `json:"size,optional"` | ||
| 521 | + Flag int `json:"flag,optional"` // 1:用户已加入的 2:用户未加入的公司 | ||
| 522 | + UserId int64 `json:"userId,optional"` // 按用户搜索(用户所加入的企业) | ||
| 303 | Code string `json:"code,optional"` // 按编码搜索 | 523 | Code string `json:"code,optional"` // 按编码搜索 |
| 304 | } | 524 | } |
| 305 | 525 | ||
| @@ -315,224 +535,6 @@ type Company struct { | @@ -315,224 +535,6 @@ type Company struct { | ||
| 315 | Logo string `json:"logo,omitempty"` // 公司LOGO | 535 | Logo string `json:"logo,omitempty"` // 公司LOGO |
| 316 | } | 536 | } |
| 317 | 537 | ||
| 318 | -type Location struct { | ||
| 319 | - Longitude float64 `json:"longitude,optional"` //经度 | ||
| 320 | - Latitude float64 `json:"latitude,optional"` //纬度 | ||
| 321 | - Descript string `json:"descript,optional"` //地点描述 | ||
| 322 | -} | ||
| 323 | - | ||
| 324 | -type Author struct { | ||
| 325 | - Id int64 `json:"id"` // 人员id | ||
| 326 | - Name string `json:"name"` // 人员的名字 | ||
| 327 | - Avatar string `json:"avatar"` // 人员头像URL | ||
| 328 | - Group string `json:"group"` // 人员的分组 | ||
| 329 | - Position string `json:"position"` // 职位 | ||
| 330 | - Company string `json:"company"` // 公司 | ||
| 331 | -} | ||
| 332 | - | ||
| 333 | -type MiniArticleCreateRequest struct { | ||
| 334 | - Title string `json:"title"` //标题 | ||
| 335 | - Section []string `json:"section"` //文章的文本内容 | ||
| 336 | - AuthorId int64 `json:"authorId,optional"` //发布人id | ||
| 337 | - Images []string `json:"images,optional"` //图片 | ||
| 338 | - WhoRead []int64 `json:"whoRead,optional"` //谁可查看 | ||
| 339 | - WhoReview []int64 `json:"whoReview,optional"` //谁可评论 | ||
| 340 | - Location Location `json:"location,optional"` //定位坐标 | ||
| 341 | -} | ||
| 342 | - | ||
| 343 | -type MiniArticleCreateResponse struct { | ||
| 344 | - Id int64 `json:"id"` | ||
| 345 | -} | ||
| 346 | - | ||
| 347 | -type MiniArticleGetRequest struct { | ||
| 348 | - Id int64 `path:"id"` //id | ||
| 349 | - CompanyId int64 `path:",optional"` | ||
| 350 | -} | ||
| 351 | - | ||
| 352 | -type MiniArticleGetResponse struct { | ||
| 353 | - Id int64 `json:"id"` //id | ||
| 354 | - Title string `json:"title"` //标题 | ||
| 355 | - AuthorId int64 `json:"authorId"` //发布人id | ||
| 356 | - Author Author `json:"author"` //发布人 | ||
| 357 | - CreatedAt int64 `json:"createdAt"` //文章的发布时间 | ||
| 358 | - Section []ArticleSection `json:"section"` //文章的文本内容 | ||
| 359 | - Images []string `json:"images"` //图片 | ||
| 360 | - WhoRead []int64 `json:"whoRead"` //谁可查看 | ||
| 361 | - WhoReview []int64 `json:"whoReview"` //谁可评论 | ||
| 362 | - Location Location `json:"location"` //定位坐标 | ||
| 363 | - CountLove int `json:"countLove"` // 点赞数量 | ||
| 364 | - CountComment int `json:"countComment"` // 评论数量 | ||
| 365 | - CountRead int `json:"countRead"` // 浏览数量 | ||
| 366 | - Show int `json:"show"` // 评论的展示状态(0显示、1不显示) | ||
| 367 | - Edit int `json:"edit"` // 文章是否存在变更记录 (0 不存在 1存在) | ||
| 368 | -} | ||
| 369 | - | ||
| 370 | -type ArticleSection struct { | ||
| 371 | - Id int64 `json:"id"` //段落id | ||
| 372 | - Content string `json:"content"` // 文本内容 | ||
| 373 | - SortBy int `json:"sortBy"` // 排序 | ||
| 374 | - TotalComment int `json:"totalComment"` // 评论的数量 | ||
| 375 | -} | ||
| 376 | - | ||
| 377 | -type MiniArticleSearchMeRequest struct { | ||
| 378 | - AuthorId int64 `json:",optional"` | ||
| 379 | - CompanyId int64 `json:",optional"` | ||
| 380 | - Page int `json:"page"` | ||
| 381 | - Size int `json:"size"` | ||
| 382 | -} | ||
| 383 | - | ||
| 384 | -type MiniArticleSearchMeResponse struct { | ||
| 385 | - Total int `json:"total"` | ||
| 386 | - List []ArticleSearchMe `json:"list"` | ||
| 387 | -} | ||
| 388 | - | ||
| 389 | -type ArticleSearchMe struct { | ||
| 390 | - Id int64 `json:"id"` //id | ||
| 391 | - Title string `json:"title"` //标题 | ||
| 392 | - Images []string `json:"images"` //图片 | ||
| 393 | - CreatedAt int64 `json:"createdAt"` //文章的创建日期 | ||
| 394 | - CountLove int `json:"countLove"` //点赞数量 | ||
| 395 | - CountComment int `json:"CountComment"` //评论数量 | ||
| 396 | - Show int `json:"show"` //是否隐藏 [0显示、1不显示] | ||
| 397 | -} | ||
| 398 | - | ||
| 399 | -type MiniUserLikeArticleRequest struct { | ||
| 400 | - ArticleId int64 `json:"articleId"` // 文章id | ||
| 401 | - CompanyId int64 `json:",optional"` //公司id | ||
| 402 | - Page int `json:"page"` //分页,第几页 | ||
| 403 | - Size int `json:"size"` //分页,每页几条 | ||
| 404 | -} | ||
| 405 | - | ||
| 406 | -type MiniUserLikeArticleResponse struct { | ||
| 407 | - Total int64 `json:"total"` //总数 | ||
| 408 | - List []WhichUserLikeArticle `json:"list"` //列表 | ||
| 409 | -} | ||
| 410 | - | ||
| 411 | -type WhichUserLikeArticle struct { | ||
| 412 | - ArticleId int64 `json:"articleId"` // 文章id | ||
| 413 | - UserId int64 `json:"userId"` // 人员id | ||
| 414 | - Name string `json:"name"` // 人员名称 | ||
| 415 | - Avatar string `json:"avatar"` // 人员头像 | ||
| 416 | - CreatedAt int64 `json:"createdAt"` // 点赞记录的时间 | ||
| 417 | -} | ||
| 418 | - | ||
| 419 | -type MiniSetUserLikeRequset struct { | ||
| 420 | - ArticleId int64 `json:"articleId"` //文章id | ||
| 421 | - CommentId int64 `json:"commentId"` //评论id | ||
| 422 | - UserId int64 `json:",optional"` //操作人 | ||
| 423 | - Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 | ||
| 424 | -} | ||
| 425 | - | ||
| 426 | -type MiniSetUserLikeResponse struct { | ||
| 427 | - ArticleId int64 `json:"articleId"` //文章id | ||
| 428 | - CommentId int64 `json:"commentId"` //评论id | ||
| 429 | - Count int `json:"count"` //现有的点赞数量 | ||
| 430 | -} | ||
| 431 | - | ||
| 432 | -type MiniArticleBackupSearchRequest struct { | ||
| 433 | - Page int `json:"page"` | ||
| 434 | - Size int `json:"size"` | ||
| 435 | - ArticleId int `json:"articleId"` | ||
| 436 | - CompanyId int64 `json:",optional"` // 服务端自动获取 | ||
| 437 | -} | ||
| 438 | - | ||
| 439 | -type MiniArticleBackupSearchResponse struct { | ||
| 440 | - Total int64 `json:"total"` | ||
| 441 | - List []MiniArticleBackupItem `json:"list"` | ||
| 442 | -} | ||
| 443 | - | ||
| 444 | -type MiniArticleBackupItem struct { | ||
| 445 | - Id int64 `json:"id"` | ||
| 446 | - Title string `json:"title"` | ||
| 447 | - Content string `json:"content"` | ||
| 448 | - Images []string `json:"images"` | ||
| 449 | - CreatedAt int64 `json:"createdAt"` | ||
| 450 | - Location Location `json:"location"` | ||
| 451 | -} | ||
| 452 | - | ||
| 453 | -type MiniArticleMarkUserReadRequest struct { | ||
| 454 | - UserId int64 `json:",optional"` // 当前操作人 | ||
| 455 | - CompanyId int64 `json:",optional"` // 当前公司 | ||
| 456 | - ArticleId int64 `json:"articleId"` // 文章id | ||
| 457 | -} | ||
| 458 | - | ||
| 459 | -type MiniArticleMarkUserReadResponse struct { | ||
| 460 | - Id int64 `json:"id"` | ||
| 461 | -} | ||
| 462 | - | ||
| 463 | -type MiniArticleMarkListRequest struct { | ||
| 464 | - Page int `json:"page"` | ||
| 465 | - Size int `json:"size"` | ||
| 466 | -} | ||
| 467 | - | ||
| 468 | -type MiniArticleMarkListResponse struct { | ||
| 469 | - Total int64 `json:"total"` | ||
| 470 | - List []MiniArticleMarkItem `json:"list"` | ||
| 471 | -} | ||
| 472 | - | ||
| 473 | -type MiniArticleMarkItem struct { | ||
| 474 | - Id int64 `json:"id"` | ||
| 475 | - CompanyId int64 `json:"companyId"` | ||
| 476 | - UserId int64 `json:"userId"` | ||
| 477 | - ArticleId int64 `json:"articleId"` | ||
| 478 | - Title string `json:"title"` | ||
| 479 | - Author SimpleUser `json:"author"` // 发布人 | ||
| 480 | - UpdatedAt int64 `json:"updatedAt"` | ||
| 481 | -} | ||
| 482 | - | ||
| 483 | -type SystemArticleGetRequest struct { | ||
| 484 | - Id int64 `path:"id"` //id | ||
| 485 | - CompanyId int64 `path:",optional"` | ||
| 486 | -} | ||
| 487 | - | ||
| 488 | -type UserShowName struct { | ||
| 489 | - Id int `json:"id"` | ||
| 490 | - Name int `json:"name"` | ||
| 491 | -} | ||
| 492 | - | ||
| 493 | -type SystemArticleGetResponse struct { | ||
| 494 | - Id int64 `json:"id"` // id | ||
| 495 | - Title string `json:"title"` // 标题 | ||
| 496 | - AuthorId int64 `json:"authorId"` // 发布人id | ||
| 497 | - Author Author `json:"author"` // 发布人 | ||
| 498 | - CreatedAt int64 `json:"createdAt"` // 文章的发布时间 | ||
| 499 | - Section []ArticleSection `json:"section"` // 文章的文本内容 | ||
| 500 | - Images []string `json:"images"` // 图片 | ||
| 501 | - WhoRead []int64 `json:"whoRead"` // 谁可查看 | ||
| 502 | - WhoReadInfo []UserShowName `json:"whoReadInfo"` // 谁可查看 | ||
| 503 | - WhoReview []int64 `json:"whoReview"` // 谁可评论 | ||
| 504 | - WhoReviewInfo []UserShowName `json:"whoReviewInfo"` // 谁可评论 | ||
| 505 | - Location Location `json:"location"` // 定位坐标 | ||
| 506 | - CountLove int `json:"countLove"` // 点赞数量 | ||
| 507 | - CountComment int `json:"countComment"` // 评论数量 | ||
| 508 | - CountRead int `json:"countRead"` // 浏览数量 | ||
| 509 | - Show int `json:"show"` // 评论的展示状态(0显示、1不显示) | ||
| 510 | -} | ||
| 511 | - | ||
| 512 | -type SystemArticleSearchRequest struct { | ||
| 513 | - CompanyId int64 `json:",optional"` | ||
| 514 | - Page int `json:"page"` | ||
| 515 | - Size int `json:"size"` | ||
| 516 | -} | ||
| 517 | - | ||
| 518 | -type SystemArticleSearchResponse struct { | ||
| 519 | - Total int `json:"total"` | ||
| 520 | - List []SystemArticleSearch `json:"list"` | ||
| 521 | -} | ||
| 522 | - | ||
| 523 | -type SystemArticleSearch struct { | ||
| 524 | - Id int64 `json:"id"` //id | ||
| 525 | - Title string `json:"title"` //标题 | ||
| 526 | - Author string `json:"author"` //发布人 | ||
| 527 | - Images []string `json:"images"` //图片 | ||
| 528 | - CreatedAt int64 `json:"createdAt"` //文章的创建日期 | ||
| 529 | - CountLove int `json:"countLove"` //点赞数量 | ||
| 530 | - CountComment int `json:"CountComment"` //评论数量 | ||
| 531 | - Show int `json:"show"` //是否隐藏 [0显示、1不显示] | ||
| 532 | - Tags []string `json:"tags"` //标签 | ||
| 533 | - TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人] | ||
| 534 | -} | ||
| 535 | - | ||
| 536 | type RoleGetRequest struct { | 538 | type RoleGetRequest struct { |
| 537 | Id int64 `path:"id"` | 539 | Id int64 `path:"id"` |
| 538 | } | 540 | } |
| @@ -216,6 +216,7 @@ func (repository *ArticleRepository) IncreaseCountLove(ctx context.Context, conn | @@ -216,6 +216,7 @@ func (repository *ArticleRepository) IncreaseCountLove(ctx context.Context, conn | ||
| 216 | queryFunc := func() (interface{}, error) { | 216 | queryFunc := func() (interface{}, error) { |
| 217 | tx = tx.Model(m).Updates(map[string]interface{}{ | 217 | tx = tx.Model(m).Updates(map[string]interface{}{ |
| 218 | "count_love": gorm.Expr("count_love+?", incr), | 218 | "count_love": gorm.Expr("count_love+?", incr), |
| 219 | + "version": gorm.Expr("version+1"), | ||
| 219 | }) | 220 | }) |
| 220 | return nil, tx.Error | 221 | return nil, tx.Error |
| 221 | } | 222 | } |
| @@ -236,7 +237,10 @@ func (repository *ArticleRepository) IncreaseCountRead(ctx context.Context, conn | @@ -236,7 +237,10 @@ func (repository *ArticleRepository) IncreaseCountRead(ctx context.Context, conn | ||
| 236 | return err | 237 | return err |
| 237 | } | 238 | } |
| 238 | queryFunc := func() (interface{}, error) { | 239 | queryFunc := func() (interface{}, error) { |
| 239 | - tx = tx.Model(m).Update("count_read", gorm.Expr("count_read+?", incr)) | 240 | + tx = tx.Model(m).Updates(map[string]interface{}{ |
| 241 | + "version": gorm.Expr("version+1"), | ||
| 242 | + "count_read": gorm.Expr("count_read+?", incr), | ||
| 243 | + }) | ||
| 240 | return nil, tx.Error | 244 | return nil, tx.Error |
| 241 | } | 245 | } |
| 242 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 246 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
| @@ -256,7 +260,10 @@ func (repository *ArticleRepository) IncreaseCountComment(ctx context.Context, c | @@ -256,7 +260,10 @@ func (repository *ArticleRepository) IncreaseCountComment(ctx context.Context, c | ||
| 256 | return err | 260 | return err |
| 257 | } | 261 | } |
| 258 | queryFunc := func() (interface{}, error) { | 262 | queryFunc := func() (interface{}, error) { |
| 259 | - tx = tx.Model(m).Update("count_comment", gorm.Expr("count_comment+?", incr)) | 263 | + tx = tx.Model(m).Updates(map[string]interface{}{ |
| 264 | + "version": gorm.Expr("version+1"), | ||
| 265 | + "count_comment": gorm.Expr("count_comment+?", incr), | ||
| 266 | + }) | ||
| 260 | return nil, tx.Error | 267 | return nil, tx.Error |
| 261 | } | 268 | } |
| 262 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { | 269 | if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { |
| @@ -142,6 +142,9 @@ func (repository *CompanyRepository) Find(ctx context.Context, conn transaction. | @@ -142,6 +142,9 @@ func (repository *CompanyRepository) Find(ctx context.Context, conn transaction. | ||
| 142 | if v, ok := queryOptions["ids"]; ok { | 142 | if v, ok := queryOptions["ids"]; ok { |
| 143 | tx.Where("id in (?)", v) | 143 | tx.Where("id in (?)", v) |
| 144 | } | 144 | } |
| 145 | + if v, ok := queryOptions["excludeIds"]; ok { | ||
| 146 | + tx.Where("id not in (?)", v) | ||
| 147 | + } | ||
| 145 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { | 148 | if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { |
| 146 | return dms, tx.Error | 149 | return dms, tx.Error |
| 147 | } | 150 | } |
-
请 注册 或 登录 后发表评论