摘要: 1、基本规则 假如后端实际地址为: http://127.0.0.1:8080/api/user/getById?id=123 则: 1)通过nginx转发,使用http://127.0.0.1/api/user/getById?id=123访问 server { listen 80; server 阅读全文
posted @ 2024-04-16 11:23 我没有出家 阅读(3) 评论(0) 推荐(0) 编辑
摘要: @SpringBootConfiguration 是一个组合注解,由 @ComponentScan、@EnableAutoConfiguration 和 @SpringBootConfiguration 组成 @SpringBootConfiguration 与普通 @Configuration 相 阅读全文
posted @ 2024-04-07 20:49 我没有出家 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1、抛出检查异常导致事务不能正确回滚 原因:Spring 默认只会回滚非检查异常 解决:配置 rollbackFor 属性 @Transactional(rollbackFor = Exception.class) 2、业务方法内自己 try-catch 异常导致事务不能正确回滚 原因:事务通知只有 阅读全文
posted @ 2024-03-25 23:21 我没有出家 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 获取容器中的bean @Component public class ApplicationContextUtil implements ApplicationContextAware { public static ApplicationContext applicationContext; @O 阅读全文
posted @ 2024-03-21 15:48 我没有出家 阅读(5) 评论(0) 推荐(0) 编辑
摘要: // 获取对象中属性的值 public String getFieldValue(String attrName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { // 转驼峰 Str 阅读全文
posted @ 2024-03-21 15:37 我没有出家 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 12个阶段 1、prepareRefresh,做准备工作 2、obtainFreshBeanFactory,创建或获取beanfactory 3、prepareBeanFactory,准备beanfactory 4、postProcessBeanFactory,子类扩展beanfactory 5、i 阅读全文
posted @ 2024-03-20 21:33 我没有出家 阅读(3) 评论(0) 推荐(0) 编辑
摘要: /** * @author: szc * @date: 2023/9/2 22:45 * @version: 1.0 * @description: 从map中获取函数式接口,解决if-else 多个子类问题 */ @Service public class MapToInterface { @Au 阅读全文
posted @ 2023-12-10 20:10 我没有出家 阅读(6) 评论(0) 推荐(0) 编辑
摘要: private String getTimeOutStr(long nowDate, long lastTime) { String str =""; long minute = 1000 * 60 ; long hour = 1000 * 60 * 60 ; long day = 1000 * 6 阅读全文
posted @ 2023-11-10 16:51 我没有出家 阅读(4) 评论(0) 推荐(0) 编辑
摘要: -- 当前用户所有表 注释 行数 select utc.table_name, utc.COMMENTS, ut.num_rows from user_tab_comments utc , user_tables ut where utc.table_name = ut.table_name -- 阅读全文
posted @ 2023-08-18 17:13 我没有出家 阅读(19) 评论(0) 推荐(0) 编辑
摘要: SELECT sess.sid,sess.serial#,lo.oracle_username,lo.os_user_name,ao.object_name,lo.locked_mode FROM v$locked_object lo,dba_objects ao,v$session sess wh 阅读全文
posted @ 2023-08-18 17:12 我没有出家 阅读(12) 评论(0) 推荐(0) 编辑