From a8c6cd0061792347f46e6777b5897c785f954210 Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Thu, 20 Sep 2018 11:41:38 +0800
Subject: [PATCH] 优化
---
src/main/java/com/moral/controller/AccountController.java | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/moral/controller/AccountController.java b/src/main/java/com/moral/controller/AccountController.java
index 4abb76d..3799f3d 100644
--- a/src/main/java/com/moral/controller/AccountController.java
+++ b/src/main/java/com/moral/controller/AccountController.java
@@ -9,6 +9,7 @@
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -39,15 +40,15 @@
return new ResultBean<Integer>(result);
}
- @PostMapping("account/id")
- public ResultBean<Integer> deleteAccountByLogic(@RequestBody Account account) {
- Integer result = accountService.deleteAccountByLogic(account);
- return new ResultBean<Integer>(result);
- }
-
- @PostMapping("accounts/ids")
+ @PostMapping("ids")
public ResultBean<Integer> deleteAccountsByLogic(@RequestBody List<Integer> ids) {
Integer result = accountService.deleteAccountsByLogic(ids);
return new ResultBean<Integer>(result);
}
+
+ @GetMapping("{accountName}")
+ public ResultBean<Integer> getAccountCountByAccountName(@PathVariable("accountName") String accountName) {
+ Integer result = accountService.getAccountCountByAccountName(accountName);
+ return new ResultBean<Integer>(result);
+ }
}
--
Gitblit v1.8.0