修改楼盘评级接口
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package com.fangjia.service.datastore;
|
||||
|
||||
import com.fangjia.dal.mongo.model.CommunityRate;
|
||||
|
||||
public interface CommunityRateService {
|
||||
CommunityRate findById(String id);
|
||||
|
||||
CommunityRate findBySeeweadId(String id);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.fangjia.service.datastore;
|
||||
|
||||
import com.fangjia.dal.QueryParam;
|
||||
import com.fangjia.dal.mongo.dao.CommunityRateDao;
|
||||
import com.fangjia.dal.mongo.model.CommunityRate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CommunityRateServiceImpl implements CommunityRateService {
|
||||
private CommunityRateDao communityRateDao;
|
||||
|
||||
@Override
|
||||
public CommunityRate findById(String id) {
|
||||
return communityRateDao.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommunityRate findBySeeweadId(String id) {
|
||||
ArrayList<QueryParam> params = new ArrayList<QueryParam>();
|
||||
params.add(new QueryParam("commId", id));
|
||||
List<CommunityRate> communityRateList = communityRateDao.findAllByParams(params);
|
||||
if (communityRateList != null && !communityRateList.isEmpty()) {
|
||||
return communityRateList.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setCommunityRateDao(CommunityRateDao communityRateDao) {
|
||||
this.communityRateDao = communityRateDao;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user