|
|
@ -9,6 +9,7 @@ import com.community.pocket.repository.BaseDao; |
|
|
|
import com.community.pocket.repository.CreditScoreDao; |
|
|
|
import com.community.pocket.repository.CreditScoreDao; |
|
|
|
import com.community.pocket.repository.EmailDao; |
|
|
|
import com.community.pocket.repository.EmailDao; |
|
|
|
import com.community.pocket.util.LookupOperationUtil; |
|
|
|
import com.community.pocket.util.LookupOperationUtil; |
|
|
|
|
|
|
|
import com.community.pocket.util.TableName; |
|
|
|
import com.mongodb.client.result.UpdateResult; |
|
|
|
import com.mongodb.client.result.UpdateResult; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.data.domain.PageRequest; |
|
|
|
import org.springframework.data.domain.PageRequest; |
|
|
|
import org.springframework.data.domain.Sort; |
|
|
|
import org.springframework.data.domain.Sort; |
|
|
|
|
|
|
|
import org.springframework.data.mongodb.core.aggregation.Aggregation; |
|
|
|
import org.springframework.data.mongodb.core.query.Criteria; |
|
|
|
import org.springframework.data.mongodb.core.query.Criteria; |
|
|
|
import org.springframework.data.mongodb.core.query.Query; |
|
|
|
import org.springframework.data.mongodb.core.query.Query; |
|
|
|
import org.springframework.data.mongodb.core.query.Update; |
|
|
|
import org.springframework.data.mongodb.core.query.Update; |
|
|
@ -209,22 +211,8 @@ public class UserDao extends BaseDao<MyInfo> { |
|
|
|
|
|
|
|
|
|
|
|
//获取个人信息
|
|
|
|
//获取个人信息
|
|
|
|
public Info queryUser(String username) { |
|
|
|
public Info queryUser(String username) { |
|
|
|
MyInfo myInfo = mongoTemplate.findOne(new Query(Criteria.where("username").is(username)), entityClass()); |
|
|
|
Aggregation aggregation = Aggregation.newAggregation(LookupOperationUtil.scoreHistoryLookup, Aggregation.match(Criteria.where(LookupOperationUtil.idKey).is(username))); |
|
|
|
if (myInfo != null) { |
|
|
|
return mongoTemplate.aggregate(aggregation, TableName.info, Info.class).getUniqueMappedResult(); |
|
|
|
Info info = new Info(); |
|
|
|
|
|
|
|
info.setUsername(myInfo.getUsername()); |
|
|
|
|
|
|
|
info.setCreditScore(myInfo.getCreditScore()); |
|
|
|
|
|
|
|
info.setEmail(myInfo.getEmail()); |
|
|
|
|
|
|
|
info.setHeadImg(myInfo.getHeadImg()); |
|
|
|
|
|
|
|
info.setMobie(myInfo.getMobie()); |
|
|
|
|
|
|
|
info.setPosts(myInfo.getPosts()); |
|
|
|
|
|
|
|
info.setVisitors(myInfo.getVisitors()); |
|
|
|
|
|
|
|
info.setScoreHistory(myInfo.getScoreHistory()); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//修改密码
|
|
|
|
//修改密码
|
|
|
|