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:
@@ -45,9 +45,9 @@ func toMasterRealtimeView(stats service.MasterRealtimeSnapshot) *MasterRealtimeV
|
||||
// @Security AdminAuth
|
||||
// @Param id path int true "Master ID"
|
||||
// @Success 200 {object} ResponseEnvelope{data=MasterRealtimeView}
|
||||
// @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/masters/{id}/realtime [get]
|
||||
func (h *AdminHandler) GetMasterRealtime(c *gin.Context) {
|
||||
idRaw := strings.TrimSpace(c.Param("id"))
|
||||
@@ -88,8 +88,8 @@ func (h *AdminHandler) GetMasterRealtime(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Security MasterAuth
|
||||
// @Success 200 {object} ResponseEnvelope{data=MasterRealtimeView}
|
||||
// @Failure 401 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 401 {object} ResponseEnvelope{data=MapData}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /v1/realtime [get]
|
||||
func (h *MasterHandler) GetSelfRealtime(c *gin.Context) {
|
||||
master, exists := c.Get("master")
|
||||
@@ -136,7 +136,7 @@ type MasterRealtimeSummaryView struct {
|
||||
// @Produce json
|
||||
// @Security AdminAuth
|
||||
// @Success 200 {object} ResponseEnvelope{data=SystemRealtimeView}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=gin.H}
|
||||
// @Failure 500 {object} ResponseEnvelope{data=MapData}
|
||||
// @Router /admin/realtime [get]
|
||||
func (h *AdminHandler) GetAdminRealtime(c *gin.Context) {
|
||||
if h.statsService == nil {
|
||||
|
||||
Reference in New Issue
Block a user