From f16e4f5ceae314859195595eb10ae429398be347 Mon Sep 17 00:00:00 2001 From: wxy <14293288+zysysys@user.noreply.gitee.com> Date: Fri, 6 Sep 2024 12:00:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor(server):=20=E6=9B=B4=E6=96=B0bootstrap?= =?UTF-8?q?.yml=E9=85=8D=E7=BD=AE=E5=B9=B6=E4=BC=98=E5=8C=96ConnectorContr?= =?UTF-8?q?oller=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释更新,反映Nacos地址和Spring框架ID。 - 在ConnectorController中添加新接口findApiById,优化API小卡片列表接口。 - 更新ConnectorMapper,添加findApiById方法。 - 在ConnectorMappers.xml中添加对应的SQL查询。 - 更新ConnectorService接口,添加findApiById方法。 - 在ConnectorServiceImpl中实现findApiById方法。 -调整MarketController中的接口,规范化请求映射。 feat(server): 添加Mart相关组件 - 创建MartController,MartMapper,MartService及其实现类MartServiceImpl。 - 在pom.xml中添加cloud-modules-system依赖。- 在mapper目录下添加MartUserMapper.xml文件。 - 在src/main/java/com/muyu/cloud/mart/domain/pojo下创建User.java。 BREAKING CHANGE: 在bootstrap.yml中修改Nacos地址和Spring ID注释可能导致环境特定配置发生变化。请检查这些更改并根据需要调整环境配置。 --- .idea/misc.xml | 15 ++++++-- .../com/muyu/cloud/mart/domain/pojo/User.java | 11 ++++++ cloud-mart-server/pom.xml | 12 +++++++ .../mart/controller/ConnectorController.java | 26 ++++++++------ .../mart/controller/MarketController.java | 16 ++++----- .../cloud/mart/controller/MartController.java | 35 +++++++++++++++++++ .../cloud/mart/mapper/ConnectorMapper.java | 3 ++ .../muyu/cloud/mart/mapper/MartMapper.java | 18 ++++++++++ .../cloud/mart/service/ConnectorService.java | 2 ++ .../muyu/cloud/mart/service/MartService.java | 16 +++++++++ .../service/impl/ConnectorServiceImpl.java | 5 +++ .../mart/service/impl/MartServiceImpl.java | 24 +++++++++++++ .../src/main/resources/bootstrap.yml | 4 +-- .../resources/mapper/ConnectorMappers.xml | 3 ++ .../main/resources/mapper/MartUserMapper.xml | 9 +++++ 15 files changed, 176 insertions(+), 23 deletions(-) create mode 100644 cloud-mart-common/src/main/java/com/muyu/cloud/mart/domain/pojo/User.java create mode 100644 cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MartController.java create mode 100644 cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/MartMapper.java create mode 100644 cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/MartService.java create mode 100644 cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/impl/MartServiceImpl.java create mode 100644 cloud-mart-server/src/main/resources/mapper/MartUserMapper.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 78f492e..5ac9f68 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,12 @@ + + - - \ No newline at end of file + + + + + + diff --git a/cloud-mart-common/src/main/java/com/muyu/cloud/mart/domain/pojo/User.java b/cloud-mart-common/src/main/java/com/muyu/cloud/mart/domain/pojo/User.java new file mode 100644 index 0000000..dfe8e9f --- /dev/null +++ b/cloud-mart-common/src/main/java/com/muyu/cloud/mart/domain/pojo/User.java @@ -0,0 +1,11 @@ +package com.muyu.cloud.mart.domain.pojo; + +import com.baomidou.mybatisplus.annotation.TableName; + +/** + * @Author: wangxinyuan + * @Date: 2024/8/21 下午9:34 + */ +@TableName(value = "user") +public class User { +} diff --git a/cloud-mart-server/pom.xml b/cloud-mart-server/pom.xml index 34e6639..2553d5c 100644 --- a/cloud-mart-server/pom.xml +++ b/cloud-mart-server/pom.xml @@ -20,6 +20,14 @@ + + + com.muyu + cloud-modules-system + + + + com.alibaba.cloud @@ -56,6 +64,10 @@ cloud-common-datasource + + + + com.muyu diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/ConnectorController.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/ConnectorController.java index 5584a24..8887c9a 100644 --- a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/ConnectorController.java +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/ConnectorController.java @@ -1,7 +1,5 @@ package com.muyu.cloud.mart.controller; -import cn.hutool.db.PageResult; -import com.dtflys.forest.annotation.Post; import com.muyu.cloud.mart.service.ConnectorService; import com.muyu.common.core.domain.Result; import com.muyu.domain.Connector; @@ -10,7 +8,6 @@ import com.muyu.domain.req.ConnectorSortGroupBy; import com.muyu.domain.req.ConnectorUserReq; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -22,7 +19,7 @@ import java.util.List; * @Date:2024/8/26 10:22 */ @RestController -@RequestMapping("connector") +@RequestMapping("/connector") public class ConnectorController { @Autowired private ConnectorService connectorService; @@ -32,49 +29,56 @@ public class ConnectorController { * @param connector * @return */ - @PostMapping("findConnectorList") + @PostMapping("/findConnectorList") public Result findConnectorList(@RequestBody Connector connector){ return connectorService.findConnectorList(connector); } /** * API小卡片列表 */ - @PostMapping("findApiList") + @PostMapping("/findApiList") public Result findApiList(@RequestBody Connector connector){ return connectorService.findApiList(connector); } + + //TODO 根据id查询 + @GetMapping("/findApiById/{id}") + public Result findApiById(@PathVariable(value = "id") Long id){ + return Result.success(connectorService.findApiById(id)); + } + /** * 资产列表 */ - @PostMapping("findConnectorUserList") + @PostMapping("/findConnectorUserList") public Result> findConnectorUserList(@RequestBody ConnectorUserReq connectorUserReq){ return connectorService.findConnectorUserList(connectorUserReq); } /** * API页面类型分类 */ - @GetMapping("findConnectSort") + @GetMapping("/findConnectSort") public Result> findConnectSort (){ return connectorService.findConnectSort(); } /** * 接口添加 */ - @PostMapping("addConnector") + @PostMapping("/addConnector") public Result addConnector(@RequestBody Connector connector){ return connectorService.addConnector(connector); } /** * 接口修改 */ - @PostMapping("updateConnector") + @PostMapping("/updateConnector") public Result updateConnector(@RequestBody Connector connector){ return connectorService.updateConnector(connector); } /** * 接口删除 */ - @GetMapping("getDeleteConnector") + @GetMapping("/getDeleteConnector") public Result getDeleteConnector(@RequestParam(name = "connectorId") Long connectorId){ return connectorService.getDeleteConnector(connectorId); } diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MarketController.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MarketController.java index eba03ba..14a8317 100644 --- a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MarketController.java +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MarketController.java @@ -26,7 +26,7 @@ import java.util.Map; * @Date:2024/8/21 21:53 */ @RestController -@RequestMapping("list") +@RequestMapping("/list") public class MarketController extends BaseController { @Autowired @@ -40,7 +40,7 @@ public class MarketController extends BaseController { * 两千万条数据查询 * @return */ - @GetMapping("findMarketList") + @GetMapping("/findMarketList") public Result> findMarketList(){ List list = marketService.findMarketList(); return getDataTable(list); @@ -49,42 +49,42 @@ public class MarketController extends BaseController { /** * 手机号查询归属地 */ - @GetMapping("getPhonePlace") + @GetMapping("/getPhonePlace") public Result getPhonePlace(@RequestParam(name = "tel") String tel){ return marketService.getPhonePlace(tel); } /** * IP查询归属地 */ - @GetMapping("getIpPlace") + @GetMapping("/getIpPlace") public Result getIpPlace(@RequestParam(name = "ip") String ip){ return marketService.getIpPlace(ip); } /** * 新闻头条 */ - @GetMapping("getHeadlines") + @GetMapping("/getHeadlines") public Result getHeadlines(){ return marketService.getHeadlines(); } /** * 气象预警 */ - @GetMapping("getWeather") + @GetMapping("/getWeather") public Result getWeather(){ return marketService.getWeather(); } /** * 生辰助手 */ - @PostMapping("getBirthday") + @PostMapping("/getBirthday") public Result getBirthday(@RequestBody Birthday birthday){ return marketService.getBirthday(birthday); } /** * 邮编查询 */ - @PostMapping("getPostcode") + @PostMapping("/getPostcode") public Result getPostcode(@RequestBody Postcode postcode){ return marketService.getPostcode(postcode); } diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MartController.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MartController.java new file mode 100644 index 0000000..e68dcda --- /dev/null +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/controller/MartController.java @@ -0,0 +1,35 @@ +package com.muyu.cloud.mart.controller; + +//import com.muyu.system.service.SysUserService; +import com.alipay.api.AlipayApiException; +import com.muyu.cloud.mart.service.MartService; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.common.system.domain.PaymentParam; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; + +/** + * @Author: wangxinyuan + * @Date: 2024/8/21 下午9:32 + */ + +@Slf4j +@RestController +@RequestMapping("/mart") +public class MartController { + + + @Autowired + private MartService martService; + + + + + + +} diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/ConnectorMapper.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/ConnectorMapper.java index a797d0b..976c523 100644 --- a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/ConnectorMapper.java +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/ConnectorMapper.java @@ -32,4 +32,7 @@ public interface ConnectorMapper extends BaseMapper { List findConnectSort(); + + + Connector findApiById(Long id); } diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/MartMapper.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/MartMapper.java new file mode 100644 index 0000000..b3ff098 --- /dev/null +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/mapper/MartMapper.java @@ -0,0 +1,18 @@ +package com.muyu.cloud.mart.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.cloud.mart.domain.pojo.User; +import org.apache.ibatis.annotations.Mapper; + +import java.math.BigDecimal; + +/** + * @Author: wangxinyuan + * @Date: 2024/8/21 下午9:32 + */ +@Mapper +public interface MartMapper extends BaseMapper { + + + +} diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/ConnectorService.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/ConnectorService.java index 039c7ab..2087e98 100644 --- a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/ConnectorService.java +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/ConnectorService.java @@ -32,5 +32,7 @@ public interface ConnectorService extends IService { Result> findConnectSort(); + Connector findApiById(Long id); + // Result upload(MultipartFile file); } diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/MartService.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/MartService.java new file mode 100644 index 0000000..5e82034 --- /dev/null +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/MartService.java @@ -0,0 +1,16 @@ +package com.muyu.cloud.mart.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.cloud.mart.domain.pojo.User; + +import java.math.BigDecimal; + +/** + * @Author: wangxinyuan + * @Date: 2024/8/21 下午9:34 + */ +public interface MartService extends IService { + + + +} diff --git a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/impl/ConnectorServiceImpl.java b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/impl/ConnectorServiceImpl.java index fa19d31..9838153 100644 --- a/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/impl/ConnectorServiceImpl.java +++ b/cloud-mart-server/src/main/java/com/muyu/cloud/mart/service/impl/ConnectorServiceImpl.java @@ -101,6 +101,11 @@ public class ConnectorServiceImpl extends ServiceImpl +implements MartService { + + + @Autowired + private MartMapper martMapper; + +} diff --git a/cloud-mart-server/src/main/resources/bootstrap.yml b/cloud-mart-server/src/main/resources/bootstrap.yml index 2c45c66..bdfac88 100644 --- a/cloud-mart-server/src/main/resources/bootstrap.yml +++ b/cloud-mart-server/src/main/resources/bootstrap.yml @@ -2,13 +2,13 @@ server: port: 10005 -# nacos线上地址 +# nacos线上地址 49.235.174.95:8848 nacos: addr: 47.116.184.54:8848 user-name: nacos password: nacos namespace: cloud-2112 -# Spring +# Spring a72d4b95-5f82-4ada-87e0-0cc42053ea39 spring: application: diff --git a/cloud-mart-server/src/main/resources/mapper/ConnectorMappers.xml b/cloud-mart-server/src/main/resources/mapper/ConnectorMappers.xml index f6d83ff..16350c7 100644 --- a/cloud-mart-server/src/main/resources/mapper/ConnectorMappers.xml +++ b/cloud-mart-server/src/main/resources/mapper/ConnectorMappers.xml @@ -53,6 +53,9 @@ + diff --git a/cloud-mart-server/src/main/resources/mapper/MartUserMapper.xml b/cloud-mart-server/src/main/resources/mapper/MartUserMapper.xml new file mode 100644 index 0000000..6cefe44 --- /dev/null +++ b/cloud-mart-server/src/main/resources/mapper/MartUserMapper.xml @@ -0,0 +1,9 @@ + + + + + + +