Skip to content

Instantly share code, notes, and snippets.

View kaimz's full-sized avatar
🎯
Focusing

Kai Zhang kaimz

🎯
Focusing
  • Hangzhou, China
View GitHub Profile
@kaimz
kaimz / AESUtils.java
Created September 4, 2024 02:32
AES对称加密和解密算法工具类
/**
* eg.
* <code>
* // 获取IV偏移量
* String iv = AESUtils.generateIVAsString();
* // securityKey一般也定义为16、32位的无特殊字符的字符串,
* String encryptData = AESUtils.encrypt(data, securityKey, AESUtils.getIVFromString(iv));
* </code>
* AES工具类
* @author kai.zhang

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@kaimz
kaimz / ConfigSupport.java
Created March 21, 2023 03:32
config.yaml文件读取
public <T> T fromYAML(InputStream inputStream, Class<T> configType) throws IOException {
String content = resolveEnvParams(new InputStreamReader(inputStream));
return yamlMapper.readValue(content, configType);
}
@kaimz
kaimz / keybase.md
Last active March 23, 2022 12:25
keybase

Keybase proof

I hereby claim:

  • I am kaimz on github.
  • I am zhangk (https://keybase.io/zhangk) on keybase.
  • I have a public key whose fingerprint is 76A9 9672 6294 9ADB EB54 63DF F08A E995 38BE DF93

To claim this, I am signing this object:

@kaimz
kaimz / WrapResponseResultAdvice.java
Created December 15, 2021 07:50
spring.response 返回内容统一处理
package com.ruhnn.koc.core.config;
import static com.ruhnn.koc.constant.KocConstant.PAGE_REQUEST_ATTR;
import static com.ruhnn.koc.constant.KocLogLevelConstant.LEVEL0;
import static com.ruhnn.koc.constant.KocLogLevelConstant.LEVEL1;
import static com.ruhnn.koc.constant.KocLogLevelConstant.LEVEL2;
import static com.ruhnn.koc.exception.KocErrorEnum.SYS_ERROR;
import com.ruhnn.base.response.PageResponse;
import com.ruhnn.base.response.Response;