This commit is contained in:
Dftre 2024-05-30 03:58:07 +08:00
parent b1b1a306d5
commit 8f04b9e5b8
3 changed files with 54 additions and 35 deletions

View File

@ -9,7 +9,7 @@
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<description>若依Geek管理系统</description>
<properties>
<ruoyi.version>3.8.7.3.4</ruoyi.version>

View File

@ -4,10 +4,18 @@ import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.media.IntegerSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
/**
* 验证码操作处理
@ -19,7 +27,20 @@ public class SwaggerConfig {
@Bean
public OpenAPI springShopOpenAPI() {
Schema<?> codeSchema = new IntegerSchema().example(HttpStatus.SUCCESS); // 示例状态码
Schema<?> msgSchema = new StringSchema().example("操作成功"); // 示例消息
ObjectSchema dataSchema = new ObjectSchema(); // 数据可以是任意类型这里简单定义为ObjectSchema
// 定义AjaxResult的Schema
ObjectSchema ajaxResultSchema = new ObjectSchema();
ajaxResultSchema.addProperty(AjaxResult.CODE_TAG, codeSchema);
ajaxResultSchema.addProperty(AjaxResult.MSG_TAG, msgSchema);
ajaxResultSchema.addProperty(AjaxResult.DATA_TAG, dataSchema);
Components components = new Components();
components.addSchemas("AjaxResult", ajaxResultSchema);
return new OpenAPI()
.components(components)
.info(new Info().title("RuoYi Geek")
.description("RuoYi Geek API文档")
.version("v1")

View File

@ -47,14 +47,12 @@ public class SQBController extends BaseController {
@Parameter(name = "orderNumber", description = "订单号", required = true)
})
@PostMapping("/query")
@Anonymous
public AjaxResult query(@RequestParam("orderNumber") String orderNumber) throws Exception {
PayOrder payOrder = payOrderServicer.selectPayOrderByOrderNumber(orderNumber);
return success(sqbServiceImpl.query(payOrder));
}
@PostMapping("/refund")
@Anonymous
public AjaxResult refund(@RequestBody PayOrder payOrder) {
String refund = sqbServiceImpl.refund(payOrder);
if (refund == null) {