Skip to content

Commit

Permalink
fix: change pet enum number to match proto
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Dec 24, 2023
1 parent 95ac059 commit 1adb79a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/app/service/pet/pet.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ func DtoToRaw(in *proto.Pet) (res *pet.Pet, err error) {
}

switch in.Gender {
case 1:
case 0:
gender = petConst.MALE
case 2:
case 1:
gender = petConst.FEMALE
}

switch in.Status {
case 1:
case 0:
status = petConst.ADOPTED
case 2:
case 1:
status = petConst.FINDHOME
}

Expand Down
8 changes: 4 additions & 4 deletions src/constant/pet/pet.constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package pet
type Gender int

const (
MALE = 1
FEMALE = 2
MALE = 0
FEMALE = 1
)

type Status int

const (
ADOPTED = 1
FINDHOME = 2
ADOPTED = 0
FINDHOME = 1
)

0 comments on commit 1adb79a

Please sign in to comment.