Skip to content

Commit

Permalink
fix: crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
liubf21 committed Jan 4, 2024
1 parent dd65548 commit c3ef493
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go-backend/internal/handler/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (h *ProfileHandler) HandleCreateProfile(c *gin.Context) {
}

// 创建Profile
if err := h.profileService.CreateProfile(profile.(model.Profile)); err != nil {
if err := h.profileService.CreateProfile(*profile.(*model.Profile)); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
Expand Down Expand Up @@ -73,7 +73,7 @@ func (h *ProfileHandler) HandleUpdateProfileByID(c *gin.Context) {
return
}

if err := h.profileService.UpdateProfileByID(uint(id), profile.(model.Profile)); err != nil {
if err := h.profileService.UpdateProfileByID(uint(id), *profile.(*model.Profile)); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
Expand Down
4 changes: 2 additions & 2 deletions go-backend/internal/handler/vaccination_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (h *VaccinationRecordHandler) HandleCreateVaccinationRecord(c *gin.Context)
return
}

if err := h.vaccinationRecordService.CreateVaccinationRecord(record.(model.VaccinationRecord)); err != nil {
if err := h.vaccinationRecordService.CreateVaccinationRecord(*record.(*model.VaccinationRecord)); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func (h *VaccinationRecordHandler) HandleUpdateVaccinationRecordByID(c *gin.Cont
return
}

if err := h.vaccinationRecordService.UpdateVaccinationRecordByID(uint(id), record.(model.VaccinationRecord)); err != nil {
if err := h.vaccinationRecordService.UpdateVaccinationRecordByID(uint(id), *record.(*model.VaccinationRecord)); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
Expand Down

0 comments on commit c3ef493

Please sign in to comment.