This commit is contained in:
@@ -279,7 +279,7 @@ def build_path_change_markdown(
|
||||
new_display = f"<font color=\"info\">**`{new_uri}`**</font>" if new_uri else "<font color=\"comment\">已删除</font>"
|
||||
|
||||
parts = [
|
||||
"# API路径变更通知",
|
||||
"# 【API路径变更通知】",
|
||||
f"- **变更类型:** <font color=\"warning\">**{change_type}**</font>",
|
||||
f"- **修改人:** {push_user}",
|
||||
f"- **修改时间:** {push_time}",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# API路径变更通知
|
||||
# 【API路径变更通知】
|
||||
|
||||
- **变更类型:** {新增接口 / 修改路径 / 删除接口}
|
||||
- **修改人:** {Modifier}
|
||||
|
||||
@@ -86,6 +86,27 @@ public class CultureClockInController {
|
||||
return ActionResult.success(new Base64ImageVo(pair.getLeft(), base64Img));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打卡分享 - 获取随机图片[base64]
|
||||
* @param lastCombo 上次组合
|
||||
* @param response HttpServletResponse
|
||||
*/
|
||||
@GetMapping(value = "/random-preview/create")
|
||||
public ActionResult<Base64ImageVo> getRandomPicPreviewBase64(@RequestParam(value = "lastCombo", required = false) String lastCombo, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
MutablePair<String, BufferedImage> pair = cultureClockInService.getRandomPicPreview(lastCombo, requestUrl);
|
||||
if (pair == null || pair.getRight() == null) {
|
||||
throw new Exception("获取图片失败,请重试");
|
||||
}
|
||||
byte[] bytes;
|
||||
try (ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
||||
ImageIO.write(pair.getRight(), "png", output);
|
||||
bytes = output.toByteArray();
|
||||
}
|
||||
String base64 = Base64.getEncoder().encodeToString(bytes);
|
||||
String base64Img = "data:image/png;base64," + base64;
|
||||
return ActionResult.success(new Base64ImageVo(pair.getLeft(), base64Img));
|
||||
}
|
||||
|
||||
/**
|
||||
* 打卡分享 - 打卡
|
||||
|
||||
Reference in New Issue
Block a user