| package com.ruoyi.integration.mongodb.service.impl; | 
|   | 
| import com.ruoyi.integration.iotda.constant.IotConstant; | 
| import com.ruoyi.integration.api.model.GroundLockRealTimeData; | 
| import com.ruoyi.integration.mongodb.service.GroundLockRealTimeDataService; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.data.mongodb.core.MongoTemplate; | 
| import org.springframework.stereotype.Service; | 
|   | 
| import java.util.List; | 
|   | 
| @Service | 
| public class GroundLockRealTimeDataServiceImpl implements GroundLockRealTimeDataService { | 
|     @Autowired | 
|     private MongoTemplate mongoTemplate; | 
|     @Override | 
|     public int create(GroundLockRealTimeData groundLockRealTimeData) { | 
|         mongoTemplate.save(groundLockRealTimeData); | 
|         return IotConstant.SUCCESS; | 
|     } | 
|   | 
|     @Override | 
|     public GroundLockRealTimeData findById(String id) { | 
|         return mongoTemplate.findById(id, GroundLockRealTimeData.class); | 
|     } | 
|   | 
|     @Override | 
|     public List<GroundLockRealTimeData> findAll() { | 
|         return mongoTemplate.findAll(GroundLockRealTimeData.class); | 
|     } | 
| } |