| package com.ruoyi.integration.mongodb.service.impl; | 
|   | 
| import com.ruoyi.integration.iotda.constant.IotConstant; | 
| import com.ruoyi.integration.api.model.OpenOrCloseGroundLock; | 
| import com.ruoyi.integration.mongodb.service.OpenOrCloseGroundLockService; | 
| 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 OpenOrCloseGroundLockServiceImpl implements OpenOrCloseGroundLockService { | 
|     @Autowired | 
|     private MongoTemplate mongoTemplate; | 
|     @Override | 
|     public int create(OpenOrCloseGroundLock openOrCloseGroundLock) { | 
|         mongoTemplate.save(openOrCloseGroundLock); | 
|         return IotConstant.SUCCESS; | 
|     } | 
|   | 
|     @Override | 
|     public OpenOrCloseGroundLock findById(String id) { | 
|         return mongoTemplate.findById(id, OpenOrCloseGroundLock.class); | 
|     } | 
|   | 
|     @Override | 
|     public List<OpenOrCloseGroundLock> findAll() { | 
|         return mongoTemplate.findAll(OpenOrCloseGroundLock.class); | 
|     } | 
| } |