会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Ashe
https://ashe-c0de.github.io/
首页
管理
上一页
1
···
10
11
12
13
14
15
16
17
18
···
22
下一页
2024年1月2日
唯一ID生成_Java实现
摘要: 最近在接入接口时,需要提供一个客户端生成的唯一ID,因此写了一个简单的唯一ID生成的工具类(有bug请勿使用) public class IdGenerator{ /** * CAS计数器 */ private static AtomicInteger counter = new AtomicInt
阅读全文
posted @ 2024-01-02 12:15 Ashe|||^_^
阅读(154)
评论(0)
推荐(0)
2023年12月19日
异步记录第三方接口调用日志的优雅实现(HttpClient+装饰者模式+异步线程池/MQ)
摘要: 对于第三方接口调用日志这个功能,笔者在工作中曾见过以下两种方式: Restemplate+装饰者模式+MQ实现 网关监控 + Feign拦截器 + 观察者模式实现 其中观察者模式的实现是我最为佩服的设计(站在了一种很新的角度来解决问题),个人认为以上两种实现都显得略过臃肿,应该简化设计,让异步记录的
阅读全文
posted @ 2023-12-19 12:46 Ashe|||^_^
阅读(857)
评论(0)
推荐(0)
2023年12月11日
测试类注入Bean失败,Could not autowire, No bean of 'XxxService' type found
摘要: Spring Boot 2.2 是第一个正式支持 JUnit 5 的版本。 因此在写测试类的时候,JUnit4和JUnit5是有一点区别的。JUnit4需要需要两个注解 @SpringBootTest @Runwith(SpringRunner.class) Junit5的测试类则只需要一个注解 @
阅读全文
posted @ 2023-12-11 17:55 Ashe|||^_^
阅读(85)
评论(0)
推荐(0)
2023年12月8日
httpclient跳过SSL证书验证的写法
摘要: 最近在请求https接口的时候,发生了异常: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SuncertPathBuilderExceptio
阅读全文
posted @ 2023-12-08 15:31 Ashe|||^_^
阅读(1538)
评论(0)
推荐(0)
2023年12月7日
接口文档对接__参数
摘要: 参数常见枚举值 O(Optional):表示参数是可选的。 M(Mandatory):表示参数是必填的。 其他可能的枚举值 R(Required):与“M”相似,表示参数是必需的。 C(Conditional):表示参数的必填性取决于其他参数的值或某些条件。 D(Default):表示参数有默认值,
阅读全文
posted @ 2023-12-07 11:24 Ashe|||^_^
阅读(500)
评论(0)
推荐(0)
2023年11月28日
AOP切面编程实现异常捕获——try-catch的更优解?
摘要: AOP(面向切面编程)是一种编程范式,它的目的是通过将横切关注点(如日志记录、事务管理、异常处理等)从主要业务逻辑中分离出来,以提高代码的模块化和可维护性。在异常处理方面,有人认为使用AOP来实现异常捕获能够提供更优雅的解决方案,相比于传统的try-catch块。 以下是一些可能的优势和注意事项:
阅读全文
posted @ 2023-11-28 21:38 Ashe|||^_^
阅读(768)
评论(0)
推荐(0)
2023年11月9日
Something went wrong. If this issue persists please contact us through our help center at help.openai.com.
摘要: Sometimes I use chatGPT on Chrome, An error has occurred: Something went wrong. If this issue persists please contact us through our help center at he
阅读全文
posted @ 2023-11-09 22:56 Ashe|||^_^
阅读(416)
评论(0)
推荐(0)
2023年10月31日
理解Golang的闭包
摘要: 闭包是指一个函数值(function value),它可以引用其函数体之外的变量 闭包代码示例 func makeSuffix() func(str string) string { var suffix = ".jpg" return func(str string) string { if st
阅读全文
posted @ 2023-10-31 21:03 Ashe|||^_^
阅读(24)
评论(0)
推荐(0)
2023年10月30日
理解递归函数
摘要: 递归函数的两个特征 函数自己调用自己 一定存在某个条件来终止递归,以避免无限递归 func main() { // result is : 2 2 3 recursion(4) } func recursion(num int) { if num > 2 { num-- recursion(num)
阅读全文
posted @ 2023-10-30 23:55 Ashe|||^_^
阅读(30)
评论(0)
推荐(0)
打印空心金字塔_Golang实现
摘要: * * * * * * * * * * * * * * * * * * * * * * * * 需求:在控制台打印如上图所示的效果图 解题思路: 首先简化问题,用嵌套for循环打印出实心金字塔,由题可观察得知,层数与star(星号)数量保持着一定关系(奇数队列),1、3、5、7……2n-1 然后,格
阅读全文
posted @ 2023-10-30 22:01 Ashe|||^_^
阅读(61)
评论(0)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
···
22
下一页
公告