-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consultar ONG #111 #117
Consultar ONG #111 #117
Conversation
@AtilaRocha, entendo que sua issue ainda está em desenvolvimento, poderia atualizar a PR para "Draft"? Quando finalizar o desenvolvimento você passa ele para "Open" novamente. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no api/main.go ficou faltando instanciar o OngController para poder ser usado no api/routes.go
infra/db/ong_repository.go
Outdated
|
||
// FindById implements interfaces.UserRepository. | ||
func (o *OngRepository) FindById(id uuid.UUID) *entity.User { | ||
panic("unimplemented") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ficou faltando a implementação da consulta da ONG
api/main.go
Outdated
OngUseCase := usecase.NewOngUseCase(bdOngRepo) | ||
|
||
breedController := controllers.NewBreedController(breedUsecase) | ||
petController := controllers.NewPetController(petUsecase) | ||
userController := controllers.NewUserController(uusercase) | ||
OngController := controllers.NewOngController(OngUseCase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boa, só manteria o padrão de camelCase
infra/db/ong_repository.go
Outdated
dbconnection *sqlx.DB | ||
} | ||
|
||
// FindByID implements interfaces.OngRepository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// FindByID implements interfaces.OngRepository. |
remover esse comentário
infra/db/ong_repository.go
Outdated
if err := row.Scan( | ||
&ong.ID, | ||
&ong.Name, | ||
); err != nil { | ||
return nil, fmt.Errorf("error scanning ONG: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
porque só fazemos o scan do id e do name? a consulta de ong não deveria retornar uma ong "completa"?
infra/db/ong_repository.go
Outdated
p.address, | ||
p.phone | ||
FROM | ||
ongs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essa tabela não existe
infra/db/ong_repository.go
Outdated
if err := row.Scan( | ||
&ong.ID, | ||
&ong.Name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usando o sqlx tem uma forma melhor de atribuir valores que retornam do banco
var data;
err = db.Select(&data, "SELECT * FROM table where id = ?", 1)
Dessa forma, o que retorna do SELECT ele vai associar a entity, desde que os nomes da propriedade e das colunas da tabela sejam os mesmos
…cao) devhatt#58 (devhatt#109) * wip: cuidados especiais incluidos no pet * wip: correção * wip: migrations * feat: update special care * feat: atualização de teste de req. * fix: requested changes * fix: requested changes on migration * fix: update pet, use case, entity and repository * fix: logger in update pet
* refactor: Extracted Address Interface to new file * refactor: Extracted Address Struct to new file * feat: Add ong_repository interface * feat: Add ong controller * feat: Add ong routes * chore: changed sql to sqlx * feat: Add ong entity * feat: Add ong repository * feat: Add ong usecase * chore: Adjust ong entity * chore: adjust ong repositories * chore: adjust ong routes * chore: Adjust ong usecase * typo: Corrected Ong name * chore: Adjust ong entity * chore: adjust ong repositories * chore: Adjust ong usecase * feat: Add ONG Dto * fix: Type longitude corrected * chore: Adjust ong entity * fix: Typo longitude corrected * chore: Remove unecessary fmt.Println * fix: Implemented logger to ong controller * fix: Implemented logger to ong usecase * fix: Implemented logger to ong repository * fix: Implemented logger to ong repository * chore: Adjust loggers * refact: Implemented Address DTO * refactor: Reusing userRepo inside ong usecase * refactor: Reusing userRepo inside ong usecase * refactor: Reorganizing entity and dtos methods to its respectives owners * fix[refactor]: Corrected import cycle error by changing Pet.ToEntity location from dto to entity * test: Corrected Pet tests
* feat(user): init user update endpoint * feat(user): update user name * feat(user): add tests * fix(user): improve error response message trying update user * feat(user): include more field on update user * fix(user): adjust after rebase with main branch
@AtilaRocha sua branch foi criado de maneira certa pae ? |
Closes #111
Feature
Criado uma rota que recebe um ID de ONG e retorna as informações dessa ONG. Alguns componentes foram criados para pesquisar e interagir com o banco de dados para buscar e retornar essas informações quando necessário.Changelog
N/AVisual evidences 🖼️
Checklist
Additional info
N/A