set operationId
This commit is contained in:
		@@ -6,38 +6,14 @@ info(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type IndexResp struct {
 | 
					type IndexResp struct {
 | 
				
			||||||
    NewList    []NewList    `json:"NewList"`
 | 
					    NewList
 | 
				
			||||||
    RandomList []RandomList `json:"Randomlist"`
 | 
					 | 
				
			||||||
    BannerList []BannerList `json:"bannerlist"`
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
type NewList struct {
 | 
					
 | 
				
			||||||
    GoodsList
 | 
					
 | 
				
			||||||
}
 | 
					type NewList struct{
 | 
				
			||||||
type RandomList struct {
 | 
					    id int `json:"id"`
 | 
				
			||||||
    GoodsList
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
type BannerList struct {
 | 
					 | 
				
			||||||
    Image string `json:"image"`
 | 
					 | 
				
			||||||
    Title string `json:"title"`
 | 
					 | 
				
			||||||
    ID    int64    `json:"id"`
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
type GoodsList {
 | 
					 | 
				
			||||||
    GoodsID         int64      `json:"goods_id"`
 | 
					 | 
				
			||||||
    GoodsName       string   `json:"goods_name"`
 | 
					 | 
				
			||||||
    CategoryID      int64      `json:"category_id"`
 | 
					 | 
				
			||||||
    Images          string   `json:"images"`
 | 
					 | 
				
			||||||
    SpecType        string   `json:"spec_type"`
 | 
					 | 
				
			||||||
    DeductStockType string   `json:"deduct_stock_type"`
 | 
					 | 
				
			||||||
    Content         string   `json:"content"`
 | 
					 | 
				
			||||||
    SalesInitial    int      `json:"sales_initial"`
 | 
					 | 
				
			||||||
    SalesActual     int      `json:"sales_actual"`
 | 
					 | 
				
			||||||
    GoodsSort       int      `json:"goods_sort"`
 | 
					 | 
				
			||||||
    DeliveryID      int64      `json:"delivery_id"`
 | 
					 | 
				
			||||||
    GoodsStatus     string   `json:"goods_status"`
 | 
					 | 
				
			||||||
    IsDelete        string   `json:"is_delete"`
 | 
					 | 
				
			||||||
    ImageFrist      string   `json:"ImageFrist"`
 | 
					 | 
				
			||||||
    GoodsSales      int      `json:"goods_sales"`
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
service index-api {
 | 
					service index-api {
 | 
				
			||||||
    @doc(
 | 
					    @doc(
 | 
				
			||||||
        summary: "首页列表"
 | 
					        summary: "首页列表"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,7 +109,13 @@ func renderServiceRoutes(service spec.Service, groups []spec.Group, paths swagge
 | 
				
			|||||||
					},
 | 
										},
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			operationObject.OperationID = fmt.Sprintf("%s", route.Path)
 | 
					
 | 
				
			||||||
 | 
								// get OperationID
 | 
				
			||||||
 | 
								for _, annotation := range route.Annotations {
 | 
				
			||||||
 | 
									if annotation.Name == "handler" {
 | 
				
			||||||
 | 
										operationObject.OperationID = annotation.Value
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for _, param := range operationObject.Parameters {
 | 
								for _, param := range operationObject.Parameters {
 | 
				
			||||||
				if param.Schema != nil && param.Schema.Ref != "" {
 | 
									if param.Schema != nil && param.Schema.Ref != "" {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user