李雨欣 9.7测试接口
parent
4ab924148e
commit
248ffd188a
|
@ -0,0 +1,70 @@
|
|||
package com.muyu.market.admain;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "market_apis",autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Apis extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 接口文档ID
|
||||
*/
|
||||
@TableId(value = "api_id",type = IdType.AUTO)
|
||||
private Long apiId;
|
||||
/**
|
||||
* 接口地址
|
||||
*/
|
||||
@Schema(type = "String",description = "接口地址")
|
||||
private String apiAddr;
|
||||
/**
|
||||
* 请求方式
|
||||
*/
|
||||
@Schema(type = "String",description = "请求方式")
|
||||
private String requestWay;
|
||||
/**
|
||||
* 请求类型
|
||||
*/
|
||||
@Schema(type = "String",description = "请求类型")
|
||||
private String type;
|
||||
/**
|
||||
* 接口描述
|
||||
*/
|
||||
@Schema(type = "String",description = "接口描述")
|
||||
private String apiDesc;
|
||||
/**
|
||||
* 请求参数说明
|
||||
*/
|
||||
@Schema(type = "Long",description = "请求参数说明")
|
||||
private Long requestId;
|
||||
/**
|
||||
* JSON返回示例
|
||||
*/
|
||||
@Schema(type = "String",description = "JSON返回示例")
|
||||
private String jsonSuch;
|
||||
|
||||
|
||||
private Date updateTime;
|
||||
private String updateBy;
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
|
@ -76,9 +76,4 @@ public class OrdersListReq {
|
|||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.UUID;
|
|||
@Tag(name = "调用第三方支付控制层",description = "调用第三方支付控制层")
|
||||
public class AliPayController {
|
||||
|
||||
|
||||
@Resource
|
||||
AliPayConfig aliPayConfig;
|
||||
|
||||
|
@ -37,6 +38,7 @@ public class AliPayController {
|
|||
private static final String CHARSET ="utf-8";
|
||||
private static final String SIGN_TYPE ="RSA2";
|
||||
|
||||
|
||||
@GetMapping("/pay")
|
||||
@ResponseBody
|
||||
public Result pay(@Validated AliPay aliPay, HttpServletResponse httpResponse) throws Exception {
|
||||
|
@ -97,8 +99,6 @@ public class AliPayController {
|
|||
System.out.println("买家付款金额: " + params.get("buyer_pay_amount"));
|
||||
// 更新订单已支付的逻辑代码
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return "success";
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/apis")
|
||||
@Tag(name = "api接口文档展示控制层",description = "api接口文档展示控制层")
|
||||
@RequiredArgsConstructor
|
||||
public class ApisController {
|
||||
|
||||
@Autowired
|
||||
private ApisService apisService;
|
||||
|
||||
|
||||
@PostMapping("/selectByApisId")
|
||||
@Operation(summary = "api接口文档查询展示",description = "根据ID查询接口文档展示")
|
||||
public Result<Apis> selectByApisId(@Validated @RequestParam( value = "apiId") Long apiId){
|
||||
Apis byId = apisService.getById(apiId);
|
||||
return Result.success(byId,"操作成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -3,6 +3,8 @@ package com.muyu.market.server.controller;
|
|||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.market.admain.Myapi;
|
||||
import com.muyu.market.admain.request.OrdersListReq;
|
||||
import com.muyu.market.admain.response.OrdersListResp;
|
||||
import com.muyu.market.server.service.OrdersService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -13,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/orders")
|
||||
|
@ -22,6 +26,12 @@ public class OrdersController {
|
|||
@Autowired
|
||||
private OrdersService ordersService;
|
||||
|
||||
|
||||
/**
|
||||
* 订单的添加
|
||||
* @param myapi
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/Saveorders")
|
||||
@Operation(summary = "订单添加",description = "订单的添加")
|
||||
public Result<String> createOrders(@RequestBody Myapi myapi){
|
||||
|
@ -29,4 +39,24 @@ public class OrdersController {
|
|||
ordersService.saveOrders(myapi);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单信息
|
||||
* @param ordersListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/ordersSelect")
|
||||
@Operation(summary = "查询订单信息",description = "查询订单信息")
|
||||
public Result<List<OrdersListResp>> ordersSelect(@RequestBody OrdersListReq ordersListReq){
|
||||
List<OrdersListResp> selList = ordersService.ordersSelect(ordersListReq);
|
||||
return Result.success(selList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
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<Apis> {
|
||||
}
|
|
@ -3,10 +3,15 @@ package com.muyu.market.server.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.market.admain.Orders;
|
||||
import com.muyu.market.admain.request.OrdersListReq;
|
||||
import com.muyu.market.admain.response.OrdersListResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface OrdersMapper extends BaseMapper<Orders> {
|
||||
|
||||
|
||||
List<OrdersListResp> ordersSelect(OrdersListReq ordersListReq);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package com.muyu.market.server.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.market.admain.Apis;
|
||||
|
||||
public interface ApisService extends IService<Apis> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
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<ApisMapper, Apis> implements ApisService {
|
||||
}
|
|
@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.market.admain.Myapi;
|
||||
import com.muyu.market.admain.Orders;
|
||||
import com.muyu.market.admain.request.OrdersListReq;
|
||||
import com.muyu.market.admain.response.OrdersListResp;
|
||||
import com.muyu.market.server.mapper.OrdersMapper;
|
||||
import com.muyu.market.server.service.OrdersService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements OrdersService {
|
||||
|
@ -42,4 +45,9 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> impleme
|
|||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrdersListResp> ordersSelect(OrdersListReq ordersListReq) {
|
||||
return ordersMapper.ordersSelect(ordersListReq);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,13 @@ package com.muyu.market.server.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.market.admain.Myapi;
|
||||
import com.muyu.market.admain.Orders;
|
||||
import com.muyu.market.admain.request.OrdersListReq;
|
||||
import com.muyu.market.admain.response.OrdersListResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OrdersService extends IService<Orders> {
|
||||
void saveOrders(Myapi myapi);
|
||||
|
||||
List<OrdersListResp> ordersSelect(OrdersListReq ordersListReq);
|
||||
}
|
||||
|
|
|
@ -61,3 +61,4 @@ alipay:
|
|||
alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAodOIG6vaqMsl5DXjcRYPRro+C/SeTswVo5gqQdikK3qy118GWkVwL9gvEovq23EMCTmSV+KAFsHz8f0UxLEK9FZcfRuM5E7GfnP7sdY0ctjfmUhQ7fWVOTGLuH0h5DiQ+4voO/2Hi6SElvtLXAUBSqMKw6J0PsJ0uUY9CBZCQnZkFJWAAroUWw5ARUMy62KPZSAW2s8Qg4gacdhSk7SBACNGBFcJZHCS09xQJi5SxCHaTRLhhIckLBvuKEWhBsh+jU75BKYAC4ovoWhMAFnIWKwCmubhXqmYjuJ4egUQTQBbD1hasK99I1YzdXRH8OKwKD4Lufb42B9buZ/2hOywIDAQAB
|
||||
notifyUrl: http://12.2.1.1:8080/market2/alipay/notify
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.muyu.market.server.mapper.OrdersMapper">
|
||||
|
||||
|
||||
<resultMap id="OrderDetailDTOMap" type="com.muyu.market.admain.response.OrdersListResp">
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="apiId" column="api_id" />
|
||||
<result property="orderNo" column="order_no"/>
|
||||
<result property="orderStatus" column="order_status"/>
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="note" column="note"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="ordersSelect" resultType="com.muyu.market.admain.response.OrdersListResp">
|
||||
|
||||
SELECT
|
||||
orders.*,
|
||||
sys_user.user_name,
|
||||
myapi.name,
|
||||
myapi.price,
|
||||
myapi.test,
|
||||
FROM
|
||||
orders
|
||||
LEFT JOIN sys_user ON orders.order_id = sys_user.user_id
|
||||
LEFT JOIN myapi ON orders.order_id = myapi.api_id
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue