2
0

feat: 操作日志统一英语

This commit is contained in:
caiyuchao
2025-04-25 14:49:47 +08:00
parent b99d2600f7
commit 3a69f83746
5 changed files with 23 additions and 11 deletions

View File

@@ -1,12 +1,13 @@
package org.wfc.system.api.domain; package org.wfc.system.api.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.wfc.common.core.annotation.Excel; import org.wfc.common.core.annotation.Excel;
import org.wfc.common.core.annotation.Excel.ColumnType; import org.wfc.common.core.annotation.Excel.ColumnType;
import org.wfc.common.core.utils.MessageUtils; import org.wfc.common.core.utils.MessageUtils;
import org.wfc.common.core.web.domain.BaseEntity; import org.wfc.common.core.web.domain.BaseEntity;
import java.util.Date;
/** /**
* 操作日志记录表 oper_log * 操作日志记录表 oper_log
* *
@@ -104,7 +105,7 @@ public class SysOperLog extends BaseEntity
if (title == null || title.isEmpty()) { if (title == null || title.isEmpty()) {
this.title=title; this.title=title;
} }
this.title = MessageUtils.message(title); this.title = MessageUtils.messageEnUS(title);
} }
public Integer getBusinessType() public Integer getBusinessType()

View File

@@ -6,6 +6,8 @@ import org.springframework.context.MessageSource;
import org.springframework.context.NoSuchMessageException; import org.springframework.context.NoSuchMessageException;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import java.util.Locale;
/** /**
* 获取i18n资源文件 * 获取i18n资源文件
* *
@@ -30,4 +32,13 @@ public class MessageUtils {
return code; 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;
}
}
} }

View File

@@ -53,19 +53,19 @@ public class UBillRuleController extends BaseController {
return success(uBillRuleService.getById(id)); return success(uBillRuleService.getById(id));
} }
@Log(title = "Billing Rule", businessType = BusinessType.INSERT) @Log(title = "menu.billing.rule.management", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody UBillRule uBillRule) { public AjaxResult add(@RequestBody UBillRule uBillRule) {
return toAjax(uBillRuleService.save(uBillRule)); return toAjax(uBillRuleService.save(uBillRule));
} }
@Log(title = "Billing Rule", businessType = BusinessType.UPDATE) @Log(title = "menu.billing.rule.management", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody UBillRule uBillRule) { public AjaxResult edit(@RequestBody UBillRule uBillRule) {
return toAjax(uBillRuleService.updateById(uBillRule)); return toAjax(uBillRuleService.updateById(uBillRule));
} }
@Log(title = "Billing Rule", businessType = BusinessType.DELETE) @Log(title = "menu.billing.rule.management", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(uBillRuleService.removeByIds(CollUtil.newArrayList(ids))); return toAjax(uBillRuleService.removeByIds(CollUtil.newArrayList(ids)));

View File

@@ -59,19 +59,19 @@ public class UPackageController extends BaseController {
return success(uPackageService.getById(id)); return success(uPackageService.getById(id));
} }
@Log(title = "Package Managementt", businessType = BusinessType.INSERT) @Log(title = "menu.billing.package.management", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody UPackage uPackage) { public AjaxResult add(@RequestBody UPackage uPackage) {
return toAjax(uPackageService.save(uPackage)); return toAjax(uPackageService.save(uPackage));
} }
@Log(title = "Package Managementt", businessType = BusinessType.UPDATE) @Log(title = "menu.billing.package.management", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody UPackage uPackage) { public AjaxResult edit(@RequestBody UPackage uPackage) {
return toAjax(uPackageService.updateById(uPackage)); return toAjax(uPackageService.updateById(uPackage));
} }
@Log(title = "Package Managementt", businessType = BusinessType.DELETE) @Log(title = "menu.billing.package.management", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(uPackageService.removeByIds(CollUtil.newArrayList(ids))); return toAjax(uPackageService.removeByIds(CollUtil.newArrayList(ids)));

View File

@@ -53,19 +53,19 @@ public class URateLimitController extends BaseController {
return success(uRateLimitService.getById(id)); return success(uRateLimitService.getById(id));
} }
@Log(title = "Rate Limit", businessType = BusinessType.INSERT) @Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody URateLimit uRateLimit) { public AjaxResult add(@RequestBody URateLimit uRateLimit) {
return toAjax(uRateLimitService.save(uRateLimit)); return toAjax(uRateLimitService.save(uRateLimit));
} }
@Log(title = "Rate Limit", businessType = BusinessType.UPDATE) @Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody URateLimit uRateLimit) { public AjaxResult edit(@RequestBody URateLimit uRateLimit) {
return toAjax(uRateLimitService.updateById(uRateLimit)); return toAjax(uRateLimitService.updateById(uRateLimit));
} }
@Log(title = "Rate Limit", businessType = BusinessType.DELETE) @Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(uRateLimitService.removeByIds(CollUtil.newArrayList(ids))); return toAjax(uRateLimitService.removeByIds(CollUtil.newArrayList(ids)));