chart.api 1.3 KB

syntax = "v1"

info(
    title: "xx实例"
    desc: "xx实例"
    author: "author"
    email: "email"
    version: "v1"
)

@server(
    prefix: v1
    group: chart
    jwt: JwtAuth
)
service Core {
    @handler getChart
    post /chart/:id (ChartGetRequest) returns (ChartGetResponse)
    @handler saveChart
    post /chart (ChartSaveRequest) returns (ChartSaveResponse)
    @handler deleteChart
    delete /chart/:id (ChartDeleteRequest) returns (ChartDeleteResponse)
    @handler updateChart
    put /chart/:id (ChartUpdateRequest) returns (ChartUpdateResponse)
    @handler searchChart
    post /chart/search (ChartSearchRequest) returns (ChartSearchResponse)
}

type (
    ChartGetRequest {
		Id int64 `path:"id"`
	}
    ChartGetResponse struct{
		Chart ChartItem `json:"chart"`
    }

	ChartSaveRequest struct{
		Chart ChartItem `json:"chart"`
    }
    ChartSaveResponse struct{}

	ChartDeleteRequest struct{
        Id int64 `path:"id"`
    }
    ChartDeleteResponse struct{}

	ChartUpdateRequest struct{
		Id int64 `path:"id"`
        Chart ChartItem `json:"chart"`
    }
    ChartUpdateResponse struct{}

 	ChartSearchRequest struct{
         Page int  `json:"page"`
         Size int  `json:"size"`
    }
    ChartSearchResponse{
        List []ChartItem  `json:"list"`
        Total int64 `json:"total"`
    }
	ChartItem struct{
	
	}
)