feat: limit daily AI formatting usage

This commit is contained in:
Tim
2025-07-14 18:13:36 +08:00
parent d7287deadb
commit fd6a9521c1
9 changed files with 139 additions and 2 deletions

View File

@@ -25,6 +25,9 @@ public class ConfigController {
@Value("${app.captcha.comment-enabled:false}")
private boolean commentCaptchaEnabled;
@Value("${app.ai.format-limit:3}")
private int aiFormatLimit;
@GetMapping("/config")
public ConfigResponse getConfig() {
ConfigResponse resp = new ConfigResponse();
@@ -33,6 +36,7 @@ public class ConfigController {
resp.setLoginCaptchaEnabled(loginCaptchaEnabled);
resp.setPostCaptchaEnabled(postCaptchaEnabled);
resp.setCommentCaptchaEnabled(commentCaptchaEnabled);
resp.setAiFormatLimit(aiFormatLimit);
return resp;
}
@@ -43,5 +47,6 @@ public class ConfigController {
private boolean loginCaptchaEnabled;
private boolean postCaptchaEnabled;
private boolean commentCaptchaEnabled;
private int aiFormatLimit;
}
}