Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
safe-campus-bbs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万成波
safe-campus-bbs
Commits
2a9ae49c
Commit
2a9ae49c
authored
Sep 28, 2025
by
万成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交配置
parent
e3003645
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
55 deletions
+7
-55
safe-campus-admin/src/test/java/com/tangguo/ApplicationTest.java
...mpus-admin/src/test/java/com/tangguo/ApplicationTest.java
+3
-51
safe-campus-framework/src/main/java/com/tangguo/framework/web/service/SysLoginService.java
...va/com/tangguo/framework/web/service/SysLoginService.java
+2
-2
safe-campus-system/src/main/resources/mapper/system/SysDeptMapper.xml
...system/src/main/resources/mapper/system/SysDeptMapper.xml
+1
-1
safe-campus-system/src/main/resources/mapper/system/SysUserMapper.xml
...system/src/main/resources/mapper/system/SysUserMapper.xml
+1
-1
No files found.
safe-campus-admin/src/test/java/com/tangguo/ApplicationTest.java
View file @
2a9ae49c
...
@@ -2,6 +2,7 @@ package com.tangguo;
...
@@ -2,6 +2,7 @@ package com.tangguo;
import
com.tangguo.common.constant.ActiveMQConstant
;
import
com.tangguo.common.constant.ActiveMQConstant
;
import
com.tangguo.common.domain.PointsDetail
;
import
com.tangguo.common.domain.PointsDetail
;
import
me.chanjar.weixin.cp.api.WxCpOAuth2Service
;
import
me.chanjar.weixin.cp.api.WxCpService
;
import
me.chanjar.weixin.cp.api.WxCpService
;
import
org.apache.activemq.ActiveMQConnectionFactory
;
import
org.apache.activemq.ActiveMQConnectionFactory
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
...
@@ -33,59 +34,10 @@ public class ApplicationTest {
...
@@ -33,59 +34,10 @@ public class ApplicationTest {
@Test
@Test
public
void
test
()
{
public
void
test
()
{
PointsDetail
detail
=
new
PointsDetail
();
detail
.
setUserName
(
"TanXiao"
);
detail
.
setDetailPoints
(
10
);
detail
.
setDetailName
(
"外部系统"
);
detail
.
setDescription
(
"外部系统"
);
this
.
jmsTemplate
.
convertAndSend
(
ActiveMQConstant
.
Points
.
DECR_USER_POINTS_QUEUE
,
detail
,
message
->
{
message
.
setStringProperty
(
"userName"
,
detail
.
getUserName
());
return
message
;
});
}
public
static
void
main
(
String
[]
args
)
{
// 连接到ActiveMQ
ActiveMQConnectionFactory
connectionFactory
=
new
ActiveMQConnectionFactory
(
"tcp://localhost:61616"
);
connectionFactory
.
setUserName
(
"admin"
);
connectionFactory
.
setPassword
(
"admin"
);
Connection
connection
=
null
;
try
{
connection
=
connectionFactory
.
createConnection
();
connection
.
start
();
// 创建会话
Session
session
=
connection
.
createSession
(
false
,
Session
.
AUTO_ACKNOWLEDGE
);
// 创建目标队列
Queue
queue
=
session
.
createQueue
(
ActiveMQConstant
.
Points
.
INCR_USER_POINTS_QUEUE
);
// 创建消息生产者
WxCpOAuth2Service
oauth2Service
=
this
.
wxCpService
.
getOauth2Service
();
MessageProducer
producer
=
session
.
createProducer
(
queue
);
System
.
out
.
println
(
oauth2Service
.
buildAuthorizationUrl
(
"https://wecom.jift.edu.cn/bbs/"
,
""
)
);
// 创建文本消息
TextMessage
message
=
session
.
createTextMessage
(
"Hello ActiveMQ!"
);
// 设置有效期为5秒(5000毫秒)
long
timeToLive
=
5000
;
// 5000毫秒
producer
.
send
(
message
,
DeliveryMode
.
PERSISTENT
,
Message
.
DEFAULT_PRIORITY
,
timeToLive
);
System
.
out
.
println
(
"消息发送成功,消息ID: "
+
message
.
getJMSMessageID
());
}
catch
(
JMSException
e
)
{
e
.
printStackTrace
();
}
finally
{
// 关闭连接
try
{
if
(
connection
!=
null
)
{
connection
.
close
();
}
}
catch
(
JMSException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
safe-campus-framework/src/main/java/com/tangguo/framework/web/service/SysLoginService.java
View file @
2a9ae49c
...
@@ -189,7 +189,7 @@ public class SysLoginService {
...
@@ -189,7 +189,7 @@ public class SysLoginService {
userName
=
authUserInfo
.
getUserId
();
userName
=
authUserInfo
.
getUserId
();
}
catch
(
WxErrorException
e
)
{
}
catch
(
WxErrorException
e
)
{
log
.
error
(
"=> 移动端用户登录失败,查询当前企微用户数据失败:"
,
e
);
log
.
error
(
"=> 移动端用户登录失败,查询当前企微用户数据失败:"
,
e
);
throw
new
ServiceException
(
"登录失败,查询当前企微用户数据失败。"
);
throw
new
ServiceException
(
"登录失败,查询当前企微用户数据失败。"
,
401
);
}
}
try
{
try
{
...
@@ -200,7 +200,7 @@ public class SysLoginService {
...
@@ -200,7 +200,7 @@ public class SysLoginService {
return
resultMap
;
return
resultMap
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"=> 移动端用户登录失败,生成用户Token失败:"
,
e
);
log
.
error
(
"=> 移动端用户登录失败,生成用户Token失败:"
,
e
);
throw
new
ServiceException
(
"登录失败:"
+
e
.
getMessage
());
throw
new
ServiceException
(
"登录失败:"
+
e
.
getMessage
()
,
401
);
}
}
}
}
...
...
safe-campus-system/src/main/resources/mapper/system/SysDeptMapper.xml
View file @
2a9ae49c
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
SELECT
SELECT
q.id, q.parent_id, q.ancestors, q.dept_name, q.order_num, q.create_time
q.id, q.parent_id, q.ancestors, q.dept_name, q.order_num, q.create_time
FROM
FROM
qwmh_sys_dept
q
ods_sys_dept_view
q
LEFT JOIN
LEFT JOIN
sys_dept d ON d.dept_id = q.id
sys_dept d ON d.dept_id = q.id
WHERE
WHERE
...
...
safe-campus-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
2a9ae49c
...
@@ -272,7 +272,7 @@
...
@@ -272,7 +272,7 @@
SELECT
SELECT
q.dept_id, q.user_name, q.real_name, q.phonenumber, q.email, q.avatar, q.create_time
q.dept_id, q.user_name, q.real_name, q.phonenumber, q.email, q.avatar, q.create_time
FROM
FROM
qwmh_sys_user
q
ods_sys_user_view
q
LEFT JOIN
LEFT JOIN
sys_user u ON u.user_name = q.user_name
sys_user u ON u.user_name = q.user_name
WHERE
WHERE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment