Skip to content

Commit

Permalink
fix group create type
Browse files Browse the repository at this point in the history
  • Loading branch information
lejianwen committed Oct 20, 2024
1 parent d085b4e commit 3679fcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http/request/admin/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import "Gwen/model"
type GroupForm struct {
Id uint `json:"id"`
Name string `json:"name" validate:"required"`
Type int `json:"type"`
}

func (gf *GroupForm) FromGroup(group *model.Group) *GroupForm {
gf.Id = group.Id
gf.Name = group.Name
gf.Type = group.Type
return gf
}

func (gf *GroupForm) ToGroup() *model.Group {
group := &model.Group{}
group.Id = gf.Id
group.Name = gf.Name
group.Type = gf.Type
return group
}

0 comments on commit 3679fcc

Please sign in to comment.