diff --git a/cloud-data-server/src/main/java/com/muyu/server/DataApplication.java b/cloud-data-server/src/main/java/com/muyu/server/DataApplication.java index 408b06d..2632170 100644 --- a/cloud-data-server/src/main/java/com/muyu/server/DataApplication.java +++ b/cloud-data-server/src/main/java/com/muyu/server/DataApplication.java @@ -6,12 +6,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @Author YuPing - * @Description + * @Description 主程序 * @Version 1.0 * @Data 2024-08-20 10:25:50 */ @SpringBootApplication -@MapperScan("com.muyu.server.mapper") public class DataApplication { public static void main(String[] args) { SpringApplication.run(DataApplication.class, args); diff --git a/cloud-data-server/src/main/java/com/muyu/server/mapper/ThirdPartyInterfaceMapper.java b/cloud-data-server/src/main/java/com/muyu/server/mapper/ThirdPartyInterfaceMapper.java new file mode 100644 index 0000000..5096dc0 --- /dev/null +++ b/cloud-data-server/src/main/java/com/muyu/server/mapper/ThirdPartyInterfaceMapper.java @@ -0,0 +1,9 @@ +package com.muyu.server.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.domain.ThirdPartyInterface; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ThirdPartyInterfaceMapper extends BaseMapper { +} diff --git a/cloud-data-server/src/main/java/com/muyu/server/service/ThirdPartyInterfaceService.java b/cloud-data-server/src/main/java/com/muyu/server/service/ThirdPartyInterfaceService.java new file mode 100644 index 0000000..c69e5c3 --- /dev/null +++ b/cloud-data-server/src/main/java/com/muyu/server/service/ThirdPartyInterfaceService.java @@ -0,0 +1,13 @@ +package com.muyu.server.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.domain.ThirdPartyInterface; +import com.muyu.domain.request.ThirdPartyInterfaceRequest; +import com.muyu.domain.response.ThirdPartyInterfaceResponse; + +import java.util.List; + +public interface ThirdPartyInterfaceService extends IService { + // 查询第三方接口列表 + List getThirdPartyInterfaceList(ThirdPartyInterfaceRequest request); +} diff --git a/cloud-data-server/src/main/java/com/muyu/server/service/impl/ThirdPartyInterfaceServiceImpl.java b/cloud-data-server/src/main/java/com/muyu/server/service/impl/ThirdPartyInterfaceServiceImpl.java new file mode 100644 index 0000000..515cdbd --- /dev/null +++ b/cloud-data-server/src/main/java/com/muyu/server/service/impl/ThirdPartyInterfaceServiceImpl.java @@ -0,0 +1,44 @@ +package com.muyu.server.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.common.core.utils.StringUtils; +import com.muyu.domain.ThirdPartyInterface; +import com.muyu.domain.request.ThirdPartyInterfaceRequest; +import com.muyu.domain.response.ThirdPartyInterfaceResponse; +import com.muyu.server.mapper.ThirdPartyInterfaceMapper; +import com.muyu.server.service.ThirdPartyInterfaceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author YuPing + * @Description 第三方接口服务实现类 + * @Version 1.0 + * @Data 2024-08-22 20:58:30 + */ +@Service +public class ThirdPartyInterfaceServiceImpl + extends ServiceImpl + implements ThirdPartyInterfaceService { + + /** + * 获取第三方接口列表 + * @param request + * @return + */ + @Override + public List getThirdPartyInterfaceList(ThirdPartyInterfaceRequest request) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like( + StringUtils.isNotEmpty(request.getApiName()), + ThirdPartyInterface::getApiName, request.getApiName() + ); + List thirdPartyInterfaceList = this.list(queryWrapper); + return thirdPartyInterfaceList.stream() + .map(ThirdPartyInterfaceResponse::build) + .toList(); + } +}