fix: AjaxResult default return EN message
This commit is contained in:
@@ -67,9 +67,18 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult success()
|
||||
{
|
||||
return AjaxResult.success(MessageUtils.message("common.operate.success"));
|
||||
return AjaxResult.success("Operation successful");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult i18nsuccess() {
|
||||
return AjaxResult.success("common.operate.success");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功数据
|
||||
*
|
||||
@@ -77,9 +86,18 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult success(Object data)
|
||||
{
|
||||
return AjaxResult.success(MessageUtils.message("common.operate.success"), data);
|
||||
return AjaxResult.success("Operation successful", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功数据
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult i18nsuccess(Object data) {
|
||||
return AjaxResult.success("common.operate.success", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
@@ -88,7 +106,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult success(String msg)
|
||||
{
|
||||
return AjaxResult.success(MessageUtils.message(msg), null);
|
||||
return AjaxResult.success(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,7 +118,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult success(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.SUCCESS, MessageUtils.message(msg), data);
|
||||
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +129,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult warn(String msg)
|
||||
{
|
||||
return AjaxResult.warn(MessageUtils.message(msg), null);
|
||||
return AjaxResult.warn(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,7 +141,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult warn(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.WARN, MessageUtils.message(msg), data);
|
||||
return new AjaxResult(HttpStatus.WARN, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +151,16 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult error()
|
||||
{
|
||||
return AjaxResult.error(MessageUtils.message("common.operate.failed"));
|
||||
return AjaxResult.error("Operation failed");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult i18nerror() {
|
||||
return AjaxResult.error("common.operate.failed");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,7 +171,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult error(String msg)
|
||||
{
|
||||
return AjaxResult.error(MessageUtils.message(msg), null);
|
||||
return AjaxResult.error(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +183,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult error(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.ERROR, MessageUtils.message(msg), data);
|
||||
return new AjaxResult(HttpStatus.ERROR, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +195,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
*/
|
||||
public static AjaxResult error(int code, String msg)
|
||||
{
|
||||
return new AjaxResult(code, MessageUtils.message(msg), null);
|
||||
return new AjaxResult(code, msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,19 +53,19 @@ public class UBillRuleController extends BaseController {
|
||||
return success(uBillRuleService.getById(id));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.rule.management", businessType = BusinessType.INSERT)
|
||||
@Log(title = "Billing Rule", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UBillRule uBillRule) {
|
||||
return toAjax(uBillRuleService.save(uBillRule));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.rule.management", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "Billing Rule", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UBillRule uBillRule) {
|
||||
return toAjax(uBillRuleService.updateById(uBillRule));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.rule.management", businessType = BusinessType.DELETE)
|
||||
@Log(title = "Billing Rule", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(uBillRuleService.removeByIds(CollUtil.newArrayList(ids)));
|
||||
|
||||
@@ -59,19 +59,19 @@ public class UPackageController extends BaseController {
|
||||
return success(uPackageService.getById(id));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.package.management", businessType = BusinessType.INSERT)
|
||||
@Log(title = "Package Managementt", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UPackage uPackage) {
|
||||
return toAjax(uPackageService.save(uPackage));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.package.management", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "Package Managementt", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UPackage uPackage) {
|
||||
return toAjax(uPackageService.updateById(uPackage));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.package.management", businessType = BusinessType.DELETE)
|
||||
@Log(title = "Package Managementt", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(uPackageService.removeByIds(CollUtil.newArrayList(ids)));
|
||||
|
||||
@@ -53,19 +53,19 @@ public class URateLimitController extends BaseController {
|
||||
return success(uRateLimitService.getById(id));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.INSERT)
|
||||
@Log(title = "Rate Limit", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody URateLimit uRateLimit) {
|
||||
return toAjax(uRateLimitService.save(uRateLimit));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "Rate Limit", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody URateLimit uRateLimit) {
|
||||
return toAjax(uRateLimitService.updateById(uRateLimit));
|
||||
}
|
||||
|
||||
@Log(title = "menu.billing.ratelimit.management", businessType = BusinessType.DELETE)
|
||||
@Log(title = "Rate Limit", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(uRateLimitService.removeByIds(CollUtil.newArrayList(ids)));
|
||||
|
||||
Reference in New Issue
Block a user