From 3a69f837469e8e6b6e3a2b1ff33f62af1b2ccc47 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Fri, 25 Apr 2025 14:49:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=8B=B1=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/wfc/system/api/domain/SysOperLog.java | 5 +++-- .../java/org/wfc/common/core/utils/MessageUtils.java | 11 +++++++++++ .../wfc/system/controller/UBillRuleController.java | 6 +++--- .../org/wfc/system/controller/UPackageController.java | 6 +++--- .../wfc/system/controller/URateLimitController.java | 6 +++--- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/wfc-api/wfc-api-system/src/main/java/org/wfc/system/api/domain/SysOperLog.java b/wfc-api/wfc-api-system/src/main/java/org/wfc/system/api/domain/SysOperLog.java index 2c3b95c..88ae05c 100644 --- a/wfc-api/wfc-api-system/src/main/java/org/wfc/system/api/domain/SysOperLog.java +++ b/wfc-api/wfc-api-system/src/main/java/org/wfc/system/api/domain/SysOperLog.java @@ -1,12 +1,13 @@ package org.wfc.system.api.domain; -import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import org.wfc.common.core.annotation.Excel; import org.wfc.common.core.annotation.Excel.ColumnType; import org.wfc.common.core.utils.MessageUtils; import org.wfc.common.core.web.domain.BaseEntity; +import java.util.Date; + /** * 操作日志记录表 oper_log * @@ -104,7 +105,7 @@ public class SysOperLog extends BaseEntity if (title == null || title.isEmpty()) { this.title=title; } - this.title = MessageUtils.message(title); + this.title = MessageUtils.messageEnUS(title); } public Integer getBusinessType() diff --git a/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/utils/MessageUtils.java b/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/utils/MessageUtils.java index 08b443e..124def4 100644 --- a/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/utils/MessageUtils.java +++ b/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/utils/MessageUtils.java @@ -6,6 +6,8 @@ import org.springframework.context.MessageSource; import org.springframework.context.NoSuchMessageException; import org.springframework.context.i18n.LocaleContextHolder; +import java.util.Locale; + /** * 获取i18n资源文件 * @@ -30,4 +32,13 @@ public class MessageUtils { return code; } } + + public static String messageEnUS(String code, Object... args) { + try { + Locale locale = new Locale("en", "US"); + return MESSAGE_SOURCE.getMessage(code, args, locale); + } catch (NoSuchMessageException e) { + return code; + } + } } diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UBillRuleController.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UBillRuleController.java index c54378b..da59ea4 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UBillRuleController.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UBillRuleController.java @@ -53,19 +53,19 @@ public class UBillRuleController extends BaseController { return success(uBillRuleService.getById(id)); } - @Log(title = "Billing Rule", businessType = BusinessType.INSERT) + @Log(title = "menu.billing.rule.management", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody UBillRule uBillRule) { return toAjax(uBillRuleService.save(uBillRule)); } - @Log(title = "Billing Rule", businessType = BusinessType.UPDATE) + @Log(title = "menu.billing.rule.management", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody UBillRule uBillRule) { return toAjax(uBillRuleService.updateById(uBillRule)); } - @Log(title = "Billing Rule", businessType = BusinessType.DELETE) + @Log(title = "menu.billing.rule.management", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(uBillRuleService.removeByIds(CollUtil.newArrayList(ids))); diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UPackageController.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UPackageController.java index d694ed4..0588bdc 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UPackageController.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/UPackageController.java @@ -59,19 +59,19 @@ public class UPackageController extends BaseController { return success(uPackageService.getById(id)); } - @Log(title = "Package Managementt", businessType = BusinessType.INSERT) + @Log(title = "menu.billing.package.management", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody UPackage uPackage) { return toAjax(uPackageService.save(uPackage)); } - @Log(title = "Package Managementt", businessType = BusinessType.UPDATE) + @Log(title = "menu.billing.package.management", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody UPackage uPackage) { return toAjax(uPackageService.updateById(uPackage)); } - @Log(title = "Package Managementt", businessType = BusinessType.DELETE) + @Log(title = "menu.billing.package.management", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(uPackageService.removeByIds(CollUtil.newArrayList(ids))); diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/URateLimitController.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/URateLimitController.java index 626eedb..7131931 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/URateLimitController.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/URateLimitController.java @@ -53,19 +53,19 @@ public class URateLimitController extends BaseController { return success(uRateLimitService.getById(id)); } - @Log(title = "Rate Limit", businessType = BusinessType.INSERT) + @Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody URateLimit uRateLimit) { return toAjax(uRateLimitService.save(uRateLimit)); } - @Log(title = "Rate Limit", businessType = BusinessType.UPDATE) + @Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody URateLimit uRateLimit) { return toAjax(uRateLimitService.updateById(uRateLimit)); } - @Log(title = "Rate Limit", businessType = BusinessType.DELETE) + @Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(uRateLimitService.removeByIds(CollUtil.newArrayList(ids)));