diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/Apis.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/Msg.java similarity index 65% rename from cloud-market2-common/src/main/java/com/muyu/market/admain/Apis.java rename to cloud-market2-common/src/main/java/com/muyu/market/admain/Msg.java index 28790c0..250f77a 100644 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/Apis.java +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/Msg.java @@ -18,46 +18,51 @@ import java.util.Date; @SuperBuilder @AllArgsConstructor @NoArgsConstructor -@TableName(value = "market_apis",autoResultMap = true) +@TableName(value = "market_msg",autoResultMap = true) @EqualsAndHashCode(callSuper = true) -public class Apis extends BaseEntity { +public class Msg extends BaseEntity { /** * 接口文档ID */ - @TableId(value = "api_id",type = IdType.AUTO) - private Long apiId; + @TableId(value = "msg_id",type = IdType.AUTO) + private Long msgId; /** - * 接口地址 + * 是否必填 */ - @Schema(type = "String",description = "接口地址") - private String apiAddr; + @Schema(type = "String",description = "姓名") + private String name; /** - * 请求方式 + * 是否必填 */ - @Schema(type = "String",description = "请求方式") - private String requestWay; + @Schema(type = "String",description = "必填") + private String required; /** * 请求类型 */ @Schema(type = "String",description = "请求类型") private String type; + /** + * 请求方式 get/post + */ + @Schema(type = "String",description = "请求方式") + private String most; + /** * 接口描述 */ - @Schema(type = "String",description = "接口描述") - private String apiDesc; + @Schema(type = "String",description = "请求参数说明") + private String desc; /** * 请求参数说明 */ - @Schema(type = "Long",description = "请求参数说明") - private Long requestId; + @Schema(type = "Long",description = "所对应") + private Long apiId; /** * JSON返回示例 */ - @Schema(type = "String",description = "JSON返回示例") - private String jsonSuch; + private Date updateTime; diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java index 43036df..d0df9ad 100644 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/Myapi.java @@ -74,6 +74,11 @@ public class Myapi extends BaseEntity{ */ @Schema(description = "API类型",type = "String") private String type; + /* + API类型 + */ + @Schema(description = "API返回报文",type = "String") + private String msgresp; private String createBy; private Date createTime; @@ -93,6 +98,7 @@ public class Myapi extends BaseEntity{ .mode( myapiSaveReq.getMode()) .auth( myapiSaveReq.getAuth() ) .type( myapiSaveReq.getType()) + .msgresp(myapiSaveReq.getMsgresp()) .build(); } @@ -111,6 +117,7 @@ public class Myapi extends BaseEntity{ .mode( myapiUpdReq.getMode()) .auth( myapiUpdReq.getAuth() ) .type( myapiUpdReq.getType()) + .msgresp(myapiUpdReq.getMsgresp()) .build(); } diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java index 3bb0cef..0dd97f0 100644 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiListReq.java @@ -70,6 +70,10 @@ public class MyapiListReq { @Schema(description = "API类型",type = "String") private String type; - + /* + API类型 + */ + @Schema(description = "API返回报文",type = "String") + private String msgresp; } diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java index b301e78..bedfb88 100644 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiSaveReq.java @@ -70,7 +70,11 @@ public class MyapiSaveReq { @Schema(description = "API类型",type = "String") private String type; - + /* + API类型 + */ + @Schema(description = "API返回报文",type = "String") + private String msgresp; diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java index 31b6a71..b52e003 100644 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/request/MyapiUpdReq.java @@ -69,7 +69,11 @@ public class MyapiUpdReq { */ @Schema(description = "API类型",type = "String") private String type; - + /* + API类型 + */ + @Schema(description = "API返回报文",type = "String") + private String msgresp; diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java index 03f6c25..d662e8b 100644 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java +++ b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiListResp.java @@ -70,7 +70,11 @@ public class MyapiListResp { */ @Schema(description = "API类型",type = "String") private String type; - + /* + API类型 + */ + @Schema(description = "API返回报文",type = "String") + private String msgresp; private String createBy; private Date createTime; @@ -94,6 +98,7 @@ public class MyapiListResp { .mode( myapi.getMode()) .auth( myapi.getAuth()) .type( myapi.getType()) + .msgresp( myapi.getMsgresp() ) .build(); } diff --git a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java b/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java deleted file mode 100644 index 60f6fe6..0000000 --- a/cloud-market2-common/src/main/java/com/muyu/market/admain/response/MyapiSaveResp.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.muyu.market.admain.response; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.SuperBuilder; - -import java.math.BigDecimal; -import java.util.Date; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@SuperBuilder -@Tag(name = "商品添加", description = "商品添加") -public class MyapiSaveResp { - /** - * 商品ID - */ - @TableId(value = "api_id",type = IdType.AUTO) - private Long apiId; - /** - * 接口名称 - */ - @Schema(type = "String",description = "接口名称") - private String name; - /** - * 价钱 - */ - @Schema(description = "价钱/次",type = "BigDecimal") - private BigDecimal price; - /** - * 介绍 - */ - @Schema(type = "String",description = "介绍") - private String test; - /** - * 商品描述 - */ - @Schema(description = "商品描述",type = "String") - private String data; - /** - * 接口名称 - */ - @Schema(description = "接口名称",type = "String") - private String apiName; - /** - * 接口地址 - */ - @Schema(description = "接口地址",type = "String") - private String ip; - /** - * 请求方式 - */ - @Schema(description = "请求方式",type = "String") - private String mode; - /** - * 购买字段 - */ - @Schema(description = "购买字段(当修改成功触发)",type = "Integer") - private int auth; - /* - API类型 - */ - @Schema(description = "API类型",type = "String") - private String type; - - - private String createBy; - private Date createTime; - private String updateBy; - private Date updateTime; - private String remark; - - - - -} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/ApisController.java b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/MsgController.java similarity index 56% rename from cloud-market2-server/src/main/java/com/muyu/market/server/controller/ApisController.java rename to cloud-market2-server/src/main/java/com/muyu/market/server/controller/MsgController.java index 6380d65..ee0692b 100644 --- a/cloud-market2-server/src/main/java/com/muyu/market/server/controller/ApisController.java +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/controller/MsgController.java @@ -1,9 +1,8 @@ package com.muyu.market.server.controller; import com.muyu.common.core.domain.Result; -import com.muyu.market.admain.Apis; -import com.muyu.market.admain.Myapi; -import com.muyu.market.server.service.ApisService; +import com.muyu.market.admain.Msg; +import com.muyu.market.server.service.MsgService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -15,23 +14,25 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @Slf4j @RestController -@RequestMapping("/apis") -@Tag(name = "api接口文档展示控制层",description = "api接口文档展示控制层") +@RequestMapping("/msg") +@Tag(name = "msg接口文档展示控制层",description = "msg接口文档展示控制层") @RequiredArgsConstructor -public class ApisController { +public class MsgController { @Autowired - private ApisService apisService; + private MsgService msgService; - @PostMapping("/selectByApisId") - @Operation(summary = "api接口文档查询展示",description = "根据ID查询接口文档展示") - public Result selectByApisId(@Validated @RequestParam( value = "apiId") Long apiId){ - Apis byId = apisService.getById(apiId); - return Result.success(byId,"操作成功"); + @PostMapping("/findMsgByApiId") + @Operation(summary = "msg接口文档查询展示",description = "根据ID查询接口文档展示") + public Result> selectByApisId(@Validated @RequestParam( value = "apiId") Integer apiId){ + List msgByApiId = msgService.findMsgByApiId( apiId ); + return Result.success(msgByApiId,"操作成功"); } diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/ApisMapper.java b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/ApisMapper.java deleted file mode 100644 index 6b7aaa4..0000000 --- a/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/ApisMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.muyu.market.server.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.muyu.market.admain.Apis; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface ApisMapper extends BaseMapper { -} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MsgMapper.java b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MsgMapper.java new file mode 100644 index 0000000..0361669 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/mapper/MsgMapper.java @@ -0,0 +1,15 @@ +package com.muyu.market.server.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.muyu.market.admain.Msg; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface MsgMapper extends BaseMapper { + @Select( "SELECT * from market_msg WHERE api_id = #{apiId}" ) + List findMsgByApiId(@Param( "apiId" )Integer apiId); +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/ApisService.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/ApisService.java deleted file mode 100644 index cff6ed6..0000000 --- a/cloud-market2-server/src/main/java/com/muyu/market/server/service/ApisService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.muyu.market.server.service; - - -import com.baomidou.mybatisplus.extension.service.IService; -import com.muyu.market.admain.Apis; - -public interface ApisService extends IService { -} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/ApisServiceImpl.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/ApisServiceImpl.java deleted file mode 100644 index a31d3c6..0000000 --- a/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/ApisServiceImpl.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.muyu.market.server.service.Impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.muyu.market.admain.Apis; -import com.muyu.market.server.mapper.ApisMapper; -import com.muyu.market.server.service.ApisService; -import org.springframework.stereotype.Service; - -@Service -public class ApisServiceImpl extends ServiceImpl implements ApisService { -} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MsgServiceImpl.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MsgServiceImpl.java new file mode 100644 index 0000000..05c017c --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/Impl/MsgServiceImpl.java @@ -0,0 +1,20 @@ +package com.muyu.market.server.service.Impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.muyu.market.admain.Msg; +import com.muyu.market.server.mapper.MsgMapper; +import com.muyu.market.server.service.MsgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class MsgServiceImpl extends ServiceImpl implements MsgService { + @Autowired + private MsgMapper msgMapper; + @Override + public List findMsgByApiId(Integer apiId) { + return msgMapper.findMsgByApiId( apiId ); + } +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/service/MsgService.java b/cloud-market2-server/src/main/java/com/muyu/market/server/service/MsgService.java new file mode 100644 index 0000000..8926542 --- /dev/null +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/service/MsgService.java @@ -0,0 +1,12 @@ +package com.muyu.market.server.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.market.admain.Msg; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface MsgService extends IService { + List findMsgByApiId(Integer apiId); +} diff --git a/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java b/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java index 1fc300d..5a468af 100644 --- a/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java +++ b/cloud-market2-server/src/main/java/com/muyu/market/server/util/SelectPhoneUtil.java @@ -48,8 +48,8 @@ public class SelectPhoneUtil { System.out.printf("运营商:%s%n", result.getString("company")); // 设置编码(仅在需要时启用) try { - System.setOut(new java.io.PrintStream(System.out,true,"UTF-8")); - } catch (java.io.UnsupportedEncodingException e) { + System.setOut(new PrintStream(System.out,true,"UTF-8")); + } catch (UnsupportedEncodingException e) { System.err.println("无法设置UTF-8编码:" + e.getMessage()); } selectByPhone.setCompany(result.getString("company"));