| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | @Service |
| | | public class HttpApiServiceImpl extends ServiceImpl<HttpApiDao, HttpApiEntity> implements HttpApiService { |
| | | |
| | | @Resource |
| | | private HttpApiDao httpApiDao; |
| | | |
| | | |
| | | private static Map<String, HttpApiEntity> idMap = new ConcurrentHashMap<>(); |
| | | |
| | | @Override |
| | | public PageResult<HttpApiEntity> queryPage(HttpApiPageReqVO reqVO) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public HttpApiEntity getFromCatch(String id) { |
| | | if (idMap.containsKey(id)) { |
| | | return idMap.get(id); |
| | | } |
| | | HttpApiEntity entity = httpApiDao.selectById(id); |
| | | if (entity == null) { |
| | | return null; |
| | | } |
| | | idMap.put(id, entity); |
| | | return idMap.get(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<HttpApiEntity> list() { |
| | | return httpApiDao.selectList(new QueryWrapper<>()); |
| | | } |