swagger聚合封装

This commit is contained in:
2025-11-28 08:52:22 +08:00
parent d8410fab37
commit 067c16b7ec
3 changed files with 121 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ func init() {
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: '{SwaggerUIDocUrl}',
url: '/swagger',
dom_id: '#swagger-ui',
});
};
@@ -97,7 +97,7 @@ func doRequest(ctx context.Context, method string, url string, target any, data
}()
result := response.ReadAll()
resultStrut := &ghttp.DefaultHandlerResponse{}
if gconv.Struct(result, resultStrut); resultStrut.Code != 200 {
if gconv.Struct(result, &resultStrut); resultStrut.Code != 200 {
err = errors.New(resultStrut.Message)
} else {
gconv.Struct(resultStrut.Data, target)