Migrate GORM to generics API, simplify user-domain relationship, refactor models

This commit is contained in:
Christoph Haas 2026-03-28 17:21:00 +01:00
parent 19ce2224b8
commit 560b40503a
9 changed files with 192 additions and 117 deletions

View file

@ -22,13 +22,6 @@ type CreateDomainRequest struct {
Name string `json:"name" binding:"required"`
}
type DomainPermissions struct {
DomainID uint `json:"domainId"`
DomainName string `json:"domainName"`
UserID uint `json:"userId"`
CanManage bool `json:"canManage"`
}
func (h *DomainHandler) List(c *gin.Context) {
authCtx := GetAuthContext(c)
if authCtx == nil {
@ -188,6 +181,13 @@ func (h *DomainHandler) Delete(c *gin.Context) {
NoContent(c)
}
type DomainPermissions struct {
DomainID uint `json:"domainId"`
DomainName string `json:"domainName"`
UserID uint `json:"userId"`
CanManage bool `json:"canManage"`
}
func (h *DomainHandler) GetPermissions(c *gin.Context) {
authCtx := GetAuthContext(c)
if authCtx == nil {