67,513
社区成员
发帖
与我相关
我的任务
分享
public interface AccountService {
public List<Account> findAll();
}
@Service("accountService")
public class AccountServiceImpl implements AccountService {
@Autowired
AccountDao accountDao;
@Override
public List<Account> findAll() {
System.out.println("业务层,查询所有账户信息。。。");
return accountDao.findAll();
}
}
@Controller
@RequestMapping("/account")
public class AccountController {
@Autowired
private AccountServiceImpl accountService1;
@RequestMapping("/findAll")
public String findAll(){
System.out.println("表现层--AccountController.findAll()");
List<Account> list = accountService1.findAll();
for(Account a:list){
System.out.println(a);
}
return "success";
}
}
@Autowired
private AccountService accountService1;
@Autowired
private AccountService accountService