- ํ๋งค์์ ๊ฐ๊ฒ์ ๋ํ๋๋ ๋ฉ๋ด๋ค์ ๋ชจ๋ ๋น์ผ ๋จ์ด๋ฉ๋ด๋ฅผ ๋ฑ๋กํ์๋ ๋ํ๋๋ค.
- ์ฌ์ฅ๋๋ค์ ์์ ๋ก์ด ๋ฑ๋ก๊ณผ, ์๋น์๋ค์ด ํด๋น ์์์ค ์ํ๋๊ฒ ์๋์ง ํ์ธํ ์ ์์.
- ๋ฉ๋ด ๋ชฉ๋ก์์ ๋ฉ๋ด ํด๋ฆญ์ ํด๋น ๋ฉ๋ด์ ์์ธ ์ ๋ณด๋ฅผ ํ์ธํ๋ค.
- ์ฅ๋ฐ๊ตฌ๋ ๋ด๊ธฐ ์ ํ๋ฉด!
- ์๋ต ๋ฐ๋
๋ฉ๋ด ์ ๋ณด์ +๊ตฌ์ฑ ์ด ์ถ๊ฐ ๋์๋ค.
๋ฉ๋ด ์ด๋ฆ, ํด๋น ๋จ์ด๋ฉ๋ด Idx, ๋จ์ ๊ฐ์, ๊ตฌ์ฑ, ์ค๋ช , ์๊ฐ, ํ ์ธ๋น์จ, ํ ์ธ ๊ฐ๊ฒฉ
- ์ปจํธ๋กค๋ฌ
- ์๋น์ค
public GetMenuDetailInfoRes getMenuDetailInfo(int todaymenuIdx) throws BaseException{//getMenuDetailInfo //๋ฉ๋ด ํด๋ฆญํ์๋ ์ ๋ณด ๊ฐ์ง๊ณ ์ค๊ธฐ //์ฟผ๋ผ์คํธ๋ง์ผ๋ก ํ๋์ ๋จ์ด๋ฉ๋ด์ ํด๋น ์คํ ์ด idx๋ฅผ ๊ฐ์ง๊ณ ์์ผํจ ๊ฐ์ง๊ณ ์์ผํจ try { GetMenuDetailInfoRes getMenuDetailInfoRes= appMenuDao.getMenuDetailInfo(todaymenuIdx); if (getMenuDetailInfoRes.getMenuUrl() != null && !getMenuDetailInfoRes.equals("")) getMenuDetailInfoRes.setMenuUrl("" + s3Client.getUrl(bucketName, getMenuDetailInfoRes.getMenuUrl())); return getMenuDetailInfoRes; }catch (Exception e){ throw new BaseException(POST_STORES_NOT_REGISTERD); // 2030 : ์ฌ์ฉ์์ ๊ฐ๊ฒ๊ฐ ๋ฑ๋ก๋์ด์์ง ์์ต๋๋ค. } }
- Dao
public GetMenuDetailInfoRes getMenuDetailInfo(int todaymenuIdx){ String query ="SELECT m.storeIdx, tm.todaymenuIdx, m.menu_url, m.menu_name, tm.remain,\n" + " m.composition, m.description, m.price, tm.discount, tm.price AS price_today\n" + "FROM TodayMenu tm\n" + "JOIN Menu m ON m.menuIdx = tm.menuIdx\n" + "WHERE tm.todaymenuIdx = ?"; //์กฐ์ธํ ๋๋ ํฌ๋ฐ์ด๋ฉ๋ด์์ด๋์์ค ๊ธฐ์ค return this.jdbcTemplate.queryForObject(query, (rs, rowNum) -> new GetMenuDetailInfoRes( rs.getInt("storeIdx"), rs.getInt("todaymenuIdx"), rs.getString("menu_url"), rs.getString("menu_name"), rs.getInt("remain"), rs.getString("composition"), rs.getString("description"), rs.getInt("price"), rs.getInt("discount"), rs.getInt("price_today") ),todaymenuIdx); }