jinpengyong
2020-08-05 91c1c308abec43a67335cdebb574940ed41b09cf
src/main/java/com/moral/controller/AccountController.java
@@ -2,12 +2,15 @@
import static com.moral.common.util.WebUtils.getParametersStartingWith;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
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;
import org.springframework.web.bind.annotation.RestController;
@@ -31,9 +34,22 @@
        return new ResultBean<PageBean<Account>>(accounts);
    }
    @GetMapping("account")
    @PostMapping("account")
    public ResultBean<Integer> saveOrUpdateAccount(@RequestBody Account account) {
       Integer result = accountService.saveOrUpdateAccount(account);
       return new ResultBean<Integer>(result);
    }
    @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);
    }
}