Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cmeeting
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
翟斌
cmeeting
Commits
0705d440
提交
0705d440
authored
7月 18, 2025
作者:
洪东保
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
权限相关接口
父级
d1fba356
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
142 行增加
和
5 行删除
+142
-5
src/main/java/com/cmeeting/ad/entity/RobotSecurityUser.java
+1
-1
src/main/java/com/cmeeting/controller/PermissionController.java
+7
-1
src/main/java/com/cmeeting/pojo/ModulePermission.java
+7
-0
src/main/java/com/cmeeting/service/ModulePermissionService.java
+2
-0
src/main/java/com/cmeeting/service/impl/ModulePermissionServiceImpl.java
+17
-0
src/main/java/com/cmeeting/service/impl/ShareUserServiceImpl.java
+5
-2
src/main/java/com/cmeeting/util/TencentMeetingApiUtil.java
+95
-0
src/test/java/MeetingApiTest.java
+8
-1
没有找到文件。
src/main/java/com/cmeeting/ad/entity/RobotSecurityUser.java
浏览文件 @
0705d440
...
...
@@ -31,7 +31,7 @@ public class RobotSecurityUser implements UserDetails {
*/
private
Integer
userType
;
private
String
id
;
private
Lo
ng
userId
;
private
Stri
ng
userId
;
private
String
username
;
@JsonIgnore
private
String
password
;
...
...
src/main/java/com/cmeeting/controller/PermissionController.java
浏览文件 @
0705d440
package
com
.
cmeeting
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.cmeeting.ad.util.SecurityUtil
;
import
com.cmeeting.constant.CategoryConstant
;
import
com.cmeeting.constant.PermissionPruposeType
;
import
com.cmeeting.pojo.ModulePermission
;
...
...
@@ -51,6 +52,11 @@ public class PermissionController {
return
R
.
ok
(
modulePermissionService
.
auth
(
vo
.
getAuthData
()));
}
/**
* 取消授权
* @param vo
* @return
*/
@PostMapping
(
"/remove"
)
public
R
remove
(
@Validated
@RequestBody
AuthVO
.
Add
vo
)
{
boolean
needTarget
=
vo
.
getPurpose
().
equals
(
PermissionPruposeType
.
TEMPLATE_TYPE_PERMISSION
)
...
...
@@ -82,7 +88,7 @@ public class PermissionController {
*/
@GetMapping
(
"/personalCancel"
)
public
R
personalCancel
()
{
return
R
.
ok
();
return
R
.
ok
(
modulePermissionService
.
personalCancel
(
SecurityUtil
.
getUser
().
getUserId
())
);
}
...
...
src/main/java/com/cmeeting/pojo/ModulePermission.java
浏览文件 @
0705d440
...
...
@@ -3,7 +3,11 @@ package com.cmeeting.pojo;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.util.Date
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* meeting内部权限表
...
...
@@ -11,6 +15,9 @@ import lombok.Data;
*/
@TableName
(
value
=
"module_permission"
)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ModulePermission
{
/**
*
...
...
src/main/java/com/cmeeting/service/ModulePermissionService.java
浏览文件 @
0705d440
...
...
@@ -23,4 +23,6 @@ public interface ModulePermissionService extends IService<ModulePermission> {
Boolean
auth
(
List
<
AuthVO
.
Add
>
authData
);
List
<
PermissionCheckedDTO
.
User
>
personalCancelList
();
boolean
personalCancel
(
String
userId
);
}
src/main/java/com/cmeeting/service/impl/ModulePermissionServiceImpl.java
浏览文件 @
0705d440
...
...
@@ -20,6 +20,7 @@ import com.cmeeting.vo.AuthVO;
import
com.cmeeting.vo.PermissionVO
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.*
;
...
...
@@ -167,6 +168,22 @@ public class ModulePermissionServiceImpl extends ServiceImpl<ModulePermissionMap
}
return
retList
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
personalCancel
(
String
userId
)
{
this
.
remove
(
new
LambdaQueryWrapper
<
ModulePermission
>()
.
eq
(
ModulePermission:
:
getType
,
RecordTemplateConstant
.
REL_TYPE_USER
)
.
eq
(
ModulePermission:
:
getPurpose
,
PermissionPruposeType
.
ADMIN_AUTH
)
.
eq
(
ModulePermission:
:
getRelId
,
userId
));
ModulePermission
cancel
=
ModulePermission
.
builder
()
.
type
(
RecordTemplateConstant
.
REL_TYPE_USER
)
.
purpose
(
PermissionPruposeType
.
PERSONAL_CLOSE
)
.
relId
(
userId
)
.
createTime
(
new
Date
()).
build
();
return
this
.
save
(
cancel
);
}
}
...
...
src/main/java/com/cmeeting/service/impl/ShareUserServiceImpl.java
浏览文件 @
0705d440
...
...
@@ -125,6 +125,9 @@ public class ShareUserServiceImpl extends ServiceImpl<ShareUserMapper, ShareUser
List
<
String
>
userIds
=
shareUsers
.
stream
().
filter
(
e
->
e
.
getType
()
==
1
).
map
(
ShareUser:
:
getRelId
).
collect
(
Collectors
.
toList
());
if
(
CategoryConstant
.
ROOT_ID
.
equals
(
categoryId
))
{
if
(
CollUtil
.
isNotEmpty
(
userList
))
{
userIds
=
userIds
.
stream
().
filter
(
userList:
:
contains
).
collect
(
Collectors
.
toList
());
}
if
(
StrUtil
.
isNotBlank
(
search
))
{
users
=
iSysUserSyncService
.
findInUserIdsOrShareCateIds
(
userIds
,
shareCateIds
,
"1"
,
search
);
}
else
{
...
...
@@ -134,9 +137,9 @@ public class ShareUserServiceImpl extends ServiceImpl<ShareUserMapper, ShareUser
}
}
else
{
if
(
StrUtil
.
isNotBlank
(
search
))
{
users
=
iSysUserSyncService
.
findByParam
(
null
,
null
,
childrenDeptIds
,
"1"
,
search
,
null
);
users
=
iSysUserSyncService
.
findByParam
(
userList
,
null
,
childrenDeptIds
,
"1"
,
search
,
null
);
}
else
{
users
=
iSysUserSyncService
.
findByParam
(
null
,
null
,
null
,
"1"
,
search
,
categoryId
);
users
=
iSysUserSyncService
.
findByParam
(
userList
,
null
,
null
,
"1"
,
search
,
categoryId
);
}
}
if
(
CollUtil
.
isNotEmpty
(
users
))
{
...
...
src/main/java/com/cmeeting/util/TencentMeetingApiUtil.java
0 → 100644
浏览文件 @
0705d440
package
com
.
cmeeting
.
util
;
import
cn.hutool.core.collection.CollUtil
;
import
com.cmeeting.util.SignatureUtil
;
import
com.cmeeting.vo.CorpRecordsVO
;
import
com.google.gson.*
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
java.security.InvalidKeyException
;
import
java.security.NoSuchAlgorithmException
;
import
java.time.Instant
;
import
java.time.ZonedDateTime
;
import
java.util.List
;
import
java.util.Random
;
public
class
TencentMeetingApiUtil
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
int
total
=
100000000
;
int
count
=
0
;
ZonedDateTime
now
=
ZonedDateTime
.
now
();
long
startTime
=
now
.
minusDays
(
31
).
toEpochSecond
();
long
endTime
=
now
.
toEpochSecond
();
String
TENCENT_APPID
=
"210468336"
;
String
TENCENT_SDKID
=
"28790143843"
;
String
TENCENT_SECRETID
=
"0ks7u8cgQ8DGVtlYZeRA9TxZCjvUT3oL"
;
String
TENCENT_SECRETKEY
=
"gQU09rkJjiQfiGcUYdhiKq5Ol6LebXg4w7F7Ol0rwvvdv3Xy"
;
String
TENCENT_ADMIN_USERID
=
"woaJARCQAAftcvU6GGoOn66rdSZ4IrOA"
;
int
i
=
3
;
while
(
i
*
20
<
total
)
{
String
uri
=
String
.
format
(
"/v1/corp/records?start_time=%d&end_time=%d&page=%d&page_size=%d&operator_id=%s&operator_id_type=%d"
,
startTime
,
endTime
,
i
++,
20
,
"woaJARCQAAftcvU6GGoOn66rdSZ4IrOA"
,
1
);
String
httpMethod
=
"GET"
;
String
nonce
=
String
.
valueOf
(
new
Random
().
nextInt
(
100000
));
String
timestamp
=
String
.
valueOf
(
Instant
.
now
().
getEpochSecond
());
// 3. 生成签名
String
signature
=
SignatureUtil
.
generateSignature
(
TENCENT_SECRETID
,
TENCENT_SECRETKEY
,
httpMethod
,
nonce
,
timestamp
,
uri
,
""
);
// 4. 发送请求
try
(
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
())
{
HttpGet
request
=
new
HttpGet
(
"https://api.meeting.qq.com"
+
uri
);
request
.
setHeader
(
"X-TC-Key"
,
TENCENT_SECRETID
);
request
.
setHeader
(
"X-TC-Timestamp"
,
timestamp
);
request
.
setHeader
(
"X-TC-Nonce"
,
nonce
);
request
.
setHeader
(
"X-TC-Signature"
,
signature
);
request
.
setHeader
(
"AppId"
,
TENCENT_APPID
);
request
.
setHeader
(
"SdkId"
,
TENCENT_SDKID
);
// 5. 解析响应
String
response
=
EntityUtils
.
toString
(
httpClient
.
execute
(
request
).
getEntity
());
JsonObject
jsonResponse
=
JsonParser
.
parseString
(
response
).
getAsJsonObject
();
Gson
gson
=
new
GsonBuilder
()
.
setFieldNamingPolicy
(
FieldNamingPolicy
.
LOWER_CASE_WITH_UNDERSCORES
)
.
create
();
// 将 JsonObject 转换为实体类
CorpRecordsVO
corpRecords
=
gson
.
fromJson
(
jsonResponse
,
CorpRecordsVO
.
class
);
if
(
corpRecords
==
null
)
{
return
;
}
for
(
CorpRecordsVO
.
RecordMeeting
recordMeeting
:
corpRecords
.
getRecordMeetings
())
{
String
subject
=
recordMeeting
.
getSubject
();
if
(
subject
.
contains
(
"启动会"
))
{
count
++;
System
.
out
.
println
(
"会议名: "
+
subject
);
String
meetingRecordId
=
recordMeeting
.
getMeetingRecordId
();
System
.
out
.
println
(
"meetingRecordId: "
+
meetingRecordId
);
List
<
CorpRecordsVO
.
RecordFile
>
recordFiles
=
recordMeeting
.
getRecordFiles
();
if
(
CollUtil
.
isEmpty
(
recordFiles
))
{
continue
;
}
System
.
out
.
print
(
"recordFileId: "
);
for
(
CorpRecordsVO
.
RecordFile
recordFile
:
recordFiles
)
{
String
recordFileId
=
recordFile
.
getRecordFileId
();
System
.
out
.
print
(
recordFileId
+
","
);
}
}
}
if
(
count
>=
3
)
{
break
;
}
}
}
}
}
src/test/java/MeetingApiTest.java
浏览文件 @
0705d440
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.tencentcloudapi.wemeet.Client
;
import
com.tencentcloudapi.wemeet.core.authenticator.JWTAuthenticator
;
import
com.tencentcloudapi.wemeet.core.exception.ClientException
;
...
...
@@ -8,7 +10,9 @@ import com.tencentcloudapi.wemeet.service.records.model.V1AddressesRecordFileIdG
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.math.BigInteger
;
import
java.nio.charset.StandardCharsets
;
...
...
@@ -27,7 +31,7 @@ public class MeetingApiTest {
String
tencentAdminUserId
=
"woaJARCQAAftcvU6GGoOn66rdSZ4IrOA"
;
String
recordFileId
=
"194
318258205138124
9"
;
String
recordFileId
=
"194
600769378405580
9"
;
Client
client
=
new
Client
.
Builder
()
.
withAppId
(
tencentAppId
).
withSdkId
(
tencentSdkId
)
.
withSecret
(
tencentSecretId
,
tencentSecretKey
)
...
...
@@ -63,6 +67,9 @@ public class MeetingApiTest {
// 2. 将二进制文件转换为文本
String
recordTextContent
=
new
String
(
fileData
,
StandardCharsets
.
UTF_8
);
System
.
out
.
println
(
recordTextContent
);
File
file
=
new
File
(
"D:/desktop/a.txt"
);
FileUtil
.
writeString
(
recordTextContent
,
file
,
StandardCharsets
.
UTF_8
);
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论