feat(docs): Enhance API documentation for AssignMenusToRole and RemoveMenusFromRole endpoints
Deploy Application / deploy (push) Successful in 21s
Details
Deploy Application / deploy (push) Successful in 21s
Details
This commit is contained in:
parent
e80b89d2ff
commit
6b608a86a9
|
|
@ -38,7 +38,17 @@ type (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// AssignMenusToRole implements RoleController.
|
// AssignMenusToRole godoc
|
||||||
|
// @Summary Assign menus to role
|
||||||
|
// @Description Assign menus to a role by role ID.
|
||||||
|
// @Tags Roles
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param id path string true "Role ID"
|
||||||
|
// @Param body body dto.AssignMenuRequest true "Assign menus payload"
|
||||||
|
// @Success 200 {object} map[string]interface{}
|
||||||
|
// @Failure 400 {object} map[string]interface{}
|
||||||
|
// @Router /roles/{id}/assign-menus [post]
|
||||||
func (r *roleController) AssignMenusToRole(ctx *gin.Context) {
|
func (r *roleController) AssignMenusToRole(ctx *gin.Context) {
|
||||||
id := ctx.Param("id")
|
id := ctx.Param("id")
|
||||||
var req dto.AssignMenuRequest
|
var req dto.AssignMenuRequest
|
||||||
|
|
@ -56,7 +66,17 @@ func (r *roleController) AssignMenusToRole(ctx *gin.Context) {
|
||||||
ctx.JSON(http.StatusOK, res)
|
ctx.JSON(http.StatusOK, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveMenusFromRole implements RoleController.
|
// RemoveMenusFromRole godoc
|
||||||
|
// @Summary Remove menus from role
|
||||||
|
// @Description Remove menus from a role by role ID.
|
||||||
|
// @Tags Roles
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param id path string true "Role ID"
|
||||||
|
// @Param body body dto.RemoveMenuRequest true "Remove menus payload"
|
||||||
|
// @Success 200 {object} map[string]interface{}
|
||||||
|
// @Failure 400 {object} map[string]interface{}
|
||||||
|
// @Router /roles/{id}/remove-menus [post]
|
||||||
func (r *roleController) RemoveMenusFromRole(ctx *gin.Context) {
|
func (r *roleController) RemoveMenusFromRole(ctx *gin.Context) {
|
||||||
id := ctx.Param("id")
|
id := ctx.Param("id")
|
||||||
var req dto.RemoveMenuRequest
|
var req dto.RemoveMenuRequest
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue