mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): add admin master key listing/revoke
Add admin endpoints to list and revoke child keys under a master. Standardize OpenAPI responses to use ResponseEnvelope with MapData for error payloads, and regenerate swagger specs accordingly.
This commit is contained in:
@@ -20,8 +20,8 @@ import (
|
||||
// @Security AdminAuth
|
||||
// @Param group body dto.ProviderGroupDTO true "Provider group payload"
|
||||
// @Success 201 {object} ResponseEnvelope{data=model.ProviderGroup}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /admin/provider-groups [post]
|
||||
func (h *Handler) CreateProviderGroup(c *gin.Context) {
|
||||
var req dto.ProviderGroupDTO
|
||||
@@ -79,7 +79,7 @@ func (h *Handler) CreateProviderGroup(c *gin.Context) {
|
||||
// @Param limit query int false "limit (default 50, max 200)"
|
||||
// @Param search query string false "search by name/type"
|
||||
// @Success 200 {object} ResponseEnvelope{data=[]model.ProviderGroup}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /admin/provider-groups [get]
|
||||
func (h *Handler) ListProviderGroups(c *gin.Context) {
|
||||
var groups []model.ProviderGroup
|
||||
@@ -102,9 +102,9 @@ func (h *Handler) ListProviderGroups(c *gin.Context) {
|
||||
// @Security AdminAuth
|
||||
// @Param id path int true "ProviderGroup ID"
|
||||
// @Success 200 {object} ResponseEnvelope{data=model.ProviderGroup}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 404 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 404 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /admin/provider-groups/{id} [get]
|
||||
func (h *Handler) GetProviderGroup(c *gin.Context) {
|
||||
id, ok := parseUintParam(c, "id")
|
||||
@@ -129,9 +129,9 @@ func (h *Handler) GetProviderGroup(c *gin.Context) {
|
||||
// @Param id path int true "ProviderGroup ID"
|
||||
// @Param group body dto.ProviderGroupDTO true "Provider group payload"
|
||||
// @Success 200 {object} ResponseEnvelope{data=model.ProviderGroup}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 404 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 404 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /admin/provider-groups/{id} [put]
|
||||
func (h *Handler) UpdateProviderGroup(c *gin.Context) {
|
||||
idParam := c.Param("id")
|
||||
@@ -221,10 +221,10 @@ func (h *Handler) UpdateProviderGroup(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Security AdminAuth
|
||||
// @Param id path int true "ProviderGroup ID"
|
||||
// @Success 200 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 404 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Success 200 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 400 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 404 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /admin/provider-groups/{id} [delete]
|
||||
func (h *Handler) DeleteProviderGroup(c *gin.Context) {
|
||||
id, ok := parseUintParam(c, "id")
|
||||
|
||||
Reference in New Issue
Block a user