(req dto.GroupCreate)
| 58 | } |
| 59 | |
| 60 | func (u *GroupService) Create(req dto.GroupCreate) error { |
| 61 | group, _ := groupRepo.Get(repo.WithByName(req.Name), repo.WithByType(req.Type)) |
| 62 | if group.ID != 0 { |
| 63 | return buserr.New("ErrRecordExist") |
| 64 | } |
| 65 | if err := copier.Copy(&group, &req); err != nil { |
| 66 | return buserr.WithDetail("ErrStructTransform", err.Error(), nil) |
| 67 | } |
| 68 | if err := groupRepo.Create(&group); err != nil { |
| 69 | return err |
| 70 | } |
| 71 | return nil |
| 72 | } |
| 73 | |
| 74 | func (u *GroupService) Delete(id uint) error { |
| 75 | group, _ := groupRepo.Get(repo.WithByID(id)) |
nothing calls this directly
no test coverage detected