Commit 2a9ae49c authored by 万成波's avatar 万成波

提交配置

parent e3003645
...@@ -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);
// 创建消息生产者
MessageProducer producer = session.createProducer(queue);
// 创建文本消息
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()); WxCpOAuth2Service oauth2Service = this.wxCpService.getOauth2Service();
System.out.println(oauth2Service.buildAuthorizationUrl("https://wecom.jift.edu.cn/bbs/", ""));
} catch (JMSException e) {
e.printStackTrace();
} finally {
// 关闭连接
try {
if (connection != null) {
connection.close();
}
} catch (JMSException e) {
e.printStackTrace();
}
}
} }
} }
...@@ -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);
} }
} }
......
...@@ -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
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment