Migrate GORM to generics API, simplify user-domain relationship, refactor models
This commit is contained in:
parent
19ce2224b8
commit
560b40503a
9 changed files with 192 additions and 117 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue