package cprelation

import (
	"hyapp-admin-server/internal/middleware"

	"github.com/gin-gonic/gin"
)

func RegisterRoutes(protected *gin.RouterGroup, h *Handler) {
	if h == nil {
		return
	}
	protected.GET("/admin/activity/cp/config", middleware.RequirePermission("cp-config:view"), h.GetConfig)
	protected.GET("/admin/activity/cp/relationships", middleware.RequirePermission("cp-config:view"), h.ListRelationships)
	protected.GET("/admin/activity/cp/applications", middleware.RequirePermission("cp-config:view"), h.ListApplications)
	protected.PUT("/admin/activity/cp/config", middleware.RequirePermission("cp-config:update"), h.UpdateConfig)
}
