api文档支持开放访问

This commit is contained in:
暮光:城中城
2021-12-05 22:58:48 +08:00
parent 928c79b747
commit 189e96ff42
70 changed files with 5578 additions and 2983 deletions

View File

@@ -60,6 +60,16 @@ public class ApiDoc implements Serializable {
*/
private Integer docStatus;
/**
* 开放文档UUID
*/
private String shareUuid;
/**
* 开放文档使用说明
*/
private String shareInstruction;
/**
* 创建人ID
*/
@@ -182,4 +192,20 @@ public class ApiDoc implements Serializable {
", yn=" + yn +
"}";
}
public String getShareUuid() {
return shareUuid;
}
public void setShareUuid(String shareUuid) {
this.shareUuid = shareUuid;
}
public String getShareInstruction() {
return shareInstruction;
}
public void setShareInstruction(String shareInstruction) {
this.shareInstruction = shareInstruction;
}
}

View File

@@ -14,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ApiDocService extends IService<ApiDoc> {
IPage<ApiDoc> getApiDocList(ApiDoc apiDoc, Integer pageNum, Integer pageSize);
ApiDoc getByShareUuid(String shareUuid);
}

View File

@@ -28,8 +28,18 @@ public class ApiDocServiceImpl extends ServiceImpl<ApiDocMapper, ApiDoc> impleme
queryWrapper.eq(apiDoc.getOpenVisit() != null, "open_visit", apiDoc.getOpenVisit());
queryWrapper.eq(apiDoc.getDocStatus() != null, "doc_status", apiDoc.getDocStatus());
queryWrapper.orderByAsc("id");
queryWrapper.select("id", "name", "doc_type", "doc_url", "rewrite_domain", "open_visit", "doc_status", "create_user_id", "create_user_name", "create_time");
queryWrapper.select("id", "name", "doc_type", "doc_url", "share_uuid", "rewrite_domain", "open_visit", "doc_status", "create_user_id", "create_user_name", "create_time");
IPage<ApiDoc> page = new Page<>(pageNum, pageSize);
return this.page(page, queryWrapper);
}
@Override
public ApiDoc getByShareUuid(String shareUuid) {
QueryWrapper<ApiDoc> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("yn", 1);
queryWrapper.eq("open_visit", 1);
queryWrapper.eq("share_uuid", shareUuid);
queryWrapper.select("name", "doc_type", "doc_url", "share_uuid", "json_content", "share_instruction");
return this.getOne(queryWrapper);
}
}