| | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.xiaopeng.api.dto.account.XpOperationsUserPositionDTO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class PositionMsgHandler implements BusinessMsgHandler{ |
| | | |
| | | @Override |
| | |
| | | update.set("location", location); |
| | | mongoTemplate.updateFirst(new Query(Criteria.where("id").is(dto.getId())), update, XpOperationsUserPositionDTO.class); |
| | | } |
| | | log.info("保存位置信息成功:id:{},longitude:{},latitude:{}", dto.getId(), dto.getLongitude(),dto.getLatitude()); |
| | | } |
| | | |
| | | } |