diff --git "a/react-frontend/src/components/ProfileCard.js\n```javascript\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport './ProfileCard.css'; / Assuming there is a CSS file for styling\n\nconst ProfileCard = ({ user }) =_ {\n return (\n _div className=_profile-card__\n _img src={user.profileImage} alt={`${user.name}'s profile`} className=_profile-image_ /_\n _h2 className=_profile-name__{user.name}_/h2_\n _p className=_profile-email__{user.email}_/p_\n _p className=_profile-bio__{user.bio}_/p_ {/_ New bio information added _/}\n _a href={`mailto_${user.email}`} className=_contact-link__Contact_/a_\n _/div_\n );\n};\n\nProfileCard.propTypes = {\n user_ PropTypes.shape({\n name_ PropTypes.string.isRequired,\n profileImage_ PropTypes.string.isRequired,\n email_ PropTypes.string.isRequired,\n bio_ PropTypes.string, / New bio prop\n }).isRequired,\n};\n\nexport default ProfileCard;" "b/react-frontend/src/components/ProfileCard.js\n```javascript\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport './ProfileCard.css'; / Assuming there is a CSS file for styling\n\nconst ProfileCard = ({ user }) =_ {\n return (\n _div className=_profile-card__\n _img src={user.profileImage} alt={`${user.name}'s profile`} className=_profile-image_ /_\n _h2 className=_profile-name__{user.name}_/h2_\n _p className=_profile-email__{user.email}_/p_\n _p className=_profile-bio__{user.bio}_/p_ {/_ New bio information added _/}\n _a href={`mailto_${user.email}`} className=_contact-link__Contact_/a_\n _/div_\n );\n};\n\nProfileCard.propTypes = {\n user_ PropTypes.shape({\n name_ PropTypes.string.isRequired,\n profileImage_ PropTypes.string.isRequired,\n email_ PropTypes.string.isRequired,\n bio_ PropTypes.string, / New bio prop\n }).isRequired,\n};\n\nexport default ProfileCard;" new file mode 100644 index 000000000..55b0e207e --- /dev/null +++ "b/react-frontend/src/components/ProfileCard.js\n```javascript\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport './ProfileCard.css'; / Assuming there is a CSS file for styling\n\nconst ProfileCard = ({ user }) =_ {\n return (\n _div className=_profile-card__\n _img src={user.profileImage} alt={`${user.name}'s profile`} className=_profile-image_ /_\n _h2 className=_profile-name__{user.name}_/h2_\n _p className=_profile-email__{user.email}_/p_\n _p className=_profile-bio__{user.bio}_/p_ {/_ New bio information added _/}\n _a href={`mailto_${user.email}`} className=_contact-link__Contact_/a_\n _/div_\n );\n};\n\nProfileCard.propTypes = {\n user_ PropTypes.shape({\n name_ PropTypes.string.isRequired,\n profileImage_ PropTypes.string.isRequired,\n email_ PropTypes.string.isRequired,\n bio_ PropTypes.string, / New bio prop\n }).isRequired,\n};\n\nexport default ProfileCard;" @@ -0,0 +1,5 @@ +### Back-end: Spring Boot Controller Modification + +Let's assume we need to modify a controller to handle a new endpoint or adjust existing logic. + +FILE_OPERATION: MODIFY spring-backend/src/main/java/com/example/application/controller/UserController.java \ No newline at end of file diff --git a/spring-backend/src/main/java/com/example/application/service/UserService.java b/spring-backend/src/main/java/com/example/application/service/UserService.java new file mode 100644 index 000000000..1da0e5a56 --- /dev/null +++ b/spring-backend/src/main/java/com/example/application/service/UserService.java @@ -0,0 +1,33 @@ +java +package com.example.application.service; + +import com.example.application.model.User; +import com.example.application.repository.UserRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class UserService { + + @Autowired + private UserRepository userRepository; + + public List findAllUsers() { + return userRepository.findAll(); + } + + public User findUserById(Long id) { + return userRepository.findById(id).orElse(null); + } + + public User updateUserBio(Long id, String bio) { + User user = userRepository.findById(id).orElse(null); + if (user != null) { + user.setBio(bio); + userRepository.save(user); + } + return user; + } +} \ No newline at end of file