|
|
|
@ -9,6 +9,7 @@ import com.community.pocket.repository.BaseDao; |
|
|
|
|
import com.community.pocket.repository.CreditScoreDao; |
|
|
|
|
import com.community.pocket.repository.EmailDao; |
|
|
|
|
import com.community.pocket.util.LookupOperationUtil; |
|
|
|
|
import com.community.pocket.util.TableName; |
|
|
|
|
import com.mongodb.client.result.UpdateResult; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
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.data.domain.PageRequest; |
|
|
|
|
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.Query; |
|
|
|
|
import org.springframework.data.mongodb.core.query.Update; |
|
|
|
@ -209,22 +211,8 @@ public class UserDao extends BaseDao<MyInfo> { |
|
|
|
|
|
|
|
|
|
//获取个人信息
|
|
|
|
|
public Info queryUser(String username) { |
|
|
|
|
MyInfo myInfo = mongoTemplate.findOne(new Query(Criteria.where("username").is(username)), entityClass()); |
|
|
|
|
if (myInfo != null) { |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Aggregation aggregation = Aggregation.newAggregation(LookupOperationUtil.scoreHistoryLookup, Aggregation.match(Criteria.where(LookupOperationUtil.idKey).is(username))); |
|
|
|
|
return mongoTemplate.aggregate(aggregation, TableName.info, Info.class).getUniqueMappedResult(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//修改密码
|
|
|
|
|