Professional Documents
Culture Documents
Project Question
Project Question
3. How did you used:- I added the dependency (Spring Validation), I used @Email
Annotation, then I used the bindingResult.
then it work properly
and I got the error message and gave back to the --->Postman.
-----------------------------------------------------------
X----------------------------------------------------------------------------------
-------------
2. What Challenges did you face?
Ans:- I initialised content using @NotNull annotation to not take (save) the null
data, but there was bug in that. It was accepting the null values in content.
for that II used @NotEmpty annotation . using this annotation the bug got solved.
and now its working proper.
-----------------------------------------------------------
X----------------------------------------------------------------------------------
-------------
3. pickup project and explain last modules in that ?
and pass it into DTO object later the DTO object data passed that into services
layer where DTO object will convert it into Entity class using model Mapper
class(library) . after converting data into Entity it will moved to repository
layer and using repository and @PostMapping Annotation it will save the object
into Database.
yes thats the process of posting a data into database.
which is save database. then using Stream API the entity object data (post) will
convert it into DTO for that used stream().map function is used. it will convert it
into Dto and this Dto
object will shown in Postman.
for getting blog by id:
firstly I created one handler method in that i used @Requestbody annotation which
will take the data from postman and in postman we also passed url in which we will
declare id based on id wee
will update so for that I used @PathVariabe annotation after that it will move to
services layer where we set the data (update)
in entity class. and after setting data. i will call post repository and it will
save the data and will response back (200) ohk.
I created one handler method in that i passed @Pathvariable. then it will move to
services layer. then in services layer post repository will check the id by using
findById method.
if id get . so post repository .delete method will call after deleting record. it
will response back 200. ohk.
thats all crud operation. and first module.
___________________________________________________________________________________
___________________________________________________________________________________
________________________________
for all blog in get mapping i will use @RequestParam annotation will pass pageNO,
page size , sortBy, sortDir value and sortBy
then for getting content for pageNo i will call entity.getContent method it will
get the content using stram. map method (which give me list of objects(posts)).
___________________________________________________________________________________
___________________________________________________________________________________
______________________________________
3)