作者 yangfu

feat: 内容安全

@@ -1013,6 +1013,64 @@ @@ -1013,6 +1013,64 @@
1013 ] 1013 ]
1014 } 1014 }
1015 }, 1015 },
  1016 + "v1/mini/message/subscribe/add": {
  1017 + "post": {
  1018 + "summary": "增加订阅消息次数",
  1019 + "operationId": "miniMessageSubscribeAdd",
  1020 + "responses": {
  1021 + "200": {
  1022 + "description": "A successful response.",
  1023 + "schema": {
  1024 + "$ref": "#/definitions/MessageSubscribeAddResponse"
  1025 + }
  1026 + }
  1027 + },
  1028 + "parameters": [
  1029 + {
  1030 + "name": "body",
  1031 + "description": " 增加消息订阅次数",
  1032 + "in": "body",
  1033 + "required": true,
  1034 + "schema": {
  1035 + "$ref": "#/definitions/MessageSubscribeAddRequest"
  1036 + }
  1037 + }
  1038 + ],
  1039 + "requestBody": {},
  1040 + "tags": [
  1041 + "message"
  1042 + ]
  1043 + }
  1044 + },
  1045 + "v1/mini/message/subscribe/list": {
  1046 + "post": {
  1047 + "summary": "获取订阅消息次数",
  1048 + "operationId": "miniMessageSubscribeList",
  1049 + "responses": {
  1050 + "200": {
  1051 + "description": "A successful response.",
  1052 + "schema": {
  1053 + "$ref": "#/definitions/MessageSubscribeListResponse"
  1054 + }
  1055 + }
  1056 + },
  1057 + "parameters": [
  1058 + {
  1059 + "name": "body",
  1060 + "description": "订阅消息次数详情",
  1061 + "in": "body",
  1062 + "required": true,
  1063 + "schema": {
  1064 + "$ref": "#/definitions/MessageSubscribeListRequest"
  1065 + }
  1066 + }
  1067 + ],
  1068 + "requestBody": {},
  1069 + "tags": [
  1070 + "message"
  1071 + ]
  1072 + }
  1073 + },
1016 "v1/mini/message/system": { 1074 "v1/mini/message/system": {
1017 "post": { 1075 "post": {
1018 "summary": "系统消息", 1076 "summary": "系统消息",
@@ -1661,6 +1719,52 @@ @@ -1661,6 +1719,52 @@
1661 ] 1719 ]
1662 } 1720 }
1663 }, 1721 },
  1722 + "v1/mini/wechat/bind": {
  1723 + "post": {
  1724 + "summary": "绑定微信",
  1725 + "operationId": "miniWechatBind",
  1726 + "responses": {
  1727 + "200": {
  1728 + "description": "A successful response.",
  1729 + "schema": {
  1730 + "$ref": "#/definitions/MiniWechatBindResponse"
  1731 + }
  1732 + }
  1733 + },
  1734 + "parameters": [
  1735 + {
  1736 + "name": "body",
  1737 + "in": "body",
  1738 + "required": true,
  1739 + "schema": {
  1740 + "$ref": "#/definitions/MiniWechatBindRequest"
  1741 + }
  1742 + }
  1743 + ],
  1744 + "requestBody": {},
  1745 + "tags": [
  1746 + "user"
  1747 + ]
  1748 + }
  1749 + },
  1750 + "v1/mini/wechat/info": {
  1751 + "get": {
  1752 + "summary": "检测是否绑定微信",
  1753 + "operationId": "miniWechatInfo",
  1754 + "responses": {
  1755 + "200": {
  1756 + "description": "A successful response.",
  1757 + "schema": {
  1758 + "$ref": "#/definitions/MiniWechatInfoResponse"
  1759 + }
  1760 + }
  1761 + },
  1762 + "requestBody": {},
  1763 + "tags": [
  1764 + "user"
  1765 + ]
  1766 + }
  1767 + },
1664 "v1/system/account": { 1768 "v1/system/account": {
1665 "post": { 1769 "post": {
1666 "summary": "系统新增账号", 1770 "summary": "系统新增账号",
@@ -2623,6 +2727,89 @@ @@ -2623,6 +2727,89 @@
2623 ] 2727 ]
2624 } 2728 }
2625 }, 2729 },
  2730 + "v1/system/article_security/audit": {
  2731 + "post": {
  2732 + "summary": "内容安全-审核",
  2733 + "operationId": "articleSecurityAudit",
  2734 + "responses": {
  2735 + "200": {
  2736 + "description": "A successful response.",
  2737 + "schema": {
  2738 + "$ref": "#/definitions/ArticleSecurityAuditResponse"
  2739 + }
  2740 + }
  2741 + },
  2742 + "parameters": [
  2743 + {
  2744 + "name": "body",
  2745 + "description": " ArticleSecuritySaveRequest struct{, ArticleSecurity ArticleSecurityItem `json:\"article_security\"`, }, ArticleSecuritySaveResponse struct{},, ArticleSecurityDeleteRequest struct{, Id int64 `path:\"id\"`, }, ArticleSecurityDeleteResponse struct{},, ArticleSecurityUpdateRequest struct{, Id int64 `path:\"id\"`, ArticleSecurity ArticleSecurityItem `json:\"article_security\"`, }, ArticleSecurityUpdateResponse struct{}",
  2746 + "in": "body",
  2747 + "required": true,
  2748 + "schema": {
  2749 + "$ref": "#/definitions/ArticleSecurityAuditRequest"
  2750 + }
  2751 + }
  2752 + ],
  2753 + "requestBody": {},
  2754 + "tags": [
  2755 + "secuirty"
  2756 + ]
  2757 + }
  2758 + },
  2759 + "v1/system/article_security/search": {
  2760 + "post": {
  2761 + "summary": "内容安全-搜索",
  2762 + "operationId": "articleSecuritySearch",
  2763 + "responses": {
  2764 + "200": {
  2765 + "description": "A successful response.",
  2766 + "schema": {
  2767 + "$ref": "#/definitions/ArticleSecuritySearchResponse"
  2768 + }
  2769 + }
  2770 + },
  2771 + "parameters": [
  2772 + {
  2773 + "name": "body",
  2774 + "in": "body",
  2775 + "required": true,
  2776 + "schema": {
  2777 + "$ref": "#/definitions/ArticleSecuritySearchRequest"
  2778 + }
  2779 + }
  2780 + ],
  2781 + "requestBody": {},
  2782 + "tags": [
  2783 + "secuirty"
  2784 + ]
  2785 + }
  2786 + },
  2787 + "v1/system/article_security/{id}": {
  2788 + "get": {
  2789 + "summary": "详情",
  2790 + "operationId": "articleSecurityGet",
  2791 + "responses": {
  2792 + "200": {
  2793 + "description": "A successful response.",
  2794 + "schema": {
  2795 + "$ref": "#/definitions/ArticleSecurityGetResponse"
  2796 + }
  2797 + }
  2798 + },
  2799 + "parameters": [
  2800 + {
  2801 + "name": "id",
  2802 + "in": "path",
  2803 + "required": true,
  2804 + "type": "string"
  2805 + }
  2806 + ],
  2807 + "requestBody": {},
  2808 + "tags": [
  2809 + "secuirty"
  2810 + ]
  2811 + }
  2812 + },
2626 "v1/system/article_tag": { 2813 "v1/system/article_tag": {
2627 "post": { 2814 "post": {
2628 "summary": "后台创建文章标签", 2815 "summary": "后台创建文章标签",
@@ -3765,6 +3952,16 @@ @@ -3765,6 +3952,16 @@
3765 "format": "int64" 3952 "format": "int64"
3766 }, 3953 },
3767 "description": "谁可查看" 3954 "description": "谁可查看"
  3955 + },
  3956 + "isDel": {
  3957 + "type": "integer",
  3958 + "format": "int32",
  3959 + "description": "是否删除 1-删除 0-否"
  3960 + },
  3961 + "deletedType": {
  3962 + "type": "integer",
  3963 + "format": "int32",
  3964 + "description": "类型 1-运营删除 2-用户删除"
3768 } 3965 }
3769 }, 3966 },
3770 "title": "ArticleSearchMe", 3967 "title": "ArticleSearchMe",
@@ -3778,7 +3975,9 @@ @@ -3778,7 +3975,9 @@
3778 "countRead", 3975 "countRead",
3779 "show", 3976 "show",
3780 "targetUser", 3977 "targetUser",
3781 - "whoRead" 3978 + "whoRead",
  3979 + "isDel",
  3980 + "deletedType"
3782 ] 3981 ]
3783 }, 3982 },
3784 "ArticleSection": { 3983 "ArticleSection": {
@@ -3812,6 +4011,199 @@ @@ -3812,6 +4011,199 @@
3812 "totalComment" 4011 "totalComment"
3813 ] 4012 ]
3814 }, 4013 },
  4014 + "ArticleSecurityAuditRequest": {
  4015 + "type": "object",
  4016 + "properties": {
  4017 + "id": {
  4018 + "type": "integer",
  4019 + "format": "int64",
  4020 + "description": "id"
  4021 + },
  4022 + "status": {
  4023 + "type": "integer",
  4024 + "format": "int32",
  4025 + "description": " 1:成功 0:失败"
  4026 + }
  4027 + },
  4028 + "title": "ArticleSecurityAuditRequest",
  4029 + "required": [
  4030 + "id",
  4031 + "status"
  4032 + ]
  4033 + },
  4034 + "ArticleSecurityAuditResponse": {
  4035 + "type": "object",
  4036 + "title": "ArticleSecurityAuditResponse"
  4037 + },
  4038 + "ArticleSecurityGetRequest": {
  4039 + "type": "object",
  4040 + "properties": {
  4041 + "id": {
  4042 + "type": "integer",
  4043 + "format": "int64"
  4044 + }
  4045 + },
  4046 + "title": "ArticleSecurityGetRequest",
  4047 + "required": [
  4048 + "id"
  4049 + ]
  4050 + },
  4051 + "ArticleSecurityGetResponse": {
  4052 + "type": "object",
  4053 + "properties": {
  4054 + "item": {
  4055 + "$ref": "#/definitions/ArticleSecurityItem"
  4056 + }
  4057 + },
  4058 + "title": "ArticleSecurityGetResponse",
  4059 + "required": [
  4060 + "item"
  4061 + ]
  4062 + },
  4063 + "ArticleSecurityItem": {
  4064 + "type": "object",
  4065 + "properties": {
  4066 + "id": {
  4067 + "type": "integer",
  4068 + "format": "int64",
  4069 + "description": " 唯一标识"
  4070 + },
  4071 + "contentKeyWords": {
  4072 + "type": "string",
  4073 + "description": " 内容关键字"
  4074 + },
  4075 + "content": {
  4076 + "$ref": "#/definitions/ContentDetailItem",
  4077 + "description": " 内容详情"
  4078 + },
  4079 + "label": {
  4080 + "type": "string",
  4081 + "description": " 风控标签"
  4082 + },
  4083 + "prob": {
  4084 + "type": "integer",
  4085 + "format": "int32",
  4086 + "description": " 分值"
  4087 + },
  4088 + "suggest": {
  4089 + "type": "string",
  4090 + "description": " 建议 通过、风险、人工审核"
  4091 + },
  4092 + "author": {
  4093 + "type": "string",
  4094 + "description": " 发布人"
  4095 + },
  4096 + "releaseAt": {
  4097 + "type": "string",
  4098 + "description": " 发布时间"
  4099 + },
  4100 + "reviewStatus": {
  4101 + "type": "integer",
  4102 + "format": "int32",
  4103 + "description": " 审核结果 1:待审核 2:通过 3:拒绝"
  4104 + },
  4105 + "reviewer": {
  4106 + "type": "string",
  4107 + "description": " 审核人"
  4108 + },
  4109 + "reviewAt": {
  4110 + "type": "integer",
  4111 + "format": "int64",
  4112 + "description": " 审核时间(人工处置时间)"
  4113 + },
  4114 + "checkList": {
  4115 + "type": "array",
  4116 + "items": {
  4117 + "$ref": "#/definitions/CheckDetailItem"
  4118 + },
  4119 + "description": " 检查列表"
  4120 + }
  4121 + },
  4122 + "title": "ArticleSecurityItem",
  4123 + "required": [
  4124 + "id",
  4125 + "contentKeyWords",
  4126 + "content",
  4127 + "label",
  4128 + "prob",
  4129 + "suggest",
  4130 + "author",
  4131 + "releaseAt",
  4132 + "reviewStatus",
  4133 + "reviewer",
  4134 + "reviewAt",
  4135 + "checkList"
  4136 + ]
  4137 + },
  4138 + "ArticleSecuritySearchRequest": {
  4139 + "type": "object",
  4140 + "properties": {
  4141 + "page": {
  4142 + "type": "integer",
  4143 + "format": "int32"
  4144 + },
  4145 + "size": {
  4146 + "type": "integer",
  4147 + "format": "int32"
  4148 + },
  4149 + "reviewStatus": {
  4150 + "type": "integer",
  4151 + "format": "int32",
  4152 + "description": " 审核结果 1:待审核 2:通过 3:拒绝"
  4153 + },
  4154 + "suggest": {
  4155 + "type": "string",
  4156 + "description": " 建议 通过、风险、人工审核"
  4157 + },
  4158 + "contentType": {
  4159 + "type": "integer",
  4160 + "format": "int32",
  4161 + "description": " 内容类型 (1:文章 2:评论)"
  4162 + },
  4163 + "authorName": {
  4164 + "type": "string",
  4165 + "description": " 作者名称"
  4166 + },
  4167 + "beginTime": {
  4168 + "type": "integer",
  4169 + "format": "int64",
  4170 + "description": " 开始时间"
  4171 + },
  4172 + "endTime": {
  4173 + "type": "integer",
  4174 + "format": "int64",
  4175 + "description": " 结束时间"
  4176 + }
  4177 + },
  4178 + "title": "ArticleSecuritySearchRequest",
  4179 + "required": [
  4180 + "suggest",
  4181 + "contentType",
  4182 + "authorName",
  4183 + "beginTime",
  4184 + "endTime"
  4185 + ]
  4186 + },
  4187 + "ArticleSecuritySearchResponse": {
  4188 + "type": "object",
  4189 + "properties": {
  4190 + "list": {
  4191 + "type": "array",
  4192 + "items": {
  4193 + "$ref": "#/definitions/ArticleSecurityItem"
  4194 + }
  4195 + },
  4196 + "total": {
  4197 + "type": "integer",
  4198 + "format": "int64"
  4199 + }
  4200 + },
  4201 + "title": "ArticleSecuritySearchResponse",
  4202 + "required": [
  4203 + "list",
  4204 + "total"
  4205 + ]
  4206 + },
3815 "ArticleTagCount": { 4207 "ArticleTagCount": {
3816 "type": "object", 4208 "type": "object",
3817 "properties": { 4209 "properties": {
@@ -3967,12 +4359,18 @@ @@ -3967,12 +4359,18 @@
3967 "label": { 4359 "label": {
3968 "type": "string", 4360 "type": "string",
3969 "description": " 分组名称" 4361 "description": " 分组名称"
  4362 + },
  4363 + "enable": {
  4364 + "type": "integer",
  4365 + "format": "int32",
  4366 + "description": " 启用状态 1:启用"
3970 } 4367 }
3971 }, 4368 },
3972 "title": "CategoryOptions", 4369 "title": "CategoryOptions",
3973 "required": [ 4370 "required": [
3974 "value", 4371 "value",
3975 - "label" 4372 + "label",
  4373 + "enable"
3976 ] 4374 ]
3977 }, 4375 },
3978 "CategoryOptionsRequest": { 4376 "CategoryOptionsRequest": {
@@ -4001,6 +4399,29 @@ @@ -4001,6 +4399,29 @@
4001 "options" 4399 "options"
4002 ] 4400 ]
4003 }, 4401 },
  4402 + "CheckDetailItem": {
  4403 + "type": "object",
  4404 + "properties": {
  4405 + "label": {
  4406 + "type": "string",
  4407 + "description": " 命中标签"
  4408 + },
  4409 + "prob": {
  4410 + "$ref": "#/definitions/uint",
  4411 + "description": " 置信度。0-100,越高代表越有可能属于当前返回的标签(label)"
  4412 + },
  4413 + "suggest": {
  4414 + "type": "string",
  4415 + "description": " 建议"
  4416 + }
  4417 + },
  4418 + "title": "CheckDetailItem",
  4419 + "required": [
  4420 + "label",
  4421 + "prob",
  4422 + "suggest"
  4423 + ]
  4424 + },
4004 "CommentAtWho": { 4425 "CommentAtWho": {
4005 "type": "object", 4426 "type": "object",
4006 "properties": { 4427 "properties": {
@@ -4200,6 +4621,31 @@ @@ -4200,6 +4621,31 @@
4200 "type": "object", 4621 "type": "object",
4201 "title": "CompanyVisibleSwitchResponse" 4622 "title": "CompanyVisibleSwitchResponse"
4202 }, 4623 },
  4624 + "ContentDetailItem": {
  4625 + "type": "object",
  4626 + "properties": {
  4627 + "id": {
  4628 + "type": "integer",
  4629 + "format": "int64",
  4630 + "description": " 内容ID"
  4631 + },
  4632 + "type": {
  4633 + "type": "integer",
  4634 + "format": "int32",
  4635 + "description": " 内容类型 (1:文章 2:评论)"
  4636 + },
  4637 + "text": {
  4638 + "type": "string",
  4639 + "description": " 内容文本"
  4640 + }
  4641 + },
  4642 + "title": "ContentDetailItem",
  4643 + "required": [
  4644 + "id",
  4645 + "type",
  4646 + "text"
  4647 + ]
  4648 + },
4203 "Department": { 4649 "Department": {
4204 "type": "object", 4650 "type": "object",
4205 "properties": { 4651 "properties": {
@@ -4229,6 +4675,11 @@ @@ -4229,6 +4675,11 @@
4229 "format": "int64" 4675 "format": "int64"
4230 }, 4676 },
4231 "description": " 部门下的用户" 4677 "description": " 部门下的用户"
  4678 + },
  4679 + "totalUser": {
  4680 + "type": "integer",
  4681 + "format": "int32",
  4682 + "description": " 累计用户"
4232 } 4683 }
4233 }, 4684 },
4234 "title": "Department", 4685 "title": "Department",
@@ -4237,7 +4688,8 @@ @@ -4237,7 +4688,8 @@
4237 "companyId", 4688 "companyId",
4238 "parentId", 4689 "parentId",
4239 "name", 4690 "name",
4240 - "userIds" 4691 + "userIds",
  4692 + "totalUser"
4241 ] 4693 ]
4242 }, 4694 },
4243 "DepartmentAddRequest": { 4695 "DepartmentAddRequest": {
@@ -4297,6 +4749,16 @@ @@ -4297,6 +4749,16 @@
4297 "size": { 4749 "size": {
4298 "type": "integer", 4750 "type": "integer",
4299 "format": "int32" 4751 "format": "int32"
  4752 + },
  4753 + "includeRootCompany": {
  4754 + "type": "boolean",
  4755 + "format": "boolean",
  4756 + "description": " 包含公司(把公司当作部门作为顶级节点 部门ID:0)"
  4757 + },
  4758 + "includeDefaultDepartment": {
  4759 + "type": "boolean",
  4760 + "format": "boolean",
  4761 + "description": " 包含默认分组"
4300 } 4762 }
4301 }, 4763 },
4302 "title": "DepartmentListRequest", 4764 "title": "DepartmentListRequest",
@@ -4497,6 +4959,89 @@ @@ -4497,6 +4959,89 @@
4497 "size" 4959 "size"
4498 ] 4960 ]
4499 }, 4961 },
  4962 + "MessageSubscribeAddRequest": {
  4963 + "type": "object",
  4964 + "properties": {
  4965 + "types": {
  4966 + "type": "array",
  4967 + "items": {
  4968 + "type": "integer",
  4969 + "format": "int32"
  4970 + },
  4971 + "description": " 订阅消息类型"
  4972 + }
  4973 + },
  4974 + "title": "MessageSubscribeAddRequest",
  4975 + "required": [
  4976 + "types"
  4977 + ]
  4978 + },
  4979 + "MessageSubscribeAddResponse": {
  4980 + "type": "object",
  4981 + "properties": {
  4982 + "items": {
  4983 + "type": "array",
  4984 + "items": {
  4985 + "$ref": "#/definitions/MessageSubscribeItem"
  4986 + }
  4987 + }
  4988 + },
  4989 + "title": "MessageSubscribeAddResponse",
  4990 + "required": [
  4991 + "items"
  4992 + ]
  4993 + },
  4994 + "MessageSubscribeItem": {
  4995 + "type": "object",
  4996 + "properties": {
  4997 + "type": {
  4998 + "type": "integer",
  4999 + "format": "int32",
  5000 + "description": " 订阅消息类型"
  5001 + },
  5002 + "count": {
  5003 + "type": "integer",
  5004 + "format": "int32",
  5005 + "description": " 订阅次数"
  5006 + },
  5007 + "userId": {
  5008 + "type": "integer",
  5009 + "format": "int64",
  5010 + "description": " 用户ID"
  5011 + },
  5012 + "companyId": {
  5013 + "type": "integer",
  5014 + "format": "int64",
  5015 + "description": " 公司ID"
  5016 + }
  5017 + },
  5018 + "title": "MessageSubscribeItem",
  5019 + "required": [
  5020 + "type",
  5021 + "count",
  5022 + "userId",
  5023 + "companyId"
  5024 + ]
  5025 + },
  5026 + "MessageSubscribeListRequest": {
  5027 + "type": "object",
  5028 + "title": "MessageSubscribeListRequest"
  5029 + },
  5030 + "MessageSubscribeListResponse": {
  5031 + "type": "object",
  5032 + "properties": {
  5033 + "items": {
  5034 + "type": "array",
  5035 + "items": {
  5036 + "$ref": "#/definitions/MessageSubscribeItem"
  5037 + }
  5038 + }
  5039 + },
  5040 + "title": "MessageSubscribeListResponse",
  5041 + "required": [
  5042 + "items"
  5043 + ]
  5044 + },
4500 "MessageSystemItem": { 5045 "MessageSystemItem": {
4501 "type": "object", 5046 "type": "object",
4502 "properties": { 5047 "properties": {
@@ -6975,10 +7520,89 @@ @@ -6975,10 +7520,89 @@
6975 "keywords": { 7520 "keywords": {
6976 "type": "string", 7521 "type": "string",
6977 "description": " 按关键字搜索(名称)" 7522 "description": " 按关键字搜索(名称)"
  7523 + },
  7524 + "departmentId": {
  7525 + "$ref": "#/definitions/int64",
  7526 + "description": " 按部门过滤"
6978 } 7527 }
6979 }, 7528 },
6980 "title": "MiniUsersListRequest" 7529 "title": "MiniUsersListRequest"
6981 }, 7530 },
  7531 + "MiniWechatBindRequest": {
  7532 + "type": "object",
  7533 + "properties": {
  7534 + "wechatAuthcode": {
  7535 + "type": "string",
  7536 + "description": " 微信登录 授权码"
  7537 + },
  7538 + "wechatEncryptedData": {
  7539 + "type": "string",
  7540 + "description": " 微信登录 加密数据"
  7541 + },
  7542 + "wechatIV": {
  7543 + "type": "string",
  7544 + "description": " 微信登录 加密算法初始向量"
  7545 + }
  7546 + },
  7547 + "title": "MiniWechatBindRequest",
  7548 + "required": [
  7549 + "wechatAuthcode",
  7550 + "wechatEncryptedData",
  7551 + "wechatIV"
  7552 + ]
  7553 + },
  7554 + "MiniWechatBindResponse": {
  7555 + "type": "object",
  7556 + "properties": {
  7557 + "bind": {
  7558 + "type": "boolean",
  7559 + "format": "boolean",
  7560 + "description": " 绑定结果 true-已绑定 false-未绑定"
  7561 + },
  7562 + "openId": {
  7563 + "type": "string",
  7564 + "description": " 绑定的微信openId"
  7565 + },
  7566 + "phone": {
  7567 + "type": "string",
  7568 + "description": " 绑定手机号"
  7569 + }
  7570 + },
  7571 + "title": "MiniWechatBindResponse",
  7572 + "required": [
  7573 + "bind",
  7574 + "openId",
  7575 + "phone"
  7576 + ]
  7577 + },
  7578 + "MiniWechatInfoRequest": {
  7579 + "type": "object",
  7580 + "title": "MiniWechatInfoRequest"
  7581 + },
  7582 + "MiniWechatInfoResponse": {
  7583 + "type": "object",
  7584 + "properties": {
  7585 + "bind": {
  7586 + "type": "boolean",
  7587 + "format": "boolean",
  7588 + "description": " 绑定结果 true-已绑定 false-未绑定"
  7589 + },
  7590 + "openId": {
  7591 + "type": "string",
  7592 + "description": " 绑定的微信openId"
  7593 + },
  7594 + "phone": {
  7595 + "type": "string",
  7596 + "description": " 绑定手机号"
  7597 + }
  7598 + },
  7599 + "title": "MiniWechatInfoResponse",
  7600 + "required": [
  7601 + "bind",
  7602 + "openId",
  7603 + "phone"
  7604 + ]
  7605 + },
6982 "MyBeLikedItem": { 7606 "MyBeLikedItem": {
6983 "type": "object", 7607 "type": "object",
6984 "properties": { 7608 "properties": {
@@ -7828,11 +8452,16 @@ @@ -7828,11 +8452,16 @@
7828 "type": "integer", 8452 "type": "integer",
7829 "format": "int64", 8453 "format": "int64",
7830 "description": "id" 8454 "description": "id"
  8455 + },
  8456 + "AccessToken": {
  8457 + "type": "string",
  8458 + "description": " 授权token"
7831 } 8459 }
7832 }, 8460 },
7833 "title": "SystemArticleDeleteRequest", 8461 "title": "SystemArticleDeleteRequest",
7834 "required": [ 8462 "required": [
7835 - "id" 8463 + "id",
  8464 + "x-mmm-accesstoken"
7836 ] 8465 ]
7837 }, 8466 },
7838 "SystemArticleDeleteResponse": { 8467 "SystemArticleDeleteResponse": {
@@ -7866,11 +8495,16 @@ @@ -7866,11 +8495,16 @@
7866 "type": "integer", 8495 "type": "integer",
7867 "format": "int64", 8496 "format": "int64",
7868 "description": "ID" 8497 "description": "ID"
  8498 + },
  8499 + "AccessToken": {
  8500 + "type": "string",
  8501 + "description": " 授权token"
7869 } 8502 }
7870 }, 8503 },
7871 "title": "SystemArticleDeletedRestoreRequest", 8504 "title": "SystemArticleDeletedRestoreRequest",
7872 "required": [ 8505 "required": [
7873 - "id" 8506 + "id",
  8507 + "x-mmm-accesstoken"
7874 ] 8508 ]
7875 }, 8509 },
7876 "SystemArticleDeletedRestoreResponse": { 8510 "SystemArticleDeletedRestoreResponse": {
@@ -10180,6 +10814,10 @@ @@ -10180,6 +10814,10 @@
10180 }, 10814 },
10181 "code": { 10815 "code": {
10182 "type": "string" 10816 "type": "string"
  10817 + },
  10818 + "companyVisible": {
  10819 + "type": "boolean",
  10820 + "format": "boolean"
10183 } 10821 }
10184 }, 10822 },
10185 "title": "SystemUserInfoResponse", 10823 "title": "SystemUserInfoResponse",
@@ -10189,7 +10827,8 @@ @@ -10189,7 +10827,8 @@
10189 "avatar", 10827 "avatar",
10190 "companyId", 10828 "companyId",
10191 "companyName", 10829 "companyName",
10192 - "code" 10830 + "code",
  10831 + "companyVisible"
10193 ] 10832 ]
10194 }, 10833 },
10195 "SystemUserSearchRequest": { 10834 "SystemUserSearchRequest": {
@@ -10221,8 +10860,7 @@ @@ -10221,8 +10860,7 @@
10221 "description": " 启用状态 1:启用 2:禁用" 10860 "description": " 启用状态 1:启用 2:禁用"
10222 }, 10861 },
10223 "departmentId": { 10862 "departmentId": {
10224 - "type": "integer",  
10225 - "format": "int64", 10863 + "$ref": "#/definitions/int64",
10226 "description": " 所属部门" 10864 "description": " 所属部门"
10227 } 10865 }
10228 }, 10866 },
@@ -68,7 +68,7 @@ type ( @@ -68,7 +68,7 @@ type (
68 Prob int `json:"prob"` // 分值 68 Prob int `json:"prob"` // 分值
69 Suggest string `json:"suggest"` // 建议 通过、风险、人工审核 69 Suggest string `json:"suggest"` // 建议 通过、风险、人工审核
70 Author string `json:"author"` // 发布人 70 Author string `json:"author"` // 发布人
71 - ReleaseAt string `json:"releaseAt"` // 发布时间 71 + ReleaseAt int64 `json:"releaseAt"` // 发布时间
72 ReviewStatus int `json:"reviewStatus"` // 审核结果 1:待审核 2:通过 3:拒绝 72 ReviewStatus int `json:"reviewStatus"` // 审核结果 1:待审核 2:通过 3:拒绝
73 73
74 Reviewer string `json:"reviewer"` // 审核人 74 Reviewer string `json:"reviewer"` // 审核人
@@ -2,8 +2,8 @@ package article @@ -2,8 +2,8 @@ package article
2 2
3 import ( 3 import (
4 "context" 4 "context"
5 - "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/message"  
6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/core" 5 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/core"
  6 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/message"
7 "strconv" 7 "strconv"
8 "strings" 8 "strings"
9 "text/template" 9 "text/template"
@@ -208,7 +208,7 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR @@ -208,7 +208,7 @@ func (l *MiniCreateArticleLogic) MiniCreateArticle(req *types.MiniArticleCreateR
208 } 208 }
209 209
210 // 内容安全检查 210 // 内容安全检查
211 - if err = core.ContentSecurityCheck(l.ctx, l.svcCtx, conn, "", core.NewContentFromArticle(newArticle, sectionList)); err != nil { 211 + if err = core.ContentSecurityCheck(l.ctx, l.svcCtx, c, author, core.NewContentFromArticle(newArticle, sectionList)); err != nil {
212 return err 212 return err
213 } 213 }
214 return nil 214 return nil
@@ -214,7 +214,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini @@ -214,7 +214,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini
214 } 214 }
215 215
216 // 内容安全检查 216 // 内容安全检查
217 - if err = core.ContentSecurityCheck(l.ctx, l.svcCtx, conn, "", core.NewContentFromComment(&newComment)); err != nil { 217 + if err = core.ContentSecurityCheck(l.ctx, l.svcCtx, conn, fromUser, core.NewContentFromComment(&newComment)); err != nil {
218 return err 218 return err
219 } 219 }
220 return nil 220 return nil
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 "context" 5 "context"
6 "fmt" 6 "fmt"
7 "github.com/silenceper/wechat/v2/miniprogram/security" 7 "github.com/silenceper/wechat/v2/miniprogram/security"
  8 + "github.com/zeromicro/go-zero/core/executors"
8 "github.com/zeromicro/go-zero/core/logx" 9 "github.com/zeromicro/go-zero/core/logx"
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/svc"
10 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction" 11 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
@@ -12,7 +13,7 @@ import ( @@ -12,7 +13,7 @@ import (
12 "time" 13 "time"
13 ) 14 )
14 15
15 -func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn transaction.Conn, openId string, content ContentBody) error { 16 +func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn transaction.Conn, toUser *domain.User, content ContentBody) error {
16 if !svcCtx.Config.ContentSecurityCheck { 17 if !svcCtx.Config.ContentSecurityCheck {
17 return nil 18 return nil
18 } 19 }
@@ -25,10 +26,15 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn @@ -25,10 +26,15 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn
25 scene = security.MsgSceneComment 26 scene = security.MsgSceneComment
26 } 27 }
27 var ( 28 var (
28 - resp domain.MsgCheckDetail 29 + resp domain.MsgCheckDetail
  30 + userWechat *domain.UserWechat
29 ) 31 )
  32 + if userWechat, _ = svcCtx.UserWechatRepository.FindOneByPhone(ctx, conn, toUser.Phone); userWechat == nil {
  33 + logx.Debug(fmt.Sprintf("用户%s(%s)未绑定微信,无法进行内容检查", toUser.Name, toUser.Phone))
  34 + return nil
  35 + }
30 respTmp, err := svcCtx.MiniProgram.GetSecurity().MsgCheck(&security.MsgCheckRequest{ 36 respTmp, err := svcCtx.MiniProgram.GetSecurity().MsgCheck(&security.MsgCheckRequest{
31 - OpenID: openId, 37 + OpenID: userWechat.OpenId,
32 Scene: scene, 38 Scene: scene,
33 Content: content.Content, 39 Content: content.Content,
34 }) 40 })
@@ -38,7 +44,7 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn @@ -38,7 +44,7 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn
38 } 44 }
39 resp = domain.MsgCheckDetail(respTmp) 45 resp = domain.MsgCheckDetail(respTmp)
40 var ( 46 var (
41 - keyWords []string 47 + keyWords = make([]string, 0)
42 prob int 48 prob int
43 ) 49 )
44 for i := range resp.Detail { 50 for i := range resp.Detail {
@@ -46,13 +52,18 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn @@ -46,13 +52,18 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn
46 if prob == 0 { 52 if prob == 0 {
47 prob = int(item.Prob) 53 prob = int(item.Prob)
48 } 54 }
  55 + if item.Keyword == "" {
  56 + continue
  57 + }
49 keyWords = append(keyWords, item.Keyword) 58 keyWords = append(keyWords, item.Keyword)
50 } 59 }
51 dm := &domain.ArticleSecurity{ 60 dm := &domain.ArticleSecurity{
  61 + CompanyId: toUser.CompanyId,
52 ContentKeyWords: keyWords, 62 ContentKeyWords: keyWords,
53 ContentType: content.Type, 63 ContentType: content.Type,
54 ContentId: content.Id, 64 ContentId: content.Id,
55 AuthorId: content.AuthorId, 65 AuthorId: content.AuthorId,
  66 + AuthorName: toUser.Name,
56 Reviewer: 0, 67 Reviewer: 0,
57 ReviewStatus: domain.ReviewStatusWait, 68 ReviewStatus: domain.ReviewStatusWait,
58 Label: resp.Result.Label.String(), 69 Label: resp.Result.Label.String(),
@@ -65,11 +76,17 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn @@ -65,11 +76,17 @@ func ContentSecurityCheck(ctx context.Context, svcCtx *svc.ServiceContext, conn
65 if resp.Result.Suggest == security.CheckSuggestPass { 76 if resp.Result.Suggest == security.CheckSuggestPass {
66 dm.ReviewStatus = domain.ReviewStatusPass 77 dm.ReviewStatus = domain.ReviewStatusPass
67 } 78 }
  79 + // 延迟任务(认定为风险的、人工审核),帖子或评论先隐藏,状态改为非法
  80 + if resp.Result.Suggest == security.CheckSuggestRisky || resp.Result.Suggest == security.CheckSuggestReview {
  81 + executors.NewDelayExecutor(func() {
  82 + HandlerSecurityContent(ctx, svcCtx, svcCtx.DefaultDBConn(), content, dm.ReviewStatus)
  83 + }, time.Second*5).Trigger()
  84 + }
68 if dm, err = svcCtx.ArticleSecurityRepository.Insert(ctx, conn, dm); err != nil { 85 if dm, err = svcCtx.ArticleSecurityRepository.Insert(ctx, conn, dm); err != nil {
69 logx.Error(err) 86 logx.Error(err)
70 return nil 87 return nil
71 } 88 }
72 - return HandlerSecurityContent(ctx, svcCtx, conn, content, dm.ReviewStatus) 89 + return nil
73 } 90 }
74 91
75 func HandlerSecurityContent(ctx context.Context, svcCtx *svc.ServiceContext, conn transaction.Conn, c ContentBody, status int) error { 92 func HandlerSecurityContent(ctx context.Context, svcCtx *svc.ServiceContext, conn transaction.Conn, c ContentBody, status int) error {
@@ -80,15 +97,16 @@ func HandlerSecurityContent(ctx context.Context, svcCtx *svc.ServiceContext, con @@ -80,15 +97,16 @@ func HandlerSecurityContent(ctx context.Context, svcCtx *svc.ServiceContext, con
80 article *domain.Article 97 article *domain.Article
81 comment *domain.ArticleComment 98 comment *domain.ArticleComment
82 err error 99 err error
  100 + show = int(domain.ArticleShowIllegal)
83 ) 101 )
84 if status == domain.ReviewStatusPass { 102 if status == domain.ReviewStatusPass {
85 - return nil 103 + show = int(domain.ArticleShowEnable)
86 } 104 }
87 if c.Type == domain.TypeArticle { 105 if c.Type == domain.TypeArticle {
88 if article, err = svcCtx.ArticleRepository.FindOne(ctx, conn, c.Id); err != nil { 106 if article, err = svcCtx.ArticleRepository.FindOne(ctx, conn, c.Id); err != nil {
89 return fmt.Errorf("文章不存在") 107 return fmt.Errorf("文章不存在")
90 } 108 }
91 - article.Show = domain.ArticleShowDisable 109 + article.Show = domain.ArticleShow(show)
92 if _, err = svcCtx.ArticleRepository.UpdateWithVersion(ctx, conn, article); err != nil { 110 if _, err = svcCtx.ArticleRepository.UpdateWithVersion(ctx, conn, article); err != nil {
93 return err 111 return err
94 } 112 }
@@ -96,7 +114,7 @@ func HandlerSecurityContent(ctx context.Context, svcCtx *svc.ServiceContext, con @@ -96,7 +114,7 @@ func HandlerSecurityContent(ctx context.Context, svcCtx *svc.ServiceContext, con
96 if comment, err = svcCtx.ArticleCommentRepository.FindOne(ctx, conn, c.Id); err != nil { 114 if comment, err = svcCtx.ArticleCommentRepository.FindOne(ctx, conn, c.Id); err != nil {
97 return fmt.Errorf("评论不存在") 115 return fmt.Errorf("评论不存在")
98 } 116 }
99 - comment.Show = domain.CommentShowDisable 117 + comment.Show = domain.CommentShow(show)
100 if _, err = svcCtx.ArticleCommentRepository.UpdateWithVersion(ctx, conn, comment); err != nil { 118 if _, err = svcCtx.ArticleCommentRepository.UpdateWithVersion(ctx, conn, comment); err != nil {
101 return err 119 return err
102 } 120 }
@@ -129,7 +147,7 @@ func NewContentFromArticle(c *domain.Article, sections []*domain.ArticleSection) @@ -129,7 +147,7 @@ func NewContentFromArticle(c *domain.Article, sections []*domain.ArticleSection)
129 } 147 }
130 return ContentBody{ 148 return ContentBody{
131 Id: c.Id, 149 Id: c.Id,
132 - Type: domain.TypeComment, 150 + Type: domain.TypeArticle,
133 Content: content.String(), 151 Content: content.String(),
134 AuthorId: c.AuthorId, 152 AuthorId: c.AuthorId,
135 Summary: c.Summary, 153 Summary: c.Summary,
@@ -37,9 +37,9 @@ func (l *ArticleSecurityAuditLogic) ArticleSecurityAudit(req *types.ArticleSecur @@ -37,9 +37,9 @@ func (l *ArticleSecurityAuditLogic) ArticleSecurityAudit(req *types.ArticleSecur
37 return nil, xerr.NewErrMsgErr("不存在", err) 37 return nil, xerr.NewErrMsgErr("不存在", err)
38 } 38 }
39 // 不可编辑判断 39 // 不可编辑判断
40 - if dm.ReviewStatus != domain.ReviewStatusWait {  
41 - return nil, xerr.NewErrMsgErr("内容已审核", err)  
42 - } 40 + //if dm.ReviewStatus != domain.ReviewStatusWait {
  41 + // return nil, xerr.NewErrMsgErr("内容已审核", err)
  42 + //}
43 // 赋值 43 // 赋值
44 if req.Status == 1 { 44 if req.Status == 1 {
45 dm.ReviewStatus = domain.ReviewStatusPass 45 dm.ReviewStatus = domain.ReviewStatusPass
@@ -30,6 +30,8 @@ func (l *ArticleSecurityGetLogic) ArticleSecurityGet(req *types.ArticleSecurityG @@ -30,6 +30,8 @@ func (l *ArticleSecurityGetLogic) ArticleSecurityGet(req *types.ArticleSecurityG
30 conn = l.svcCtx.DefaultDBConn() 30 conn = l.svcCtx.DefaultDBConn()
31 dm *domain.ArticleSecurity 31 dm *domain.ArticleSecurity
32 reviewer *domain.User 32 reviewer *domain.User
  33 + article *domain.Article
  34 + comment *domain.ArticleComment
33 ) 35 )
34 // 货号唯一 36 // 货号唯一
35 if dm, err = l.svcCtx.ArticleSecurityRepository.FindOne(l.ctx, conn, req.Id); err != nil { 37 if dm, err = l.svcCtx.ArticleSecurityRepository.FindOne(l.ctx, conn, req.Id); err != nil {
@@ -43,5 +45,14 @@ func (l *ArticleSecurityGetLogic) ArticleSecurityGet(req *types.ArticleSecurityG @@ -43,5 +45,14 @@ func (l *ArticleSecurityGetLogic) ArticleSecurityGet(req *types.ArticleSecurityG
43 resp = &types.ArticleSecurityGetResponse{ 45 resp = &types.ArticleSecurityGetResponse{
44 ArticleSecurity: NewTypesArticleSecurity(dm, reviewer), 46 ArticleSecurity: NewTypesArticleSecurity(dm, reviewer),
45 } 47 }
  48 + if dm.ContentType == domain.TypeArticle {
  49 + if article, _ = l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, dm.ContentId); article != nil {
  50 + resp.ArticleSecurity.Content.Text = article.Summary
  51 + }
  52 + } else if dm.ContentType == domain.TypeComment {
  53 + if comment, _ = l.svcCtx.ArticleCommentRepository.FindOne(l.ctx, conn, dm.ContentId); comment != nil {
  54 + resp.ArticleSecurity.Content.Text = comment.Content
  55 + }
  56 + }
46 return 57 return
47 } 58 }
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc" 5 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types" 6 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" 7 "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
  8 + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/contextdata"
8 "strings" 9 "strings"
9 10
10 "github.com/zeromicro/go-zero/core/logx" 11 "github.com/zeromicro/go-zero/core/logx"
@@ -26,12 +27,13 @@ func NewArticleSecuritySearchLogic(ctx context.Context, svcCtx *svc.ServiceConte @@ -26,12 +27,13 @@ func NewArticleSecuritySearchLogic(ctx context.Context, svcCtx *svc.ServiceConte
26 27
27 func (l *ArticleSecuritySearchLogic) ArticleSecuritySearch(req *types.ArticleSecuritySearchRequest) (resp *types.ArticleSecuritySearchResponse, err error) { 28 func (l *ArticleSecuritySearchLogic) ArticleSecuritySearch(req *types.ArticleSecuritySearchRequest) (resp *types.ArticleSecuritySearchResponse, err error) {
28 var ( 29 var (
29 - conn = l.svcCtx.DefaultDBConn()  
30 - dms []*domain.ArticleSecurity  
31 - total int64 30 + conn = l.svcCtx.DefaultDBConn()
  31 + dms []*domain.ArticleSecurity
  32 + total int64
  33 + userToken = contextdata.GetUserTokenFromCtx(l.ctx)
32 ) 34 )
33 35
34 - queryOptions := domain.NewQueryOptions().WithOffsetLimit(req.Page, req.Size). 36 + queryOptions := domain.IndexCompanyId(userToken.CompanyId)().WithOffsetLimit(req.Page, req.Size).
35 WithKV("reviewStatus", req.ReviewStatus). 37 WithKV("reviewStatus", req.ReviewStatus).
36 WithKV("suggest", req.Suggest). 38 WithKV("suggest", req.Suggest).
37 WithKV("contentType", req.ContentType). 39 WithKV("contentType", req.ContentType).
@@ -57,7 +59,11 @@ func NewDomainArticleSecurity(item types.ArticleSecurityItem) *domain.ArticleSec @@ -57,7 +59,11 @@ func NewDomainArticleSecurity(item types.ArticleSecurityItem) *domain.ArticleSec
57 59
58 func NewTypesArticleSecurity(item *domain.ArticleSecurity, reviewer *domain.User) types.ArticleSecurityItem { 60 func NewTypesArticleSecurity(item *domain.ArticleSecurity, reviewer *domain.User) types.ArticleSecurityItem {
59 result := types.ArticleSecurityItem{ 61 result := types.ArticleSecurityItem{
60 - Id: item.Id, 62 + Id: item.Id,
  63 + Content: types.ContentDetailItem{
  64 + Id: item.ContentId,
  65 + Type: item.ContentType,
  66 + },
61 ContentKeyWords: strings.Join(item.ContentKeyWords, ","), 67 ContentKeyWords: strings.Join(item.ContentKeyWords, ","),
62 Label: item.Label, 68 Label: item.Label,
63 Prob: item.Prob, 69 Prob: item.Prob,
@@ -65,13 +71,16 @@ func NewTypesArticleSecurity(item *domain.ArticleSecurity, reviewer *domain.User @@ -65,13 +71,16 @@ func NewTypesArticleSecurity(item *domain.ArticleSecurity, reviewer *domain.User
65 Author: item.AuthorName, 71 Author: item.AuthorName,
66 ReviewAt: item.CreatedAt, 72 ReviewAt: item.CreatedAt,
67 ReviewStatus: item.ReviewStatus, 73 ReviewStatus: item.ReviewStatus,
68 -  
69 - Reviewer: "", 74 + ReleaseAt: item.CreatedAt,
  75 + Reviewer: "",
70 } 76 }
71 if reviewer != nil { 77 if reviewer != nil {
72 result.Reviewer = reviewer.Name 78 result.Reviewer = reviewer.Name
73 } 79 }
74 for _, detail := range item.Detail.Detail { 80 for _, detail := range item.Detail.Detail {
  81 + if detail.Label.String() == "0" {
  82 + continue
  83 + }
75 result.CheckList = append(result.CheckList, types.CheckDetailItem{ 84 result.CheckList = append(result.CheckList, types.CheckDetailItem{
76 Label: detail.Label.String(), 85 Label: detail.Label.String(),
77 Prob: detail.Prob, 86 Prob: detail.Prob,
@@ -1890,7 +1890,7 @@ type ArticleSecurityItem struct { @@ -1890,7 +1890,7 @@ type ArticleSecurityItem struct {
1890 Prob int `json:"prob"` // 分值 1890 Prob int `json:"prob"` // 分值
1891 Suggest string `json:"suggest"` // 建议 通过、风险、人工审核 1891 Suggest string `json:"suggest"` // 建议 通过、风险、人工审核
1892 Author string `json:"author"` // 发布人 1892 Author string `json:"author"` // 发布人
1893 - ReleaseAt string `json:"releaseAt"` // 发布时间 1893 + ReleaseAt int64 `json:"releaseAt"` // 发布时间
1894 ReviewStatus int `json:"reviewStatus"` // 审核结果 1:待审核 2:通过 3:拒绝 1894 ReviewStatus int `json:"reviewStatus"` // 审核结果 1:待审核 2:通过 3:拒绝
1895 Reviewer string `json:"reviewer"` // 审核人 1895 Reviewer string `json:"reviewer"` // 审核人
1896 ReviewAt int64 `json:"reviewAt"` // 审核时间(人工处置时间) 1896 ReviewAt int64 `json:"reviewAt"` // 审核时间(人工处置时间)
@@ -26,11 +26,11 @@ func Migrate(db *gorm.DB) { @@ -26,11 +26,11 @@ func Migrate(db *gorm.DB) {
26 //&models.ArticleAndTag{}, 26 //&models.ArticleAndTag{},
27 //&models.ArticleDraftOperation{}, 27 //&models.ArticleDraftOperation{},
28 //&models.ArticleCategory{}, 28 //&models.ArticleCategory{},
29 - &models.UserSubscribe{},  
30 - &models.MessageSubscribe{},  
31 - &models.UserWechat{},  
32 - &models.ArticleDraftOperation{},  
33 - &models.ArticleCategory{}, 29 + //&models.UserSubscribe{},
  30 + //&models.MessageSubscribe{},
  31 + //&models.UserWechat{},
  32 + //&models.ArticleDraftOperation{},
  33 + //&models.ArticleCategory{},
34 &models.ArticleSecurity{}, 34 &models.ArticleSecurity{},
35 } 35 }
36 36
@@ -9,15 +9,15 @@ import ( @@ -9,15 +9,15 @@ import (
9 ) 9 )
10 10
11 type ArticleSecurity struct { 11 type ArticleSecurity struct {
12 - Id int64 // 唯一标识  
13 -  
14 - ContentKeyWords []string // 内容关键字  
15 - ContentType int `json:"contentType,omitempty"` // 内容类型 (1:文章 2:评论)  
16 - ContentId int64 `json:"contentId,omitempty"` // 内容ID  
17 - AuthorId int64 `json:"authorId,omitempty"` // 发布人  
18 - AuthorName string `json:"authorName,omitempty"` // 发布人  
19 - Reviewer int64 `json:"reviewer,omitempty"` // 审核人  
20 - ReviewStatus int `json:"reviewStatus,omitempty"` // 审核状态 0:待审核 1:通过 2:拒绝 12 + Id int64 // 唯一标识
  13 + CompanyId int64
  14 + ContentKeyWords []string `gorm:"type:jsonb;serializer:json"` // 内容关键字
  15 + ContentType int `json:"contentType,omitempty"` // 内容类型 (1:文章 2:评论)
  16 + ContentId int64 `json:"contentId,omitempty"` // 内容ID
  17 + AuthorId int64 `json:"authorId,omitempty"` // 发布人
  18 + AuthorName string `json:"authorName,omitempty"` // 发布人
  19 + Reviewer int64 `json:"reviewer,omitempty"` // 审核人
  20 + ReviewStatus int `json:"reviewStatus,omitempty"` // 审核状态 0:待审核 1:通过 2:拒绝
21 Label string // 标签 21 Label string // 标签
22 Prob int // 分值 22 Prob int // 分值
23 Suggest string // 建议 通过、风险、人工审核 23 Suggest string // 建议 通过、风险、人工审核
@@ -121,6 +121,9 @@ func (repository *ArticleSecurityRepository) Find(ctx context.Context, conn tran @@ -121,6 +121,9 @@ func (repository *ArticleSecurityRepository) Find(ctx context.Context, conn tran
121 ) 121 )
122 queryFunc := func() (interface{}, error) { 122 queryFunc := func() (interface{}, error) {
123 tx = tx.Model(&ms).Order("id desc") 123 tx = tx.Model(&ms).Order("id desc")
  124 + if v, ok := queryOptions["companyId"]; ok {
  125 + tx.Where("company_id = ?", v)
  126 + }
124 if v, ok := queryOptions["authorName"]; ok { 127 if v, ok := queryOptions["authorName"]; ok {
125 tx.Where("author_name like ? ", fmt.Sprintf("%%%v%%", v)) 128 tx.Where("author_name like ? ", fmt.Sprintf("%%%v%%", v))
126 } 129 }
@@ -95,6 +95,7 @@ type ArticleShow int @@ -95,6 +95,7 @@ type ArticleShow int
95 const ( 95 const (
96 ArticleShowEnable ArticleShow = 1 96 ArticleShowEnable ArticleShow = 1
97 ArticleShowDisable ArticleShow = 2 97 ArticleShowDisable ArticleShow = 2
  98 + ArticleShowIllegal ArticleShow = 3
98 ) 99 )
99 100
100 func (a ArticleShow) Named() string { 101 func (a ArticleShow) Named() string {
@@ -103,6 +104,8 @@ func (a ArticleShow) Named() string { @@ -103,6 +104,8 @@ func (a ArticleShow) Named() string {
103 return "显示" 104 return "显示"
104 case ArticleShowDisable: 105 case ArticleShowDisable:
105 return "隐藏" 106 return "隐藏"
  107 + case ArticleShowIllegal:
  108 + return "违规"
106 } 109 }
107 return "" 110 return ""
108 } 111 }
@@ -39,6 +39,7 @@ type CommentShow int @@ -39,6 +39,7 @@ type CommentShow int
39 const ( 39 const (
40 CommentShowEnable CommentShow = 1 40 CommentShowEnable CommentShow = 1
41 CommentShowDisable CommentShow = 2 41 CommentShowDisable CommentShow = 2
  42 + CommentShowIllegal CommentShow = 3
42 ) 43 )
43 44
44 func (show CommentShow) Named() string { 45 func (show CommentShow) Named() string {
@@ -47,6 +48,8 @@ func (show CommentShow) Named() string { @@ -47,6 +48,8 @@ func (show CommentShow) Named() string {
47 return "显示" 48 return "显示"
48 case CommentShowDisable: 49 case CommentShowDisable:
49 return "隐藏" 50 return "隐藏"
  51 + case CommentShowIllegal:
  52 + return "违规"
50 } 53 }
51 return "" 54 return ""
52 } 55 }
@@ -7,8 +7,8 @@ import ( @@ -7,8 +7,8 @@ import (
7 ) 7 )
8 8
9 type ArticleSecurity struct { 9 type ArticleSecurity struct {
10 - Id int64 // 唯一标识  
11 - 10 + Id int64 // 唯一标识
  11 + CompanyId int64
12 ContentKeyWords []string // 内容关键字 12 ContentKeyWords []string // 内容关键字
13 ContentType int `json:"contentType,omitempty"` // 内容类型 (1:文章 2:评论) 13 ContentType int `json:"contentType,omitempty"` // 内容类型 (1:文章 2:评论)
14 ContentId int64 `json:"contentId,omitempty"` // 内容ID 14 ContentId int64 `json:"contentId,omitempty"` // 内容ID