From 037b129823671f2c1a48c3b41a68bd4a46842c63 Mon Sep 17 00:00:00 2001 From: 86191 <2160251938@qq.com> Date: Fri, 23 Aug 2024 11:52:40 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B8=82?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/muyu/server/DataApplication.java | 3 +- .../mapper/ThirdPartyInterfaceMapper.java | 9 ++++ .../service/ThirdPartyInterfaceService.java | 13 ++++++ .../impl/ThirdPartyInterfaceServiceImpl.java | 44 +++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 cloud-data-server/src/main/java/com/muyu/server/mapper/ThirdPartyInterfaceMapper.java create mode 100644 cloud-data-server/src/main/java/com/muyu/server/service/ThirdPartyInterfaceService.java create mode 100644 cloud-data-server/src/main/java/com/muyu/server/service/impl/ThirdPartyInterfaceServiceImpl.java 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(); + } +}