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