📄 accountserverimpl.java
字号:
package com.starit.service.Impl;
import java.util.List;
import com.starit.DAO.AccountDao;
import com.starit.model.Account;
import com.starit.model.Project;
import com.starit.service.AccountService;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class AccountServerImpl implements AccountService {
public AccountDao accountDao;
public boolean isValidUser(Account account) {
List accountList = accountDao.findByEntity(account);
return accountList.size()==1 ? true : false;
}
public String findProjectToXML(Account account) {
List projectList = accountDao.findProjectsByAccount(account);
for(int i=0; i<projectList.size();i++)
{
Project project = (Project)projectList.get(i);
project.setAccount(null);
}
XStream xstream = new XStream(new DomDriver());
//xstream.registerConverter(new NullConverter());
xstream.alias("Form", List.class);
xstream.alias("Project", Project.class);
String xml = xstream.toXML(projectList);
return xml;
}
public void setAccountDao(AccountDao accountDao) {
this.accountDao = accountDao;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -