作者 庄敏学

文章列表、详情

@@ -43,6 +43,34 @@ @@ -43,6 +43,34 @@
43 ] 43 ]
44 } 44 }
45 }, 45 },
  46 + "v1/mini/article/mark/list": {
  47 + "post": {
  48 + "summary": "小程序获取文章浏览记录",
  49 + "operationId": "MiniArticleMarkList",
  50 + "responses": {
  51 + "200": {
  52 + "description": "A successful response.",
  53 + "schema": {
  54 + "$ref": "#/definitions/MiniArticleMarkListResponse"
  55 + }
  56 + }
  57 + },
  58 + "parameters": [
  59 + {
  60 + "name": "body",
  61 + "in": "body",
  62 + "required": true,
  63 + "schema": {
  64 + "$ref": "#/definitions/MiniArticleMarkListRequest"
  65 + }
  66 + }
  67 + ],
  68 + "requestBody": {},
  69 + "tags": [
  70 + "article"
  71 + ]
  72 + }
  73 + },
46 "v1/mini/article/mark/user_read": { 74 "v1/mini/article/mark/user_read": {
47 "post": { 75 "post": {
48 "summary": "小程序标记当前人员查看的文章", 76 "summary": "小程序标记当前人员查看的文章",
@@ -209,6 +237,62 @@ @@ -209,6 +237,62 @@
209 ] 237 ]
210 } 238 }
211 }, 239 },
  240 + "v1/mini/article_comment": {
  241 + "post": {
  242 + "summary": "小程序填写文章的评论",
  243 + "operationId": "MiniCreateArticleComment",
  244 + "responses": {
  245 + "200": {
  246 + "description": "A successful response.",
  247 + "schema": {
  248 + "$ref": "#/definitions/MiniCreateArticleCommentResponse"
  249 + }
  250 + }
  251 + },
  252 + "parameters": [
  253 + {
  254 + "name": "body",
  255 + "in": "body",
  256 + "required": true,
  257 + "schema": {
  258 + "$ref": "#/definitions/MiniCreateArticleCommentRequest"
  259 + }
  260 + }
  261 + ],
  262 + "requestBody": {},
  263 + "tags": [
  264 + "comment"
  265 + ]
  266 + }
  267 + },
  268 + "v1/mini/article_comment/at_user/select": {
  269 + "post": {
  270 + "summary": "小程序获取回复@人可选列表",
  271 + "operationId": "MiniArticleCommentAtUser",
  272 + "responses": {
  273 + "200": {
  274 + "description": "A successful response.",
  275 + "schema": {
  276 + "$ref": "#/definitions/MiniArticleCommentAtUserResponse"
  277 + }
  278 + }
  279 + },
  280 + "parameters": [
  281 + {
  282 + "name": "body",
  283 + "in": "body",
  284 + "required": true,
  285 + "schema": {
  286 + "$ref": "#/definitions/MiniArticleCommentAtUserRequest"
  287 + }
  288 + }
  289 + ],
  290 + "requestBody": {},
  291 + "tags": [
  292 + "comment"
  293 + ]
  294 + }
  295 + },
212 "v1/mini/article_draft": { 296 "v1/mini/article_draft": {
213 "post": { 297 "post": {
214 "summary": "小程序创建文章进草稿箱", 298 "summary": "小程序创建文章进草稿箱",
@@ -217,7 +301,7 @@ @@ -217,7 +301,7 @@
217 "200": { 301 "200": {
218 "description": "A successful response.", 302 "description": "A successful response.",
219 "schema": { 303 "schema": {
220 - "$ref": "#/definitions/MiniArticleSearchMeResponse" 304 + "$ref": "#/definitions/MiniArticleDraftCreateResponse"
221 } 305 }
222 } 306 }
223 }, 307 },
@@ -227,7 +311,33 @@ @@ -227,7 +311,33 @@
227 "in": "body", 311 "in": "body",
228 "required": true, 312 "required": true,
229 "schema": { 313 "schema": {
230 - "$ref": "#/definitions/MiniArticleSearchMeRequest" 314 + "$ref": "#/definitions/MiniArticleDraftCreateRequest"
  315 + }
  316 + }
  317 + ],
  318 + "requestBody": {},
  319 + "tags": [
  320 + "article"
  321 + ]
  322 + },
  323 + "put": {
  324 + "summary": "小程序更新文章草稿",
  325 + "operationId": "MiniUpdateArticleDraft",
  326 + "responses": {
  327 + "200": {
  328 + "description": "A successful response.",
  329 + "schema": {
  330 + "$ref": "#/definitions/MiniArticleDraftUpdateResponse"
  331 + }
  332 + }
  333 + },
  334 + "parameters": [
  335 + {
  336 + "name": "body",
  337 + "in": "body",
  338 + "required": true,
  339 + "schema": {
  340 + "$ref": "#/definitions/MiniArticleDraftUpdateRequest"
231 } 341 }
232 } 342 }
233 ], 343 ],
@@ -237,21 +347,89 @@ @@ -237,21 +347,89 @@
237 ] 347 ]
238 } 348 }
239 }, 349 },
240 - "v1/mini/comment": { 350 + "v1/mini/article_draft/me/{id}": {
241 "get": { 351 "get": {
242 - "summary": "小程序评论",  
243 - "operationId": "miniComment", 352 + "summary": "小程序获取我的草稿内容",
  353 + "operationId": "MiniGetArticleDraftMe",
244 "responses": { 354 "responses": {
245 "200": { 355 "200": {
246 "description": "A successful response.", 356 "description": "A successful response.",
247 "schema": { 357 "schema": {
248 - "$ref": "#/definitions/CommentResposne" 358 + "$ref": "#/definitions/MiniArticleDraftGetMeResponse"
249 } 359 }
250 } 360 }
251 }, 361 },
  362 + "parameters": [
  363 + {
  364 + "name": "id",
  365 + "in": "path",
  366 + "required": true,
  367 + "type": "string"
  368 + }
  369 + ],
252 "requestBody": {}, 370 "requestBody": {},
253 "tags": [ 371 "tags": [
254 - "comment" 372 + "article"
  373 + ]
  374 + },
  375 + "delete": {
  376 + "summary": "小程序删除我的草稿内容",
  377 + "operationId": "MiniDeleteArticleDraftMe",
  378 + "responses": {
  379 + "200": {
  380 + "description": "A successful response.",
  381 + "schema": {
  382 + "$ref": "#/definitions/MiniArticleDraftDeleteMeResponse"
  383 + }
  384 + }
  385 + },
  386 + "parameters": [
  387 + {
  388 + "name": "id",
  389 + "in": "path",
  390 + "required": true,
  391 + "type": "string"
  392 + },
  393 + {
  394 + "name": "body",
  395 + "in": "body",
  396 + "required": true,
  397 + "schema": {
  398 + "$ref": "#/definitions/MiniArticleDraftDeleteMeRequest"
  399 + }
  400 + }
  401 + ],
  402 + "requestBody": {},
  403 + "tags": [
  404 + "article"
  405 + ]
  406 + }
  407 + },
  408 + "v1/mini/article_draft/search/me": {
  409 + "post": {
  410 + "summary": "小程序获取我的草稿箱列表",
  411 + "operationId": "MiniSearchArticleDraftMe",
  412 + "responses": {
  413 + "200": {
  414 + "description": "A successful response.",
  415 + "schema": {
  416 + "$ref": "#/definitions/MiniArticleDraftSearchMeResponse"
  417 + }
  418 + }
  419 + },
  420 + "parameters": [
  421 + {
  422 + "name": "body",
  423 + "in": "body",
  424 + "required": true,
  425 + "schema": {
  426 + "$ref": "#/definitions/MiniArticleDraftSearchMeRequest"
  427 + }
  428 + }
  429 + ],
  430 + "requestBody": {},
  431 + "tags": [
  432 + "article"
255 ] 433 ]
256 } 434 }
257 }, 435 },
@@ -811,6 +989,64 @@ @@ -811,6 +989,64 @@
811 ] 989 ]
812 } 990 }
813 }, 991 },
  992 + "v1/system/article": {
  993 + "put": {
  994 + "summary": "管理后台编辑帖子",
  995 + "operationId": "SystemUpdateArticle",
  996 + "responses": {
  997 + "200": {
  998 + "description": "A successful response.",
  999 + "schema": {
  1000 + "$ref": "#/definitions/SystemArticleUpdateResponse"
  1001 + }
  1002 + }
  1003 + },
  1004 + "parameters": [
  1005 + {
  1006 + "name": "body",
  1007 + "description": "编辑",
  1008 + "in": "body",
  1009 + "required": true,
  1010 + "schema": {
  1011 + "$ref": "#/definitions/SystemArticleUpdateRequest"
  1012 + }
  1013 + }
  1014 + ],
  1015 + "requestBody": {},
  1016 + "tags": [
  1017 + "article"
  1018 + ]
  1019 + }
  1020 + },
  1021 + "v1/system/article/history": {
  1022 + "post": {
  1023 + "summary": "管理后台编辑历史",
  1024 + "operationId": "SystemHistoryArticle",
  1025 + "responses": {
  1026 + "200": {
  1027 + "description": "A successful response.",
  1028 + "schema": {
  1029 + "$ref": "#/definitions/SystemArticleHistoryResponse"
  1030 + }
  1031 + }
  1032 + },
  1033 + "parameters": [
  1034 + {
  1035 + "name": "body",
  1036 + "description": "历史",
  1037 + "in": "body",
  1038 + "required": true,
  1039 + "schema": {
  1040 + "$ref": "#/definitions/SystemArticleHistoryRequest"
  1041 + }
  1042 + }
  1043 + ],
  1044 + "requestBody": {},
  1045 + "tags": [
  1046 + "article"
  1047 + ]
  1048 + }
  1049 + },
814 "v1/system/article/search": { 1050 "v1/system/article/search": {
815 "post": { 1051 "post": {
816 "summary": "管理后台获取文章列表", 1052 "summary": "管理后台获取文章列表",
@@ -1005,24 +1241,6 @@ @@ -1005,24 +1241,6 @@
1005 ] 1241 ]
1006 } 1242 }
1007 }, 1243 },
1008 - "v1/system/comment": {  
1009 - "get": {  
1010 - "summary": "系统评论",  
1011 - "operationId": "systemComment",  
1012 - "responses": {  
1013 - "200": {  
1014 - "description": "A successful response.",  
1015 - "schema": {  
1016 - "$ref": "#/definitions/CommentResposne"  
1017 - }  
1018 - }  
1019 - },  
1020 - "requestBody": {},  
1021 - "tags": [  
1022 - "comment"  
1023 - ]  
1024 - }  
1025 - },  
1026 "v1/system/company/search": { 1244 "v1/system/company/search": {
1027 "post": { 1245 "post": {
1028 "summary": "公司搜索", 1246 "summary": "公司搜索",
@@ -1051,14 +1269,15 @@ @@ -1051,14 +1269,15 @@
1051 ] 1269 ]
1052 } 1270 }
1053 }, 1271 },
1054 - "v1/system/role": { 1272 + "v1/system/department/add": {
1055 "post": { 1273 "post": {
1056 - "operationId": "systemSaveRole", 1274 + "summary": "部门-新增",
  1275 + "operationId": "systemAdd",
1057 "responses": { 1276 "responses": {
1058 "200": { 1277 "200": {
1059 "description": "A successful response.", 1278 "description": "A successful response.",
1060 "schema": { 1279 "schema": {
1061 - "$ref": "#/definitions/RoleSaveResponse" 1280 + "$ref": "#/definitions/DepartmentGetResponse"
1062 } 1281 }
1063 } 1282 }
1064 }, 1283 },
@@ -1068,24 +1287,25 @@ @@ -1068,24 +1287,25 @@
1068 "in": "body", 1287 "in": "body",
1069 "required": true, 1288 "required": true,
1070 "schema": { 1289 "schema": {
1071 - "$ref": "#/definitions/RoleSaveRequest" 1290 + "$ref": "#/definitions/DepartmentAddRequest"
1072 } 1291 }
1073 } 1292 }
1074 ], 1293 ],
1075 "requestBody": {}, 1294 "requestBody": {},
1076 "tags": [ 1295 "tags": [
1077 - "role" 1296 + "department"
1078 ] 1297 ]
1079 } 1298 }
1080 }, 1299 },
1081 - "v1/system/role/search": { 1300 + "v1/system/department/list": {
1082 "post": { 1301 "post": {
1083 - "operationId": "systemSearchRole", 1302 + "summary": "部门列表",
  1303 + "operationId": "systemList",
1084 "responses": { 1304 "responses": {
1085 "200": { 1305 "200": {
1086 "description": "A successful response.", 1306 "description": "A successful response.",
1087 "schema": { 1307 "schema": {
1088 - "$ref": "#/definitions/RoleSearchResponse" 1308 + "$ref": "#/definitions/DepartmentListResponse"
1089 } 1309 }
1090 } 1310 }
1091 }, 1311 },
@@ -1095,24 +1315,25 @@ @@ -1095,24 +1315,25 @@
1095 "in": "body", 1315 "in": "body",
1096 "required": true, 1316 "required": true,
1097 "schema": { 1317 "schema": {
1098 - "$ref": "#/definitions/RoleSearchRequest" 1318 + "$ref": "#/definitions/DepartmentListRequest"
1099 } 1319 }
1100 } 1320 }
1101 ], 1321 ],
1102 "requestBody": {}, 1322 "requestBody": {},
1103 "tags": [ 1323 "tags": [
1104 - "role" 1324 + "department"
1105 ] 1325 ]
1106 } 1326 }
1107 }, 1327 },
1108 - "v1/system/role/{id}": { 1328 + "v1/system/department/{id}": {
1109 "get": { 1329 "get": {
1110 - "operationId": "systemGetRole", 1330 + "summary": "部门-详情",
  1331 + "operationId": "systemGet",
1111 "responses": { 1332 "responses": {
1112 "200": { 1333 "200": {
1113 "description": "A successful response.", 1334 "description": "A successful response.",
1114 "schema": { 1335 "schema": {
1115 - "$ref": "#/definitions/RoleGetResponse" 1336 + "$ref": "#/definitions/DepartmentGetResponse"
1116 } 1337 }
1117 } 1338 }
1118 }, 1339 },
@@ -1126,16 +1347,17 @@ @@ -1126,16 +1347,17 @@
1126 ], 1347 ],
1127 "requestBody": {}, 1348 "requestBody": {},
1128 "tags": [ 1349 "tags": [
1129 - "role" 1350 + "department"
1130 ] 1351 ]
1131 }, 1352 },
1132 - "delete": {  
1133 - "operationId": "systemDeleteRole", 1353 + "put": {
  1354 + "summary": "部门-更新",
  1355 + "operationId": "systemUpdate",
1134 "responses": { 1356 "responses": {
1135 "200": { 1357 "200": {
1136 "description": "A successful response.", 1358 "description": "A successful response.",
1137 "schema": { 1359 "schema": {
1138 - "$ref": "#/definitions/RoleDeleteResponse" 1360 + "$ref": "#/definitions/DepartmentGetResponse"
1139 } 1361 }
1140 } 1362 }
1141 }, 1363 },
@@ -1151,38 +1373,34 @@ @@ -1151,38 +1373,34 @@
1151 "in": "body", 1373 "in": "body",
1152 "required": true, 1374 "required": true,
1153 "schema": { 1375 "schema": {
1154 - "$ref": "#/definitions/RoleDeleteRequest" 1376 + "$ref": "#/definitions/DepartmentUpdateRequest"
1155 } 1377 }
1156 } 1378 }
1157 ], 1379 ],
1158 "requestBody": {}, 1380 "requestBody": {},
1159 "tags": [ 1381 "tags": [
1160 - "role" 1382 + "department"
1161 ] 1383 ]
  1384 + }
1162 }, 1385 },
1163 - "put": {  
1164 - "operationId": "systemUpdateRole", 1386 + "v1/system/role": {
  1387 + "post": {
  1388 + "operationId": "systemSaveRole",
1165 "responses": { 1389 "responses": {
1166 "200": { 1390 "200": {
1167 "description": "A successful response.", 1391 "description": "A successful response.",
1168 "schema": { 1392 "schema": {
1169 - "$ref": "#/definitions/RoleUpdateResponse" 1393 + "$ref": "#/definitions/RoleSaveResponse"
1170 } 1394 }
1171 } 1395 }
1172 }, 1396 },
1173 "parameters": [ 1397 "parameters": [
1174 { 1398 {
1175 - "name": "id",  
1176 - "in": "path",  
1177 - "required": true,  
1178 - "type": "string"  
1179 - },  
1180 - {  
1181 "name": "body", 1399 "name": "body",
1182 "in": "body", 1400 "in": "body",
1183 "required": true, 1401 "required": true,
1184 "schema": { 1402 "schema": {
1185 - "$ref": "#/definitions/RoleUpdateRequest" 1403 + "$ref": "#/definitions/RoleSaveRequest"
1186 } 1404 }
1187 } 1405 }
1188 ], 1406 ],
@@ -1192,15 +1410,129 @@ @@ -1192,15 +1410,129 @@
1192 ] 1410 ]
1193 } 1411 }
1194 }, 1412 },
1195 - "v1/system/user/info": { 1413 + "v1/system/role/search": {
1196 "post": { 1414 "post": {
1197 - "summary": "系统用户信息",  
1198 - "operationId": "systemUserInfo", 1415 + "operationId": "systemSearchRole",
1199 "responses": { 1416 "responses": {
1200 "200": { 1417 "200": {
1201 "description": "A successful response.", 1418 "description": "A successful response.",
1202 "schema": { 1419 "schema": {
1203 - "$ref": "#/definitions/SystemUserInfoResponse" 1420 + "$ref": "#/definitions/RoleSearchResponse"
  1421 + }
  1422 + }
  1423 + },
  1424 + "parameters": [
  1425 + {
  1426 + "name": "body",
  1427 + "in": "body",
  1428 + "required": true,
  1429 + "schema": {
  1430 + "$ref": "#/definitions/RoleSearchRequest"
  1431 + }
  1432 + }
  1433 + ],
  1434 + "requestBody": {},
  1435 + "tags": [
  1436 + "role"
  1437 + ]
  1438 + }
  1439 + },
  1440 + "v1/system/role/{id}": {
  1441 + "get": {
  1442 + "operationId": "systemGetRole",
  1443 + "responses": {
  1444 + "200": {
  1445 + "description": "A successful response.",
  1446 + "schema": {
  1447 + "$ref": "#/definitions/RoleGetResponse"
  1448 + }
  1449 + }
  1450 + },
  1451 + "parameters": [
  1452 + {
  1453 + "name": "id",
  1454 + "in": "path",
  1455 + "required": true,
  1456 + "type": "string"
  1457 + }
  1458 + ],
  1459 + "requestBody": {},
  1460 + "tags": [
  1461 + "role"
  1462 + ]
  1463 + },
  1464 + "delete": {
  1465 + "operationId": "systemDeleteRole",
  1466 + "responses": {
  1467 + "200": {
  1468 + "description": "A successful response.",
  1469 + "schema": {
  1470 + "$ref": "#/definitions/RoleDeleteResponse"
  1471 + }
  1472 + }
  1473 + },
  1474 + "parameters": [
  1475 + {
  1476 + "name": "id",
  1477 + "in": "path",
  1478 + "required": true,
  1479 + "type": "string"
  1480 + },
  1481 + {
  1482 + "name": "body",
  1483 + "in": "body",
  1484 + "required": true,
  1485 + "schema": {
  1486 + "$ref": "#/definitions/RoleDeleteRequest"
  1487 + }
  1488 + }
  1489 + ],
  1490 + "requestBody": {},
  1491 + "tags": [
  1492 + "role"
  1493 + ]
  1494 + },
  1495 + "put": {
  1496 + "operationId": "systemUpdateRole",
  1497 + "responses": {
  1498 + "200": {
  1499 + "description": "A successful response.",
  1500 + "schema": {
  1501 + "$ref": "#/definitions/RoleUpdateResponse"
  1502 + }
  1503 + }
  1504 + },
  1505 + "parameters": [
  1506 + {
  1507 + "name": "id",
  1508 + "in": "path",
  1509 + "required": true,
  1510 + "type": "string"
  1511 + },
  1512 + {
  1513 + "name": "body",
  1514 + "in": "body",
  1515 + "required": true,
  1516 + "schema": {
  1517 + "$ref": "#/definitions/RoleUpdateRequest"
  1518 + }
  1519 + }
  1520 + ],
  1521 + "requestBody": {},
  1522 + "tags": [
  1523 + "role"
  1524 + ]
  1525 + }
  1526 + },
  1527 + "v1/system/user/info": {
  1528 + "post": {
  1529 + "summary": "系统用户信息",
  1530 + "operationId": "systemUserInfo",
  1531 + "responses": {
  1532 + "200": {
  1533 + "description": "A successful response.",
  1534 + "schema": {
  1535 + "$ref": "#/definitions/SystemUserInfoResponse"
1204 } 1536 }
1205 } 1537 }
1206 }, 1538 },
@@ -1404,6 +1736,40 @@ @@ -1404,6 +1736,40 @@
1404 "position" 1736 "position"
1405 ] 1737 ]
1406 }, 1738 },
  1739 + "ArticleAuthor": {
  1740 + "type": "object",
  1741 + "properties": {
  1742 + "id": {
  1743 + "type": "integer",
  1744 + "format": "int64",
  1745 + "description": " 人员id"
  1746 + },
  1747 + "name": {
  1748 + "type": "string",
  1749 + "description": " 人员的名字"
  1750 + },
  1751 + "avatar": {
  1752 + "type": "string",
  1753 + "description": " 人员头像URL"
  1754 + },
  1755 + "position": {
  1756 + "type": "string",
  1757 + "description": " 职位"
  1758 + },
  1759 + "company": {
  1760 + "type": "string",
  1761 + "description": " 公司"
  1762 + }
  1763 + },
  1764 + "title": "ArticleAuthor",
  1765 + "required": [
  1766 + "id",
  1767 + "name",
  1768 + "avatar",
  1769 + "position",
  1770 + "company"
  1771 + ]
  1772 + },
1407 "ArticleSearchMe": { 1773 "ArticleSearchMe": {
1408 "type": "object", 1774 "type": "object",
1409 "properties": { 1775 "properties": {
@@ -1510,7 +1876,7 @@ @@ -1510,7 +1876,7 @@
1510 "code" 1876 "code"
1511 ] 1877 ]
1512 }, 1878 },
1513 - "Author": { 1879 + "CommentAuthor": {
1514 "type": "object", 1880 "type": "object",
1515 "properties": { 1881 "properties": {
1516 "id": { 1882 "id": {
@@ -1526,10 +1892,6 @@ @@ -1526,10 +1892,6 @@
1526 "type": "string", 1892 "type": "string",
1527 "description": " 人员头像URL" 1893 "description": " 人员头像URL"
1528 }, 1894 },
1529 - "group": {  
1530 - "type": "string",  
1531 - "description": " 人员的分组"  
1532 - },  
1533 "position": { 1895 "position": {
1534 "type": "string", 1896 "type": "string",
1535 "description": " 职位" 1897 "description": " 职位"
@@ -1539,39 +1901,15 @@ @@ -1539,39 +1901,15 @@
1539 "description": " 公司" 1901 "description": " 公司"
1540 } 1902 }
1541 }, 1903 },
1542 - "title": "Author", 1904 + "title": "CommentAuthor",
1543 "required": [ 1905 "required": [
1544 "id", 1906 "id",
1545 "name", 1907 "name",
1546 "avatar", 1908 "avatar",
1547 - "group",  
1548 "position", 1909 "position",
1549 "company" 1910 "company"
1550 ] 1911 ]
1551 }, 1912 },
1552 - "Comment": {  
1553 - "type": "object",  
1554 - "title": "Comment"  
1555 - },  
1556 - "CommentRequest": {  
1557 - "type": "object",  
1558 - "title": "CommentRequest"  
1559 - },  
1560 - "CommentResposne": {  
1561 - "type": "object",  
1562 - "properties": {  
1563 - "list": {  
1564 - "type": "array",  
1565 - "items": {  
1566 - "$ref": "#/definitions/Comment"  
1567 - }  
1568 - }  
1569 - },  
1570 - "title": "CommentResposne",  
1571 - "required": [  
1572 - "list"  
1573 - ]  
1574 - },  
1575 "Company": { 1913 "Company": {
1576 "type": "object", 1914 "type": "object",
1577 "properties": { 1915 "properties": {
@@ -1680,6 +2018,108 @@ @@ -1680,6 +2018,108 @@
1680 "name" 2018 "name"
1681 ] 2019 ]
1682 }, 2020 },
  2021 + "DepartmentAddRequest": {
  2022 + "type": "object",
  2023 + "properties": {
  2024 + "name": {
  2025 + "type": "string",
  2026 + "description": " 分组名称"
  2027 + },
  2028 + "ids": {
  2029 + "type": "array",
  2030 + "items": {
  2031 + "type": "integer",
  2032 + "format": "int64"
  2033 + },
  2034 + "description": " 用户ID"
  2035 + }
  2036 + },
  2037 + "title": "DepartmentAddRequest",
  2038 + "required": [
  2039 + "name",
  2040 + "ids"
  2041 + ]
  2042 + },
  2043 + "DepartmentGetRequest": {
  2044 + "type": "object",
  2045 + "properties": {
  2046 + "id": {
  2047 + "type": "integer",
  2048 + "format": "int64"
  2049 + }
  2050 + },
  2051 + "title": "DepartmentGetRequest",
  2052 + "required": [
  2053 + "id"
  2054 + ]
  2055 + },
  2056 + "DepartmentGetResponse": {
  2057 + "type": "object",
  2058 + "properties": {
  2059 + "department": {
  2060 + "$ref": "#/definitions/Department"
  2061 + }
  2062 + },
  2063 + "title": "DepartmentGetResponse",
  2064 + "required": [
  2065 + "department"
  2066 + ]
  2067 + },
  2068 + "DepartmentListRequest": {
  2069 + "type": "object",
  2070 + "properties": {
  2071 + "page": {
  2072 + "type": "integer",
  2073 + "format": "int32"
  2074 + },
  2075 + "size": {
  2076 + "type": "integer",
  2077 + "format": "int32"
  2078 + }
  2079 + },
  2080 + "title": "DepartmentListRequest",
  2081 + "required": [
  2082 + "page",
  2083 + "size"
  2084 + ]
  2085 + },
  2086 + "DepartmentListResponse": {
  2087 + "type": "object",
  2088 + "properties": {
  2089 + "list": {
  2090 + "type": "array",
  2091 + "items": {
  2092 + "$ref": "#/definitions/Department"
  2093 + }
  2094 + },
  2095 + "total": {
  2096 + "type": "integer",
  2097 + "format": "int64"
  2098 + }
  2099 + },
  2100 + "title": "DepartmentListResponse",
  2101 + "required": [
  2102 + "list",
  2103 + "total"
  2104 + ]
  2105 + },
  2106 + "DepartmentUpdateRequest": {
  2107 + "type": "object",
  2108 + "properties": {
  2109 + "id": {
  2110 + "type": "integer",
  2111 + "format": "int64"
  2112 + },
  2113 + "name": {
  2114 + "type": "string"
  2115 + }
  2116 + },
  2117 + "title": "DepartmentUpdateRequest",
  2118 + "required": [
  2119 + "id",
  2120 + "name"
  2121 + ]
  2122 + },
1683 "FollowRequest": { 2123 "FollowRequest": {
1684 "type": "object", 2124 "type": "object",
1685 "properties": { 2125 "properties": {
@@ -2008,11 +2448,28 @@ @@ -2008,11 +2448,28 @@
2008 "list" 2448 "list"
2009 ] 2449 ]
2010 }, 2450 },
2011 - "MiniArticleCreateRequest": { 2451 + "MiniArticleCommentAtUserRequest": {
2012 "type": "object", 2452 "type": "object",
2013 "properties": { 2453 "properties": {
2014 - "title": {  
2015 - "type": "string", 2454 + "articleId": {
  2455 + "type": "integer",
  2456 + "format": "int64"
  2457 + }
  2458 + },
  2459 + "title": "MiniArticleCommentAtUserRequest",
  2460 + "required": [
  2461 + "articleId"
  2462 + ]
  2463 + },
  2464 + "MiniArticleCommentAtUserResponse": {
  2465 + "type": "object",
  2466 + "title": "MiniArticleCommentAtUserResponse"
  2467 + },
  2468 + "MiniArticleCreateRequest": {
  2469 + "type": "object",
  2470 + "properties": {
  2471 + "title": {
  2472 + "type": "string",
2016 "description": "标题" 2473 "description": "标题"
2017 }, 2474 },
2018 "section": { 2475 "section": {
@@ -2077,12 +2534,21 @@ @@ -2077,12 +2534,21 @@
2077 "MiniArticleDraftCreateRequest": { 2534 "MiniArticleDraftCreateRequest": {
2078 "type": "object", 2535 "type": "object",
2079 "properties": { 2536 "properties": {
  2537 + "": {
  2538 + "type": "integer",
  2539 + "format": "int64"
  2540 + },
  2541 + "": {
  2542 + "type": "integer",
  2543 + "format": "int64",
  2544 + "description": " 发布人"
  2545 + },
2080 "template": { 2546 "template": {
2081 "type": "integer", 2547 "type": "integer",
2082 "format": "int32", 2548 "format": "int32",
2083 "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式" 2549 "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式"
2084 }, 2550 },
2085 - "content": { 2551 + "section": {
2086 "type": "array", 2552 "type": "array",
2087 "items": { 2553 "items": {
2088 "type": "string" 2554 "type": "string"
@@ -2091,27 +2557,359 @@ @@ -2091,27 +2557,359 @@
2091 }, 2557 },
2092 "title": { 2558 "title": {
2093 "type": "string", 2559 "type": "string",
2094 - "description": "标题" 2560 + "description": " 标题"
2095 }, 2561 },
2096 "images": { 2562 "images": {
2097 "type": "array", 2563 "type": "array",
2098 "items": { 2564 "items": {
2099 "type": "string" 2565 "type": "string"
2100 }, 2566 },
2101 - "description": "图片" 2567 + "description": " 图片"
  2568 + },
  2569 + "whoRead": {
  2570 + "type": "array",
  2571 + "items": {
  2572 + "type": "integer",
  2573 + "format": "int64"
  2574 + },
  2575 + "description": " 谁可以看"
  2576 + },
  2577 + "whoReview": {
  2578 + "type": "array",
  2579 + "items": {
  2580 + "type": "integer",
  2581 + "format": "int64"
  2582 + },
  2583 + "description": " 评论人"
  2584 + },
  2585 + "location": {
  2586 + "$ref": "#/definitions/Location",
  2587 + "description": " 坐标"
2102 } 2588 }
2103 }, 2589 },
2104 "title": "MiniArticleDraftCreateRequest", 2590 "title": "MiniArticleDraftCreateRequest",
2105 "required": [ 2591 "required": [
2106 "template", 2592 "template",
2107 - "content", 2593 + "section",
2108 "title", 2594 "title",
2109 - "images" 2595 + "images",
  2596 + "whoRead",
  2597 + "whoReview",
  2598 + "location"
2110 ] 2599 ]
2111 }, 2600 },
2112 "MiniArticleDraftCreateResponse": { 2601 "MiniArticleDraftCreateResponse": {
2113 "type": "object", 2602 "type": "object",
2114 - "title": "MiniArticleDraftCreateResponse" 2603 + "properties": {
  2604 + "id": {
  2605 + "type": "integer",
  2606 + "format": "int64"
  2607 + }
  2608 + },
  2609 + "title": "MiniArticleDraftCreateResponse",
  2610 + "required": [
  2611 + "id"
  2612 + ]
  2613 + },
  2614 + "MiniArticleDraftDeleteMeRequest": {
  2615 + "type": "object",
  2616 + "properties": {
  2617 + "": {
  2618 + "type": "integer",
  2619 + "format": "int64",
  2620 + "description": " 公司id"
  2621 + },
  2622 + "": {
  2623 + "type": "integer",
  2624 + "format": "int64",
  2625 + "description": " 发布人"
  2626 + },
  2627 + "id": {
  2628 + "type": "integer",
  2629 + "format": "int64"
  2630 + }
  2631 + },
  2632 + "title": "MiniArticleDraftDeleteMeRequest",
  2633 + "required": [
  2634 + "id"
  2635 + ]
  2636 + },
  2637 + "MiniArticleDraftDeleteMeResponse": {
  2638 + "type": "object",
  2639 + "properties": {
  2640 + "id": {
  2641 + "type": "integer",
  2642 + "format": "int64"
  2643 + }
  2644 + },
  2645 + "title": "MiniArticleDraftDeleteMeResponse",
  2646 + "required": [
  2647 + "id"
  2648 + ]
  2649 + },
  2650 + "MiniArticleDraftGetMeRequest": {
  2651 + "type": "object",
  2652 + "properties": {
  2653 + "": {
  2654 + "type": "integer",
  2655 + "format": "int64",
  2656 + "description": " 公司id"
  2657 + },
  2658 + "": {
  2659 + "type": "integer",
  2660 + "format": "int64",
  2661 + "description": " 发布人"
  2662 + },
  2663 + "id": {
  2664 + "type": "integer",
  2665 + "format": "int64"
  2666 + }
  2667 + },
  2668 + "title": "MiniArticleDraftGetMeRequest",
  2669 + "required": [
  2670 + "id"
  2671 + ]
  2672 + },
  2673 + "MiniArticleDraftGetMeResponse": {
  2674 + "type": "object",
  2675 + "properties": {
  2676 + "id": {
  2677 + "type": "integer",
  2678 + "format": "int64"
  2679 + },
  2680 + "template": {
  2681 + "type": "integer",
  2682 + "format": "int32",
  2683 + "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式"
  2684 + },
  2685 + "Section": {
  2686 + "type": "array",
  2687 + "items": {
  2688 + "type": "string"
  2689 + },
  2690 + "description": " 填写的内容"
  2691 + },
  2692 + "title": {
  2693 + "type": "string",
  2694 + "description": " 标题"
  2695 + },
  2696 + "images": {
  2697 + "type": "array",
  2698 + "items": {
  2699 + "type": "string"
  2700 + },
  2701 + "description": " 图片"
  2702 + },
  2703 + "whoRead": {
  2704 + "type": "array",
  2705 + "items": {
  2706 + "type": "integer",
  2707 + "format": "int64"
  2708 + },
  2709 + "description": " 谁可以看"
  2710 + },
  2711 + "whoReview": {
  2712 + "type": "array",
  2713 + "items": {
  2714 + "type": "integer",
  2715 + "format": "int64"
  2716 + },
  2717 + "description": " 评论人"
  2718 + },
  2719 + "location": {
  2720 + "$ref": "#/definitions/Location",
  2721 + "description": " 坐标"
  2722 + }
  2723 + },
  2724 + "title": "MiniArticleDraftGetMeResponse",
  2725 + "required": [
  2726 + "id",
  2727 + "template",
  2728 + "Section",
  2729 + "title",
  2730 + "images",
  2731 + "whoRead",
  2732 + "whoReview",
  2733 + "location"
  2734 + ]
  2735 + },
  2736 + "MiniArticleDraftItem": {
  2737 + "type": "object",
  2738 + "properties": {
  2739 + "id": {
  2740 + "type": "integer",
  2741 + "format": "int64"
  2742 + },
  2743 + "template": {
  2744 + "type": "integer",
  2745 + "format": "int32",
  2746 + "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式"
  2747 + },
  2748 + "section": {
  2749 + "type": "array",
  2750 + "items": {
  2751 + "type": "string"
  2752 + },
  2753 + "description": " 填写的内容"
  2754 + },
  2755 + "title": {
  2756 + "type": "string",
  2757 + "description": " 标题"
  2758 + },
  2759 + "images": {
  2760 + "type": "array",
  2761 + "items": {
  2762 + "type": "string"
  2763 + },
  2764 + "description": " 图片"
  2765 + },
  2766 + "createdAt": {
  2767 + "type": "integer",
  2768 + "format": "int64"
  2769 + }
  2770 + },
  2771 + "title": "MiniArticleDraftItem",
  2772 + "required": [
  2773 + "id",
  2774 + "template",
  2775 + "section",
  2776 + "title",
  2777 + "images",
  2778 + "createdAt"
  2779 + ]
  2780 + },
  2781 + "MiniArticleDraftSearchMeRequest": {
  2782 + "type": "object",
  2783 + "properties": {
  2784 + "": {
  2785 + "type": "integer",
  2786 + "format": "int64",
  2787 + "description": " 公司id"
  2788 + },
  2789 + "": {
  2790 + "type": "integer",
  2791 + "format": "int64",
  2792 + "description": " 发布人"
  2793 + },
  2794 + "page": {
  2795 + "type": "integer",
  2796 + "format": "int32"
  2797 + },
  2798 + "size": {
  2799 + "type": "integer",
  2800 + "format": "int32"
  2801 + }
  2802 + },
  2803 + "title": "MiniArticleDraftSearchMeRequest",
  2804 + "required": [
  2805 + "page",
  2806 + "size"
  2807 + ]
  2808 + },
  2809 + "MiniArticleDraftSearchMeResponse": {
  2810 + "type": "object",
  2811 + "properties": {
  2812 + "total": {
  2813 + "type": "integer",
  2814 + "format": "int64"
  2815 + },
  2816 + "list": {
  2817 + "type": "array",
  2818 + "items": {
  2819 + "$ref": "#/definitions/MiniArticleDraftItem"
  2820 + }
  2821 + }
  2822 + },
  2823 + "title": "MiniArticleDraftSearchMeResponse",
  2824 + "required": [
  2825 + "total",
  2826 + "list"
  2827 + ]
  2828 + },
  2829 + "MiniArticleDraftUpdateRequest": {
  2830 + "type": "object",
  2831 + "properties": {
  2832 + "id": {
  2833 + "type": "integer",
  2834 + "format": "int64"
  2835 + },
  2836 + "": {
  2837 + "type": "integer",
  2838 + "format": "int64"
  2839 + },
  2840 + "": {
  2841 + "type": "integer",
  2842 + "format": "int64",
  2843 + "description": " 发布人"
  2844 + },
  2845 + "template": {
  2846 + "type": "integer",
  2847 + "format": "int32",
  2848 + "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式"
  2849 + },
  2850 + "section": {
  2851 + "type": "array",
  2852 + "items": {
  2853 + "type": "string"
  2854 + },
  2855 + "description": " 填写的内容"
  2856 + },
  2857 + "title": {
  2858 + "type": "string",
  2859 + "description": " 标题"
  2860 + },
  2861 + "images": {
  2862 + "type": "array",
  2863 + "items": {
  2864 + "type": "string"
  2865 + },
  2866 + "description": " 图片"
  2867 + },
  2868 + "whoRead": {
  2869 + "type": "array",
  2870 + "items": {
  2871 + "type": "integer",
  2872 + "format": "int64"
  2873 + },
  2874 + "description": " 谁可以看"
  2875 + },
  2876 + "whoReview": {
  2877 + "type": "array",
  2878 + "items": {
  2879 + "type": "integer",
  2880 + "format": "int64"
  2881 + },
  2882 + "description": " 评论人"
  2883 + },
  2884 + "location": {
  2885 + "$ref": "#/definitions/Location",
  2886 + "description": " 坐标"
  2887 + }
  2888 + },
  2889 + "title": "MiniArticleDraftUpdateRequest",
  2890 + "required": [
  2891 + "id",
  2892 + "template",
  2893 + "section",
  2894 + "title",
  2895 + "images",
  2896 + "whoRead",
  2897 + "whoReview",
  2898 + "location"
  2899 + ]
  2900 + },
  2901 + "MiniArticleDraftUpdateResponse": {
  2902 + "type": "object",
  2903 + "properties": {
  2904 + "id": {
  2905 + "type": "integer",
  2906 + "format": "int64"
  2907 + }
  2908 + },
  2909 + "title": "MiniArticleDraftUpdateResponse",
  2910 + "required": [
  2911 + "id"
  2912 + ]
2115 }, 2913 },
2116 "MiniArticleGetRequest": { 2914 "MiniArticleGetRequest": {
2117 "type": "object", 2915 "type": "object",
@@ -2123,7 +2921,13 @@ @@ -2123,7 +2921,13 @@
2123 }, 2921 },
2124 "": { 2922 "": {
2125 "type": "integer", 2923 "type": "integer",
2126 - "format": "int64" 2924 + "format": "int64",
  2925 + "description": "当前公司"
  2926 + },
  2927 + "": {
  2928 + "type": "integer",
  2929 + "format": "int32",
  2930 + "description": "当前用户"
2127 } 2931 }
2128 }, 2932 },
2129 "title": "MiniArticleGetRequest", 2933 "title": "MiniArticleGetRequest",
@@ -2149,7 +2953,7 @@ @@ -2149,7 +2953,7 @@
2149 "description": "发布人id" 2953 "description": "发布人id"
2150 }, 2954 },
2151 "author": { 2955 "author": {
2152 - "$ref": "#/definitions/Author", 2956 + "$ref": "#/definitions/ArticleAuthor",
2153 "description": "发布人" 2957 "description": "发布人"
2154 }, 2958 },
2155 "createdAt": { 2959 "createdAt": {
@@ -2215,6 +3019,11 @@ @@ -2215,6 +3019,11 @@
2215 "type": "integer", 3019 "type": "integer",
2216 "format": "int32", 3020 "format": "int32",
2217 "description": " 文章是否存在变更记录 (0 不存在 1存在)" 3021 "description": " 文章是否存在变更记录 (0 不存在 1存在)"
  3022 + },
  3023 + "meLoveFlag": {
  3024 + "type": "integer",
  3025 + "format": "int32",
  3026 + "description": "当前人员对文章的点赞标识"
2218 } 3027 }
2219 }, 3028 },
2220 "title": "MiniArticleGetResponse", 3029 "title": "MiniArticleGetResponse",
@@ -2233,7 +3042,88 @@ @@ -2233,7 +3042,88 @@
2233 "countComment", 3042 "countComment",
2234 "countRead", 3043 "countRead",
2235 "show", 3044 "show",
2236 - "edit" 3045 + "edit",
  3046 + "meLoveFlag"
  3047 + ]
  3048 + },
  3049 + "MiniArticleMarkItem": {
  3050 + "type": "object",
  3051 + "properties": {
  3052 + "id": {
  3053 + "type": "integer",
  3054 + "format": "int64"
  3055 + },
  3056 + "companyId": {
  3057 + "type": "integer",
  3058 + "format": "int64"
  3059 + },
  3060 + "userId": {
  3061 + "type": "integer",
  3062 + "format": "int64"
  3063 + },
  3064 + "articleId": {
  3065 + "type": "integer",
  3066 + "format": "int64"
  3067 + },
  3068 + "title": {
  3069 + "type": "string"
  3070 + },
  3071 + "author": {
  3072 + "$ref": "#/definitions/SimpleUser",
  3073 + "description": " 发布人"
  3074 + },
  3075 + "updatedAt": {
  3076 + "type": "integer",
  3077 + "format": "int64"
  3078 + }
  3079 + },
  3080 + "title": "MiniArticleMarkItem",
  3081 + "required": [
  3082 + "id",
  3083 + "companyId",
  3084 + "userId",
  3085 + "articleId",
  3086 + "title",
  3087 + "author",
  3088 + "updatedAt"
  3089 + ]
  3090 + },
  3091 + "MiniArticleMarkListRequest": {
  3092 + "type": "object",
  3093 + "properties": {
  3094 + "page": {
  3095 + "type": "integer",
  3096 + "format": "int32"
  3097 + },
  3098 + "size": {
  3099 + "type": "integer",
  3100 + "format": "int32"
  3101 + }
  3102 + },
  3103 + "title": "MiniArticleMarkListRequest",
  3104 + "required": [
  3105 + "page",
  3106 + "size"
  3107 + ]
  3108 + },
  3109 + "MiniArticleMarkListResponse": {
  3110 + "type": "object",
  3111 + "properties": {
  3112 + "total": {
  3113 + "type": "integer",
  3114 + "format": "int64"
  3115 + },
  3116 + "list": {
  3117 + "type": "array",
  3118 + "items": {
  3119 + "$ref": "#/definitions/MiniArticleMarkItem"
  3120 + }
  3121 + }
  3122 + },
  3123 + "title": "MiniArticleMarkListResponse",
  3124 + "required": [
  3125 + "total",
  3126 + "list"
2237 ] 3127 ]
2238 }, 3128 },
2239 "MiniArticleMarkUserReadRequest": { 3129 "MiniArticleMarkUserReadRequest": {
@@ -2268,55 +3158,193 @@ @@ -2268,55 +3158,193 @@
2268 "format": "int64" 3158 "format": "int64"
2269 } 3159 }
2270 }, 3160 },
2271 - "title": "MiniArticleMarkUserReadResponse", 3161 + "title": "MiniArticleMarkUserReadResponse",
  3162 + "required": [
  3163 + "id"
  3164 + ]
  3165 + },
  3166 + "MiniArticleSearchMeRequest": {
  3167 + "type": "object",
  3168 + "properties": {
  3169 + "": {
  3170 + "type": "integer",
  3171 + "format": "int64"
  3172 + },
  3173 + "": {
  3174 + "type": "integer",
  3175 + "format": "int64"
  3176 + },
  3177 + "page": {
  3178 + "type": "integer",
  3179 + "format": "int32"
  3180 + },
  3181 + "size": {
  3182 + "type": "integer",
  3183 + "format": "int32"
  3184 + }
  3185 + },
  3186 + "title": "MiniArticleSearchMeRequest",
  3187 + "required": [
  3188 + "page",
  3189 + "size"
  3190 + ]
  3191 + },
  3192 + "MiniArticleSearchMeResponse": {
  3193 + "type": "object",
  3194 + "properties": {
  3195 + "total": {
  3196 + "type": "integer",
  3197 + "format": "int32"
  3198 + },
  3199 + "list": {
  3200 + "type": "array",
  3201 + "items": {
  3202 + "$ref": "#/definitions/ArticleSearchMe"
  3203 + }
  3204 + }
  3205 + },
  3206 + "title": "MiniArticleSearchMeResponse",
  3207 + "required": [
  3208 + "total",
  3209 + "list"
  3210 + ]
  3211 + },
  3212 + "MiniCreateArticleCommentRequest": {
  3213 + "type": "object",
  3214 + "properties": {
  3215 + "articleId": {
  3216 + "type": "integer",
  3217 + "format": "int64",
  3218 + "description": " 文章id"
  3219 + },
  3220 + "sectionId": {
  3221 + "type": "integer",
  3222 + "format": "int64",
  3223 + "description": " 段落id"
  3224 + },
  3225 + "": {
  3226 + "type": "integer",
  3227 + "format": "int64",
  3228 + "description": " 填写文章的人,服务端自动获取"
  3229 + },
  3230 + "": {
  3231 + "type": "integer",
  3232 + "format": "int64",
  3233 + "description": " 服务端自动获取"
  3234 + },
  3235 + "commnet": {
  3236 + "type": "integer",
  3237 + "format": "int64",
  3238 + "description": " 回复那个评论的id"
  3239 + },
  3240 + "content": {
  3241 + "type": "string",
  3242 + "description": " 评论的内容"
  3243 + },
  3244 + "atWho": {
  3245 + "type": "array",
  3246 + "items": {
  3247 + "type": "integer",
  3248 + "format": "int64"
  3249 + },
  3250 + "description": " 填写评论时@的人"
  3251 + }
  3252 + },
  3253 + "title": "MiniCreateArticleCommentRequest",
2272 "required": [ 3254 "required": [
2273 - "id" 3255 + "articleId",
  3256 + "sectionId",
  3257 + "commnet",
  3258 + "content",
  3259 + "atWho"
2274 ] 3260 ]
2275 }, 3261 },
2276 - "MiniArticleSearchMeRequest": { 3262 + "MiniCreateArticleCommentResponse": {
2277 "type": "object", 3263 "type": "object",
2278 "properties": { 3264 "properties": {
2279 - "": { 3265 + "id": {
2280 "type": "integer", 3266 "type": "integer",
2281 "format": "int64" 3267 "format": "int64"
2282 }, 3268 },
2283 - "": { 3269 + "pid": {
2284 "type": "integer", 3270 "type": "integer",
2285 "format": "int64" 3271 "format": "int64"
2286 }, 3272 },
2287 - "page": { 3273 + "topId": {
2288 "type": "integer", 3274 "type": "integer",
2289 - "format": "int32" 3275 + "format": "int64"
2290 }, 3276 },
2291 - "size": { 3277 + "articleId": {
2292 "type": "integer", 3278 "type": "integer",
2293 - "format": "int32"  
2294 - } 3279 + "format": "int64",
  3280 + "description": " 文章id"
2295 }, 3281 },
2296 - "title": "MiniArticleSearchMeRequest",  
2297 - "required": [  
2298 - "page",  
2299 - "size"  
2300 - ] 3282 + "sectionId": {
  3283 + "type": "integer",
  3284 + "format": "int64",
  3285 + "description": " 段落id"
2301 }, 3286 },
2302 - "MiniArticleSearchMeResponse": {  
2303 - "type": "object",  
2304 - "properties": {  
2305 - "total": { 3287 + "fromUserId": {
2306 "type": "integer", 3288 "type": "integer",
2307 - "format": "int32" 3289 + "format": "int64",
  3290 + "description": " 填写评论的人"
2308 }, 3291 },
2309 - "list": { 3292 + "fromUser": {
  3293 + "$ref": "#/definitions/CommentAuthor",
  3294 + "description": " 填写评论的人"
  3295 + },
  3296 + "toUserId": {
  3297 + "type": "integer",
  3298 + "format": "int64",
  3299 + "description": " 回复哪个人"
  3300 + },
  3301 + "toUser": {
  3302 + "$ref": "#/definitions/CommentAuthor",
  3303 + "description": " 回复哪个人"
  3304 + },
  3305 + "sectionContent": {
  3306 + "type": "string",
  3307 + "description": " 引用的文章内容文本"
  3308 + },
  3309 + "countReply": {
  3310 + "type": "integer",
  3311 + "format": "int32",
  3312 + "description": " 回复数量"
  3313 + },
  3314 + "countUserLove": {
  3315 + "type": "integer",
  3316 + "format": "int32",
  3317 + "description": " 用户点赞数量"
  3318 + },
  3319 + "countAdminLove": {
  3320 + "type": "integer",
  3321 + "format": "int32",
  3322 + "description": " 运营点赞数量"
  3323 + },
  3324 + "atWho": {
2310 "type": "array", 3325 "type": "array",
2311 "items": { 3326 "items": {
2312 - "$ref": "#/definitions/ArticleSearchMe"  
2313 - } 3327 + "$ref": "#/definitions/CommentAuthor"
  3328 + },
  3329 + "description": " 填写评论时@的人"
2314 } 3330 }
2315 }, 3331 },
2316 - "title": "MiniArticleSearchMeResponse", 3332 + "title": "MiniCreateArticleCommentResponse",
2317 "required": [ 3333 "required": [
2318 - "total",  
2319 - "list" 3334 + "id",
  3335 + "pid",
  3336 + "topId",
  3337 + "articleId",
  3338 + "sectionId",
  3339 + "fromUserId",
  3340 + "fromUser",
  3341 + "toUserId",
  3342 + "toUser",
  3343 + "sectionContent",
  3344 + "countReply",
  3345 + "countUserLove",
  3346 + "countAdminLove",
  3347 + "atWho"
2320 ] 3348 ]
2321 }, 3349 },
2322 "MiniMyLikeRequest": { 3350 "MiniMyLikeRequest": {
@@ -3122,7 +4150,7 @@ @@ -3122,7 +4150,7 @@
3122 "description": " 发布人id" 4150 "description": " 发布人id"
3123 }, 4151 },
3124 "author": { 4152 "author": {
3125 - "$ref": "#/definitions/Author", 4153 + "$ref": "#/definitions/ArticleAuthor",
3126 "description": " 发布人" 4154 "description": " 发布人"
3127 }, 4155 },
3128 "createdAt": { 4156 "createdAt": {
@@ -3219,6 +4247,57 @@ @@ -3219,6 +4247,57 @@
3219 "show" 4247 "show"
3220 ] 4248 ]
3221 }, 4249 },
  4250 + "SystemArticleHistoryRequest": {
  4251 + "type": "object",
  4252 + "properties": {
  4253 + "articleId": {
  4254 + "type": "integer",
  4255 + "format": "int64",
  4256 + "description": "文章ID"
  4257 + },
  4258 + "author": {
  4259 + "type": "string",
  4260 + "description": "发布人"
  4261 + },
  4262 + "updatedAt": {
  4263 + "type": "string",
  4264 + "description": "修改日期"
  4265 + }
  4266 + },
  4267 + "title": "SystemArticleHistoryRequest",
  4268 + "required": [
  4269 + "articleId"
  4270 + ]
  4271 + },
  4272 + "SystemArticleHistoryResponse": {
  4273 + "type": "object",
  4274 + "properties": {
  4275 + "id": {
  4276 + "type": "integer",
  4277 + "format": "int64",
  4278 + "description": "id"
  4279 + },
  4280 + "author": {
  4281 + "type": "string",
  4282 + "description": "编辑人"
  4283 + },
  4284 + "action": {
  4285 + "type": "string",
  4286 + "description": "编辑类型"
  4287 + },
  4288 + "updatedAt": {
  4289 + "type": "string",
  4290 + "description": "编辑时间"
  4291 + }
  4292 + },
  4293 + "title": "SystemArticleHistoryResponse",
  4294 + "required": [
  4295 + "id",
  4296 + "author",
  4297 + "action",
  4298 + "updatedAt"
  4299 + ]
  4300 + },
3222 "SystemArticleSearch": { 4301 "SystemArticleSearch": {
3223 "type": "object", 4302 "type": "object",
3224 "properties": { 4303 "properties": {
@@ -3296,19 +4375,36 @@ @@ -3296,19 +4375,36 @@
3296 "type": "integer", 4375 "type": "integer",
3297 "format": "int64" 4376 "format": "int64"
3298 }, 4377 },
3299 - "page": { 4378 + "title": {
  4379 + "type": "string",
  4380 + "description": "标题"
  4381 + },
  4382 + "author": {
  4383 + "type": "string",
  4384 + "description": "发布人"
  4385 + },
  4386 + "publishDate": {
  4387 + "type": "string",
  4388 + "description": "发布日期"
  4389 + },
  4390 + "pageNumber": {
3300 "type": "integer", 4391 "type": "integer",
3301 - "format": "int32" 4392 + "format": "int32",
  4393 + "description": "页码"
3302 }, 4394 },
3303 - "size": { 4395 + "pageSize": {
3304 "type": "integer", 4396 "type": "integer",
3305 - "format": "int32" 4397 + "format": "int32",
  4398 + "description": "每页行数"
3306 } 4399 }
3307 }, 4400 },
3308 "title": "SystemArticleSearchRequest", 4401 "title": "SystemArticleSearchRequest",
3309 "required": [ 4402 "required": [
3310 - "page",  
3311 - "size" 4403 + "title",
  4404 + "author",
  4405 + "publishDate",
  4406 + "pageNumber",
  4407 + "pageSize"
3312 ] 4408 ]
3313 }, 4409 },
3314 "SystemArticleSearchResponse": { 4410 "SystemArticleSearchResponse": {
@@ -3331,6 +4427,149 @@ @@ -3331,6 +4427,149 @@
3331 "list" 4427 "list"
3332 ] 4428 ]
3333 }, 4429 },
  4430 + "SystemArticleUpdateRequest": {
  4431 + "type": "object",
  4432 + "properties": {
  4433 + "id": {
  4434 + "type": "integer",
  4435 + "format": "int64"
  4436 + },
  4437 + "": {
  4438 + "type": "integer",
  4439 + "format": "int64"
  4440 + },
  4441 + "template": {
  4442 + "type": "integer",
  4443 + "format": "int32",
  4444 + "description": " 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式"
  4445 + },
  4446 + "section": {
  4447 + "type": "array",
  4448 + "items": {
  4449 + "$ref": "#/definitions/ArticleSection"
  4450 + },
  4451 + "description": " 填写的内容"
  4452 + },
  4453 + "title": {
  4454 + "type": "string",
  4455 + "description": " 标题"
  4456 + },
  4457 + "images": {
  4458 + "type": "array",
  4459 + "items": {
  4460 + "type": "string"
  4461 + },
  4462 + "description": " 图片"
  4463 + },
  4464 + "whoRead": {
  4465 + "type": "array",
  4466 + "items": {
  4467 + "type": "integer",
  4468 + "format": "int64"
  4469 + },
  4470 + "description": " 谁可以看"
  4471 + },
  4472 + "whoReview": {
  4473 + "type": "array",
  4474 + "items": {
  4475 + "type": "integer",
  4476 + "format": "int64"
  4477 + },
  4478 + "description": " 评论人"
  4479 + },
  4480 + "location": {
  4481 + "$ref": "#/definitions/Location",
  4482 + "description": " 坐标"
  4483 + },
  4484 + "targetUser": {
  4485 + "type": "integer",
  4486 + "format": "int32",
  4487 + "description": "分发方式 [0分发给所有人、1分发给指定的人]"
  4488 + }
  4489 + },
  4490 + "title": "SystemArticleUpdateRequest",
  4491 + "required": [
  4492 + "id",
  4493 + "template",
  4494 + "section",
  4495 + "title",
  4496 + "images",
  4497 + "whoRead",
  4498 + "whoReview",
  4499 + "location",
  4500 + "targetUser"
  4501 + ]
  4502 + },
  4503 + "SystemArticleUpdateResponse": {
  4504 + "type": "object",
  4505 + "properties": {
  4506 + "id": {
  4507 + "type": "integer",
  4508 + "format": "int64",
  4509 + "description": "id"
  4510 + },
  4511 + "title": {
  4512 + "type": "string",
  4513 + "description": "标题"
  4514 + },
  4515 + "author": {
  4516 + "type": "string",
  4517 + "description": "发布人"
  4518 + },
  4519 + "images": {
  4520 + "type": "array",
  4521 + "items": {
  4522 + "type": "string"
  4523 + },
  4524 + "description": "图片"
  4525 + },
  4526 + "createdAt": {
  4527 + "type": "integer",
  4528 + "format": "int64",
  4529 + "description": "文章的创建日期"
  4530 + },
  4531 + "countLove": {
  4532 + "type": "integer",
  4533 + "format": "int32",
  4534 + "description": "点赞数量"
  4535 + },
  4536 + "CountComment": {
  4537 + "type": "integer",
  4538 + "format": "int32",
  4539 + "description": "评论数量"
  4540 + },
  4541 + "show": {
  4542 + "type": "integer",
  4543 + "format": "int32",
  4544 + "description": "是否隐藏 [0显示、1不显示]"
  4545 + },
  4546 + "tags": {
  4547 + "type": "array",
  4548 + "items": {
  4549 + "type": "string"
  4550 + },
  4551 + "description": "标签"
  4552 + },
  4553 + "targetUser": {
  4554 + "type": "integer",
  4555 + "format": "int32",
  4556 + "description": "分发方式 [0分发给所有人、1分发给指定的人]"
  4557 + }
  4558 + },
  4559 + "title": "SystemArticleUpdateResponse",
  4560 + "required": [
  4561 + "id",
  4562 + "title",
  4563 + "author",
  4564 + "images",
  4565 + "createdAt",
  4566 + "countLove",
  4567 + "CountComment",
  4568 + "show",
  4569 + "tags",
  4570 + "targetUser"
  4571 + ]
  4572 + },
3334 "SystemUser": { 4573 "SystemUser": {
3335 "type": "object", 4574 "type": "object",
3336 "properties": { 4575 "properties": {
@@ -4185,8 +5424,7 @@ @@ -4185,8 +5424,7 @@
4185 "format": "int32" 5424 "format": "int32"
4186 }, 5425 },
4187 "name": { 5426 "name": {
4188 - "type": "integer",  
4189 - "format": "int32" 5427 + "type": "string"
4190 } 5428 }
4191 }, 5429 },
4192 "title": "UserShowName", 5430 "title": "UserShowName",
@@ -69,7 +69,7 @@ service Core { @@ -69,7 +69,7 @@ service Core {
69 @server( 69 @server(
70 prefix: v1/system 70 prefix: v1/system
71 group: article 71 group: article
72 - jwt: MiniAuth 72 + jwt: SystemAuth
73 ) 73 )
74 service Core { 74 service Core {
75 @doc "管理后台获取文章内容详情" 75 @doc "管理后台获取文章内容详情"
@@ -79,4 +79,12 @@ service Core { @@ -79,4 +79,12 @@ service Core {
79 @doc "管理后台获取文章列表" 79 @doc "管理后台获取文章列表"
80 @handler SystemSearchArticle 80 @handler SystemSearchArticle
81 post /article/search (SystemArticleSearchRequest) returns (SystemArticleSearchResponse) 81 post /article/search (SystemArticleSearchRequest) returns (SystemArticleSearchResponse)
  82 +
  83 + @doc "管理后台编辑帖子"
  84 + @handler SystemUpdateArticle
  85 + put /article (SystemArticleUpdateRequest) returns (SystemArticleUpdateResponse)
  86 +
  87 + @doc "管理后台编辑历史"
  88 + @handler SystemHistoryArticle
  89 + post /article/history (SystemArticleHistoryRequest) returns (SystemArticleHistoryResponse)
82 } 90 }
@@ -290,7 +290,7 @@ type ( @@ -290,7 +290,7 @@ type (
290 290
291 UserShowName { 291 UserShowName {
292 Id int `json:"id"` 292 Id int `json:"id"`
293 - Name int `json:"name"` 293 + Name string `json:"name"`
294 } 294 }
295 295
296 SystemArticleGetResponse { 296 SystemArticleGetResponse {
@@ -317,8 +317,11 @@ type ( @@ -317,8 +317,11 @@ type (
317 type ( 317 type (
318 SystemArticleSearchRequest { 318 SystemArticleSearchRequest {
319 CompanyId int64 `json:",optional"` 319 CompanyId int64 `json:",optional"`
320 - Page int `json:"page"`  
321 - Size int `json:"size"` 320 + Title string `json:"title"` //标题
  321 + Author string `json:"author"` //发布人
  322 + PublishDate string `json:"publishDate"` //发布日期
  323 + PageNumber int `json:"pageNumber"` //页码
  324 + PageSize int `json:"pageSize"` //每页行数
322 } 325 }
323 326
324 SystemArticleSearchResponse { 327 SystemArticleSearchResponse {
@@ -337,4 +340,41 @@ type ( @@ -337,4 +340,41 @@ type (
337 Tags []string `json:"tags"` //标签 340 Tags []string `json:"tags"` //标签
338 TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人] 341 TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人]
339 } 342 }
  343 + //编辑
  344 + SystemArticleUpdateRequest {
  345 + Id int64 `json:"id"`
  346 + CompanyId int64 `json:",optional"`
  347 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  348 + Section []ArticleSection `json:"section"` // 填写的内容
  349 + Title string `json:"title"` // 标题
  350 + Images []string `json:"images"` // 图片
  351 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  352 + WhoReview []int64 `json:"whoReview"` // 评论人
  353 + Location Location `json:"location"` // 坐标
  354 + TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人]
  355 + }
  356 + SystemArticleUpdateResponse {
  357 + Id int64 `json:"id"` //id
  358 + Title string `json:"title"` //标题
  359 + Author string `json:"author"` //发布人
  360 + Images []string `json:"images"` //图片
  361 + CreatedAt int64 `json:"createdAt"` //文章的创建日期
  362 + CountLove int `json:"countLove"` //点赞数量
  363 + CountComment int `json:"CountComment"` //评论数量
  364 + Show int `json:"show"` //是否隐藏 [0显示、1不显示]
  365 + Tags []string `json:"tags"` //标签
  366 + TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人]
  367 + }
  368 + //历史
  369 + SystemArticleHistoryRequest {
  370 + ArticleId int64 `json:"articleId"` //文章ID
  371 + Author string `json:"author,optional"` //发布人
  372 + UpdatedAt string `json:"updatedAt,optional"` //修改日期
  373 + }
  374 + SystemArticleHistoryResponse {
  375 + Id int64 `json:"id"` //id
  376 + Author string `json:"author"` //编辑人
  377 + Action string `json:"action"` //编辑类型
  378 + UpdatedAt string `json:"updatedAt"` //编辑时间
  379 + }
340 ) 380 )
@@ -44,18 +44,18 @@ service Core { @@ -44,18 +44,18 @@ service Core {
44 } 44 }
45 45
46 type ( 46 type (
47 - CompanySearchRequest struct{ 47 + CompanySearchRequest {
48 Page int `json:"page,optional"` 48 Page int `json:"page,optional"`
49 Size int `json:"size,optional"` 49 Size int `json:"size,optional"`
50 Flag int `json:"flag,optional"` // 1:用户已加入的 2:用户未加入的公司 50 Flag int `json:"flag,optional"` // 1:用户已加入的 2:用户未加入的公司
51 UserId int64 `json:"userId,optional"` // 按用户搜索(用户所加入的企业) 51 UserId int64 `json:"userId,optional"` // 按用户搜索(用户所加入的企业)
52 Code string `json:"code,optional"` // 按编码搜索 52 Code string `json:"code,optional"` // 按编码搜索
53 } 53 }
54 - CompanySearchResponse{ 54 + CompanySearchResponse {
55 List []Company `json:"list"` 55 List []Company `json:"list"`
56 Total int64 `json:"total"` 56 Total int64 `json:"total"`
57 } 57 }
58 - Company struct{ 58 + Company {
59 Id int64 `json:"id,omitempty"` // 唯一标识 59 Id int64 `json:"id,omitempty"` // 唯一标识
60 Name string `json:"name,omitempty"` // 名称 60 Name string `json:"name,omitempty"` // 名称
61 Code string `json:"code,omitempty"` // 编码(搜索使用,4位字母数字) 61 Code string `json:"code,omitempty"` // 编码(搜索使用,4位字母数字)
@@ -30,37 +30,37 @@ type ( @@ -30,37 +30,37 @@ type (
30 RoleGetRequest { 30 RoleGetRequest {
31 Id int64 `path:"id"` 31 Id int64 `path:"id"`
32 } 32 }
33 - RoleGetResponse struct{ 33 + RoleGetResponse {
34 Role RoleItem `json:"role"` 34 Role RoleItem `json:"role"`
35 AuthList []Auth `json:"authList"` 35 AuthList []Auth `json:"authList"`
36 } 36 }
37 37
38 - RoleSaveRequest struct{ 38 + RoleSaveRequest {
39 Role RoleItem `json:"role"` 39 Role RoleItem `json:"role"`
40 } 40 }
41 RoleSaveResponse struct{} 41 RoleSaveResponse struct{}
42 42
43 - RoleDeleteRequest struct{ 43 + RoleDeleteRequest {
44 Id int64 `path:"id"` 44 Id int64 `path:"id"`
45 } 45 }
46 RoleDeleteResponse struct{} 46 RoleDeleteResponse struct{}
47 47
48 - RoleUpdateRequest struct{ 48 + RoleUpdateRequest {
49 Id int64 `path:"id"` 49 Id int64 `path:"id"`
50 Role RoleItem `json:"role"` 50 Role RoleItem `json:"role"`
51 } 51 }
52 RoleUpdateResponse struct{} 52 RoleUpdateResponse struct{}
53 53
54 - RoleSearchRequest struct{ 54 + RoleSearchRequest {
55 Page int `json:"page,optional"` 55 Page int `json:"page,optional"`
56 Size int `json:"size,optional"` 56 Size int `json:"size,optional"`
57 Style string `json:"style,options=[simple,,full]"` // simple:只返回角色ID名称 full:所有字段都返回 57 Style string `json:"style,options=[simple,,full]"` // simple:只返回角色ID名称 full:所有字段都返回
58 } 58 }
59 - RoleSearchResponse{ 59 + RoleSearchResponse {
60 List []RoleItem `json:"list"` 60 List []RoleItem `json:"list"`
61 Total int64 `json:"total"` 61 Total int64 `json:"total"`
62 } 62 }
63 - RoleItem struct{ 63 + RoleItem {
64 Id int64 `json:"id,optional"` // 角色ID 64 Id int64 `json:"id,optional"` // 角色ID
65 CompanyId int64 `json:"companyId,optional,omitempty"` // 公司ID 65 CompanyId int64 `json:"companyId,optional,omitempty"` // 公司ID
66 Name string `json:"name"` // 角色名称 66 Name string `json:"name"` // 角色名称
  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 SystemHistoryArticleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  13 + return func(w http.ResponseWriter, r *http.Request) {
  14 + var req types.SystemArticleHistoryRequest
  15 + if err := httpx.Parse(r, &req); err != nil {
  16 + httpx.ErrorCtx(r.Context(), w, err)
  17 + return
  18 + }
  19 +
  20 + l := article.NewSystemHistoryArticleLogic(r.Context(), svcCtx)
  21 + resp, err := l.SystemHistoryArticle(&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 + "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 SystemUpdateArticleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  13 + return func(w http.ResponseWriter, r *http.Request) {
  14 + var req types.SystemArticleUpdateRequest
  15 + if err := httpx.Parse(r, &req); err != nil {
  16 + httpx.ErrorCtx(r.Context(), w, err)
  17 + return
  18 + }
  19 +
  20 + l := article.NewSystemUpdateArticleLogic(r.Context(), svcCtx)
  21 + resp, err := l.SystemUpdateArticle(&req)
  22 + if err != nil {
  23 + httpx.ErrorCtx(r.Context(), w, err)
  24 + } else {
  25 + httpx.OkJsonCtx(r.Context(), w, resp)
  26 + }
  27 + }
  28 +}
@@ -333,8 +333,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { @@ -333,8 +333,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
333 Path: "/article/search", 333 Path: "/article/search",
334 Handler: article.SystemSearchArticleHandler(serverCtx), 334 Handler: article.SystemSearchArticleHandler(serverCtx),
335 }, 335 },
  336 + {
  337 + Method: http.MethodPut,
  338 + Path: "/article",
  339 + Handler: article.SystemUpdateArticleHandler(serverCtx),
336 }, 340 },
337 - rest.WithJwt(serverCtx.Config.MiniAuth.AccessSecret), 341 + {
  342 + Method: http.MethodPost,
  343 + Path: "/article/history",
  344 + Handler: article.SystemHistoryArticleHandler(serverCtx),
  345 + },
  346 + },
  347 + rest.WithJwt(serverCtx.Config.SystemAuth.AccessSecret),
338 rest.WithPrefix("/v1/system"), 348 rest.WithPrefix("/v1/system"),
339 ) 349 )
340 350
@@ -2,6 +2,9 @@ package article @@ -2,6 +2,9 @@ package article
2 2
3 import ( 3 import (
4 "context" 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/xerr"
5 8
6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" 9 "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" 10 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
@@ -24,7 +27,79 @@ func NewSystemGetArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext) * @@ -24,7 +27,79 @@ func NewSystemGetArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
24 } 27 }
25 28
26 func (l *SystemGetArticleLogic) SystemGetArticle(req *types.SystemArticleGetRequest) (resp *types.SystemArticleGetResponse, err error) { 29 func (l *SystemGetArticleLogic) SystemGetArticle(req *types.SystemArticleGetRequest) (resp *types.SystemArticleGetResponse, err error) {
27 - // todo: add your logic here and delete this line  
28 -  
29 - return 30 + var conn = l.svcCtx.DefaultDBConn()
  31 + article, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.Id)
  32 + if err != nil {
  33 + return nil, xerr.NewErrMsgErr("获取帖子异常", err)
  34 + }
  35 + images := make([]string, 0)
  36 + lo.ForEach(article.Images, func(img domain.Image, n int) {
  37 + images = append(images, img.Url)
  38 + })
  39 + resp = &types.SystemArticleGetResponse{
  40 + Id: article.Id,
  41 + Title: article.Title,
  42 + AuthorId: article.AuthorId,
  43 + Author: types.ArticleAuthor{
  44 + Id: article.Author.Id,
  45 + Name: article.Author.Name,
  46 + Avatar: article.Author.Avatar,
  47 + Position: article.Author.Position,
  48 + Company: article.Author.Company,
  49 + },
  50 + CreatedAt: article.CreatedAt,
  51 + Section: make([]types.ArticleSection, 0),
  52 + Images: images,
  53 + WhoRead: article.WhoRead,
  54 + WhoReadInfo: make([]types.UserShowName, 0),
  55 + WhoReview: article.WhoReview,
  56 + WhoReviewInfo: make([]types.UserShowName, 0),
  57 + Location: types.Location{
  58 + Longitude: article.Location.Longitude,
  59 + Latitude: article.Location.Latitude,
  60 + Descript: article.Location.Descript,
  61 + },
  62 + CountLove: article.CountLove,
  63 + CountComment: article.CountComment,
  64 + CountRead: article.CountRead,
  65 + Show: int(article.Show),
  66 + }
  67 + //文章段落
  68 + _, articleSections, err := l.svcCtx.ArticleSectionRepository.Find(l.ctx, conn, domain.NewQueryOptions().WithKV("articleId", req.Id))
  69 + if err != nil {
  70 + return nil, xerr.NewErrMsgErr("获取帖子异常", err)
  71 + }
  72 + lo.ForEach(articleSections, func(item *domain.ArticleSection, index int) {
  73 + resp.Section = append(resp.Section, types.ArticleSection{
  74 + Id: item.Id,
  75 + Content: item.Content,
  76 + SortBy: item.SortBy,
  77 + TotalComment: item.TotalComment,
  78 + })
  79 + })
  80 + userIds := lo.Union(resp.WhoRead, resp.WhoReview)
  81 + if len(userIds) > 0 {
  82 + _, users, err := l.svcCtx.UserRepository.Find(l.ctx, conn, domain.NewQueryOptions().WithKV("ids", userIds))
  83 + if err != nil {
  84 + return nil, xerr.NewErrMsgErr("获取帖子异常", err)
  85 + }
  86 + userSlices := make(map[int64]types.UserShowName)
  87 + lo.ForEach(users, func(user *domain.User, index int) {
  88 + userSlices[user.Id] = types.UserShowName{
  89 + Id: int(user.Id),
  90 + Name: user.Name,
  91 + }
  92 + })
  93 + lo.ForEach(resp.WhoRead, func(userId int64, index int) {
  94 + if value, ok := userSlices[userId]; ok {
  95 + resp.WhoReadInfo = append(resp.WhoReadInfo, value)
  96 + }
  97 + })
  98 + lo.ForEach(resp.WhoReview, func(userId int64, index int) {
  99 + if value, ok := userSlices[userId]; ok {
  100 + resp.WhoReviewInfo = append(resp.WhoReviewInfo, value)
  101 + }
  102 + })
  103 + }
  104 + return resp, nil
30 } 105 }
  1 +package article
  2 +
  3 +import (
  4 + "context"
  5 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
  6 +
  7 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
  8 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
  9 +
  10 + "github.com/zeromicro/go-zero/core/logx"
  11 +)
  12 +
  13 +type SystemHistoryArticleLogic struct {
  14 + logx.Logger
  15 + ctx context.Context
  16 + svcCtx *svc.ServiceContext
  17 +}
  18 +
  19 +func NewSystemHistoryArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SystemHistoryArticleLogic {
  20 + return &SystemHistoryArticleLogic{
  21 + Logger: logx.WithContext(ctx),
  22 + ctx: ctx,
  23 + svcCtx: svcCtx,
  24 + }
  25 +}
  26 +
  27 +func (l *SystemHistoryArticleLogic) SystemHistoryArticle(req *types.SystemArticleHistoryRequest) (resp *types.SystemArticleHistoryResponse, err error) {
  28 + var conn = l.svcCtx.DefaultDBConn()
  29 + l.svcCtx.ArticleBackupRepository.Find(
  30 + l.ctx,
  31 + conn,
  32 + domain.NewQueryOptions().
  33 + WithKV("articleId", req.ArticleId).
  34 + WithKV("author", req.Author).
  35 + WithKV("updatedAt", req.UpdatedAt),
  36 + )
  37 + return
  38 +}
@@ -2,6 +2,9 @@ package article @@ -2,6 +2,9 @@ package article
2 2
3 import ( 3 import (
4 "context" 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/xerr"
5 8
6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" 9 "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" 10 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
@@ -24,7 +27,40 @@ func NewSystemSearchArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext @@ -24,7 +27,40 @@ func NewSystemSearchArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext
24 } 27 }
25 28
26 func (l *SystemSearchArticleLogic) SystemSearchArticle(req *types.SystemArticleSearchRequest) (resp *types.SystemArticleSearchResponse, err error) { 29 func (l *SystemSearchArticleLogic) SystemSearchArticle(req *types.SystemArticleSearchRequest) (resp *types.SystemArticleSearchResponse, err error) {
27 - // todo: add your logic here and delete this line  
28 -  
29 - return 30 + var conn = l.svcCtx.DefaultDBConn()
  31 + total, articles, err := l.svcCtx.ArticleRepository.Find(
  32 + l.ctx,
  33 + conn,
  34 + req.CompanyId,
  35 + domain.NewQueryOptions().
  36 + WithOffsetLimit(req.PageNumber, req.PageSize).
  37 + WithKV("tile", req.Title).
  38 + WithKV("author", req.Author),
  39 + )
  40 + if err != nil {
  41 + return nil, xerr.NewErrMsgErr("搜索帖子异常", err)
  42 + }
  43 + resp = &types.SystemArticleSearchResponse{
  44 + Total: int(total),
  45 + List: make([]types.SystemArticleSearch, 0),
  46 + }
  47 + lo.ForEach(articles, func(item *domain.Article, index int) {
  48 + images := make([]string, 0)
  49 + lo.ForEach(item.Images, func(img domain.Image, n int) {
  50 + images = append(images, img.Url)
  51 + })
  52 + resp.List = append(resp.List, types.SystemArticleSearch{
  53 + Id: item.Id,
  54 + Title: item.Title,
  55 + Author: item.Author.Name,
  56 + Images: images,
  57 + CreatedAt: item.CreatedAt,
  58 + CountLove: item.CountLove,
  59 + CountComment: item.CountComment,
  60 + Show: int(item.Show),
  61 + Tags: nil,
  62 + TargetUser: int(item.TargetUser),
  63 + })
  64 + })
  65 + return resp, nil
30 } 66 }
  1 +package article
  2 +
  3 +import (
  4 + "context"
  5 + "github.com/samber/lo"
  6 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
  7 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
  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 SystemUpdateArticleLogic struct {
  17 + logx.Logger
  18 + ctx context.Context
  19 + svcCtx *svc.ServiceContext
  20 +}
  21 +
  22 +func NewSystemUpdateArticleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SystemUpdateArticleLogic {
  23 + return &SystemUpdateArticleLogic{
  24 + Logger: logx.WithContext(ctx),
  25 + ctx: ctx,
  26 + svcCtx: svcCtx,
  27 + }
  28 +}
  29 +
  30 +func (l *SystemUpdateArticleLogic) SystemUpdateArticle(req *types.SystemArticleUpdateRequest) (resp *types.SystemArticleUpdateResponse, err error) {
  31 + var conn = l.svcCtx.DefaultDBConn()
  32 + article, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, req.Id)
  33 + if err != nil {
  34 + return nil, xerr.NewErrMsgErr("帖子不存在", err)
  35 + }
  36 + //TODO 获取图片的尺寸大小
  37 + images := []domain.Image{}
  38 + for _, val := range req.Images {
  39 + images = append(images, domain.Image{
  40 + Url: val,
  41 + Width: 0,
  42 + Height: 0,
  43 + })
  44 + }
  45 + article.Title = req.Title
  46 + article.Version = article.Version + 1
  47 + article.Images = images
  48 + article.WhoRead = req.WhoRead
  49 + article.WhoReview = req.WhoReview
  50 + article.TargetUser = domain.ArticleTarget(req.TargetUser)
  51 + article.Location = domain.Location{
  52 + Longitude: req.Location.Longitude,
  53 + Latitude: req.Location.Latitude,
  54 + Descript: req.Location.Descript,
  55 + }
  56 + //文章内容
  57 + articleSections := []domain.ArticleSection{}
  58 + lo.ForEach(req.Section, func(item types.ArticleSection, index int) {
  59 + articleSections = append(articleSections, domain.ArticleSection{
  60 + Id: item.Id,
  61 + CompanyId: article.CompanyId,
  62 + Version: article.Version,
  63 + ArticleId: article.Id,
  64 + Content: item.Content,
  65 + SortBy: index + 1,
  66 + })
  67 + })
  68 + //设置内容概要
  69 + if len(req.Section) > 0 {
  70 + // 截取内容 30个字
  71 + runeNumber := 0 //字数
  72 + stringIndex := 0 //字符串长度
  73 + for i := range req.Section[0].Content {
  74 + if runeNumber > 30 {
  75 + break
  76 + }
  77 + runeNumber += 1
  78 + stringIndex = i
  79 + }
  80 + article.Summary = req.Section[0].Content[0:stringIndex]
  81 + }
  82 + err = transaction.UseTrans(l.ctx, conn.DB(), func(ctx context.Context, c transaction.Conn) error {
  83 + _, err = l.svcCtx.ArticleRepository.Update(l.ctx, conn, article)
  84 + if err != nil {
  85 + return xerr.NewErrMsgErr("保存文章失败", err)
  86 + }
  87 + //文章内容
  88 + updateSectionIds := []int64{}
  89 + for _, item := range articleSections {
  90 + if item.Id > 0 {
  91 + section, err := l.svcCtx.ArticleSectionRepository.FindOne(ctx, c, item.Id)
  92 + if err != nil {
  93 + return xerr.NewErrMsgErr("获取文章段落内容失败", err)
  94 + }
  95 + section.Content = item.Content
  96 + section.ArticleId = item.ArticleId
  97 + section.Version = item.Version
  98 + section.SortBy = item.SortBy
  99 + section.CompanyId = item.CompanyId
  100 + _, err = l.svcCtx.ArticleSectionRepository.Update(ctx, c, section)
  101 + if err != nil {
  102 + return xerr.NewErrMsgErr("保存文章段落内容失败", err)
  103 + }
  104 + } else {
  105 + _, err = l.svcCtx.ArticleSectionRepository.Insert(ctx, c, &item)
  106 + if err != nil {
  107 + return xerr.NewErrMsgErr("保存文章段落内容失败", err)
  108 + }
  109 + }
  110 + updateSectionIds = append(updateSectionIds, item.Id)
  111 + }
  112 + if len(updateSectionIds) > 0 {
  113 + err = l.svcCtx.ArticleSectionRepository.DeleteBy(ctx, c, domain.NewQueryOptions().WithKV("articleId", article.Id).WithKV("notIds", updateSectionIds))
  114 + if err != nil {
  115 + return xerr.NewErrMsgErr("保存文章内容失败", err)
  116 + }
  117 + }
  118 + //备份数据
  119 + backup := article.MakeBackup(article.Author, articleSections)
  120 + backup.Action = "编辑"
  121 + _, err = l.svcCtx.ArticleBackupRepository.Insert(ctx, c, backup)
  122 + if err != nil {
  123 + return xerr.NewErrMsgErr("保存文章内容失败", err)
  124 + }
  125 + return nil
  126 + }, true)
  127 + return
  128 +}
@@ -724,7 +724,7 @@ type SystemArticleGetRequest struct { @@ -724,7 +724,7 @@ type SystemArticleGetRequest struct {
724 724
725 type UserShowName struct { 725 type UserShowName struct {
726 Id int `json:"id"` 726 Id int `json:"id"`
727 - Name int `json:"name"` 727 + Name string `json:"name"`
728 } 728 }
729 729
730 type SystemArticleGetResponse struct { 730 type SystemArticleGetResponse struct {
@@ -748,8 +748,11 @@ type SystemArticleGetResponse struct { @@ -748,8 +748,11 @@ type SystemArticleGetResponse struct {
748 748
749 type SystemArticleSearchRequest struct { 749 type SystemArticleSearchRequest struct {
750 CompanyId int64 `json:",optional"` 750 CompanyId int64 `json:",optional"`
751 - Page int `json:"page"`  
752 - Size int `json:"size"` 751 + Title string `json:"title"` //标题
  752 + Author string `json:"author"` //发布人
  753 + PublishDate string `json:"publishDate"` //发布日期
  754 + PageNumber int `json:"pageNumber"` //页码
  755 + PageSize int `json:"pageSize"` //每页行数
753 } 756 }
754 757
755 type SystemArticleSearchResponse struct { 758 type SystemArticleSearchResponse struct {
@@ -770,6 +773,45 @@ type SystemArticleSearch struct { @@ -770,6 +773,45 @@ type SystemArticleSearch struct {
770 TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人] 773 TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人]
771 } 774 }
772 775
  776 +type SystemArticleUpdateRequest struct {
  777 + Id int64 `json:"id"`
  778 + CompanyId int64 `json:",optional"`
  779 + Template int `json:"template"` // 使用哪个模板进行编辑 0、无 1、演绎式 2、归纳式
  780 + Section []ArticleSection `json:"section"` // 填写的内容
  781 + Title string `json:"title"` // 标题
  782 + Images []string `json:"images"` // 图片
  783 + WhoRead []int64 `json:"whoRead"` // 谁可以看
  784 + WhoReview []int64 `json:"whoReview"` // 评论人
  785 + Location Location `json:"location"` // 坐标
  786 + TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人]
  787 +}
  788 +
  789 +type SystemArticleUpdateResponse struct {
  790 + Id int64 `json:"id"` //id
  791 + Title string `json:"title"` //标题
  792 + Author string `json:"author"` //发布人
  793 + Images []string `json:"images"` //图片
  794 + CreatedAt int64 `json:"createdAt"` //文章的创建日期
  795 + CountLove int `json:"countLove"` //点赞数量
  796 + CountComment int `json:"CountComment"` //评论数量
  797 + Show int `json:"show"` //是否隐藏 [0显示、1不显示]
  798 + Tags []string `json:"tags"` //标签
  799 + TargetUser int `json:"targetUser"` //分发方式 [0分发给所有人、1分发给指定的人]
  800 +}
  801 +
  802 +type SystemArticleHistoryRequest struct {
  803 + ArticleId int64 `json:"articleId"` //文章ID
  804 + Author string `json:"author,optional"` //发布人
  805 + UpdatedAt string `json:"updatedAt,optional"` //修改日期
  806 +}
  807 +
  808 +type SystemArticleHistoryResponse struct {
  809 + Id int64 `json:"id"` //id
  810 + Author string `json:"author"` //编辑人
  811 + Action string `json:"action"` //编辑类型
  812 + UpdatedAt string `json:"updatedAt"` //编辑时间
  813 +}
  814 +
773 type RoleGetRequest struct { 815 type RoleGetRequest struct {
774 Id int64 `path:"id"` 816 Id int64 `path:"id"`
775 } 817 }
@@ -90,6 +90,28 @@ func (repository *ArticleSectionRepository) Delete(ctx context.Context, conn tra @@ -90,6 +90,28 @@ func (repository *ArticleSectionRepository) Delete(ctx context.Context, conn tra
90 return repository.ModelToDomainModel(m) 90 return repository.ModelToDomainModel(m)
91 } 91 }
92 92
  93 +func (repository *ArticleSectionRepository) DeleteBy(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) error {
  94 + var (
  95 + tx = conn.DB()
  96 + m = &models.ArticleSection{}
  97 + )
  98 + queryFunc := func() (interface{}, error) {
  99 + tx = tx.Where("id = ?", m.Id)
  100 + if v, ok := queryOptions["articleId"]; ok {
  101 + tx = tx.Where("article_id = ?", v)
  102 + }
  103 + if v, ok := queryOptions["notIds"]; ok {
  104 + tx = tx.Where("id not in (?)", v)
  105 + }
  106 + tx.Delete(m)
  107 + return m, tx.Error
  108 + }
  109 + if _, err := repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
  110 + return err
  111 + }
  112 + return nil
  113 +}
  114 +
93 func (repository *ArticleSectionRepository) FindOne(ctx context.Context, conn transaction.Conn, id int64) (*domain.ArticleSection, error) { 115 func (repository *ArticleSectionRepository) FindOne(ctx context.Context, conn transaction.Conn, id int64) (*domain.ArticleSection, error) {
94 var ( 116 var (
95 err error 117 err error
@@ -25,6 +25,7 @@ type ArticleSectionRepository interface { @@ -25,6 +25,7 @@ type ArticleSectionRepository interface {
25 Update(ctx context.Context, conn transaction.Conn, dm *ArticleSection) (*ArticleSection, error) 25 Update(ctx context.Context, conn transaction.Conn, dm *ArticleSection) (*ArticleSection, error)
26 UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ArticleSection) (*ArticleSection, error) 26 UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ArticleSection) (*ArticleSection, error)
27 Delete(ctx context.Context, conn transaction.Conn, dm *ArticleSection) (*ArticleSection, error) 27 Delete(ctx context.Context, conn transaction.Conn, dm *ArticleSection) (*ArticleSection, error)
  28 + DeleteBy(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) error
28 FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ArticleSection, error) 29 FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ArticleSection, error)
29 Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ArticleSection, error) 30 Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ArticleSection, error)
30 } 31 }