Springboot-React(21)
-
배포하기 - my sql
** mysql 홈페이지에서 다운wget https://repo.mysql.com/mysql80-community-release-el9-5.noarch.rpm ** 내 컴퓨터에 있는 파일 실행sudo yum localinstall mysql80-community-release-el9-5.noarch.rpm ** 비밀번호 설정sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 sudo yum install mysql-community-server ** 작업 관리자 -> mysql 실행sudo systemctl enable mysqld.service sudo systemctl start mysqld.service ** 임시 비밀번호 발급sudo ..
2024.09.03 -
검색기능 만들기
Repository에 다음 구문을 추가package com.kh.repository;import java.util.List;import org.springframework.data.jpa.repository.JpaRepository;import org.springframework.stereotype.Repository;import com.kh.dto.Chicken;@Repository //mybatis, mapper 두 가지를 설정, Repository랑 mapper는 interfacepublic interface ChickenRepository extends JpaRepository{ //검색은 sql문이 예외적이므로 필수로 작성해줘야함 List findByChickenNameContainingIgno..
2024.08.24 -
JPA 맛보기 2
삭제, 수정 기능 Controller에 다음 문구들 추가@PutMapping("{id}")public Chicken updateChicken(@PathVariable("id") Integer id, @RequestBody Chicken chicken) { System.out.println(chicken); return chickenService.updateChicken(id, chicken);}@DeleteMapping("{id}")public void deleteChicken(@PathVariable("id") Integer id) { chickenService.deleteChicken(id);} Service에 다음 문구들 추가//수정하기public Chicken updateChic..
2024.08.22 -
상세화면 만들기 + css
ChickenList.js에서 상세보기 버튼을 추가해서 각 치킨마다 상세보기 페이지로 이동하도록 하기 java Controller에서 다음 구문을 추가@GetMapping("/{id}")public Chicken getChickenById(@PathVariable("id") Integer id) { return chickenService.findById(id);} 그리고 useNavigate 함수를 사용const navigate = useNavigate();//중략 {chicken.chickenName} {chicken.description} ₩{chicken.price}원 navigate(`/chicken-detail/${chicken.id}`) } ..
2024.08.21 -
주소 api
import { useEffect, useState } from 'react';import axios from 'axios';const AddressSearching = () => { const [address, setAddress] = useState(''); const [additionalAddress, setAdditionalAddress] = useState(''); const [finalAddress, setFinalAddress] = useState(''); //주소 검색을 완료하고 사용자가 검색한 데이터를 가져와서 기능 실행하기 const handleComplete = (data) => { //사용자가 선택한 기본 주소를 저장 let ful..
2024.08.16 -
비밀번호 암호화
build.gradle dependencies 에 다음 문구 추가implementation 'org.springframework.boot:spring-boot-starter-security' 이후 SecurityConfig 작성 package com.kh.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.security.config.annotation.web.builders.HttpSecurity;import org.springframework.security.config.annotation.web..
2024.08.14