This commit is contained in:
六如
2024-12-21 20:16:00 +08:00
parent f7f04c28eb
commit bb2a9eb314
116 changed files with 2124 additions and 2194 deletions

View File

@@ -5,6 +5,8 @@ import com.gitee.sop.storyweb.open.resp.StoryResponse;
import com.gitee.sop.support.annotation.Open;
import com.gitee.sop.support.context.OpenContext;
import com.gitee.sop.support.dto.FileData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@@ -15,6 +17,7 @@ import java.util.List;
*
* @author 六如
*/
@Api("故事服务")
public interface OpenStory {
@Open("story.save")
@@ -27,6 +30,7 @@ public interface OpenStory {
@Open("story.updateError")
Integer updateError(Integer id);
@ApiOperation(value = "根据id获取故事")
@Open("story.get")
StoryResponse getById(@NotNull(message = "id必填") Integer id);
@@ -46,6 +50,14 @@ public interface OpenStory {
return storyResponse;
}
// 默认方法,注解放在这里也有效
@Open("alipay.story.find")
default StoryResponse findByName(String name) {
StoryResponse storyResponse = new StoryResponse();
storyResponse.setName(name);
return storyResponse;
}
// 演示单文件上传
@Open("story.upload")
StoryResponse upload(StorySaveRequest storySaveRequest, FileData file);

View File

@@ -0,0 +1,27 @@
{
// 开启推送
"enable": true,
// 扫描package多个用;隔开
"basePackage": "com.gitee.sop.storyweb.open",
// 推送URLIP端口对应Torna服务器
"url": "http://localhost:7700/api",
// 模块token
"token": "d4f07434c9cf4a989e4c6d301684b357",
// 推送人
"author": "Jim",
// 打开调试:true/false
"debug": true,
// 是否替换文档true替换false不替换追加。默认true
"isReplace": true,
// 第三方jar中的class配置
"jarClass": {
"com.xx.Page": {
"records": { "value": "查询数据列表", "example": "" },
"total": { "value": "总数", "example": "100" },
"size": { "value": "页数", "example": "10" },
"current": { "value": "当前页", "example": "1" },
"countId": { "hidden": true },
"orders": { "hidden": true }
}
}
}

View File

@@ -0,0 +1,14 @@
package com.gitee.sop.storyweb;
import cn.torna.swaggerplugin.SwaggerPlugin;
/**
* 推送swagger文档
* @author thc
*/
public class DocPushTest {
public static void main(String[] args) {
SwaggerPlugin.pushDoc();
}
}