package com.iailab.module.data.channel.http.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.module.data.channel.http.dao.HttpTagDao; import com.iailab.module.data.channel.http.entity.HttpApiEntity; import com.iailab.module.data.channel.http.entity.HttpTagEntity; import com.iailab.module.data.channel.http.service.HttpApiService; import com.iailab.module.data.channel.http.service.HttpTagService; import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; @Slf4j @Service public class HttpTagServiceImpl extends ServiceImpl implements HttpTagService { @Resource private HttpApiService httpApiService; @Resource private HttpTagDao httpTagDao; @Override public PageResult queryPage(HttpTagPageReqVO reqVO) { return httpTagDao.selectPage(reqVO); } @Override public HttpTagEntity info(String id) { return httpTagDao.selectById(id); } @Override public void add(HttpTagEntity httpTagEntity) { httpTagDao.insert(httpTagEntity); } @Override public void update(HttpTagEntity httpTagEntity) { httpTagDao.updateById(httpTagEntity); } @Override public void delete(String id) { httpTagDao.deleteById(id); } @Override public List list() { return httpTagDao.selectList(new QueryWrapper<>()); } @Override public List selectList(Map params) { String httpId = (String) params.get("httpId"); HttpApiEntity httpApiEntity = httpApiService.info(httpId); return httpTagDao.selectList(new QueryWrapper() .eq("http_api_code", httpApiEntity.getCode()) .orderByDesc("create_time")); } @Override public List getByCode(String code) { return httpTagDao.selectList(new QueryWrapper() .eq("http_api_code", code) .orderByDesc("create_time")); } }