- board_image 테이블 + BoardImageController/Service/Mapper
· POST /api/board/images(로그인) → {url:/api/images/{id}}
· GET /api/images/{id}(공개, img src 로 로드) — 1년 캐시
- 본문엔 짧은 URL 만 들어가 글이 비대해지지 않음
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sb.web.board.mapper.BoardImageMapper">
|
||||
|
||||
<insert id="insert" parameterType="com.sb.web.board.domain.BoardImage"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO board_image (member_id, content_type, data, byte_size, created_at)
|
||||
VALUES (#{memberId}, #{contentType}, #{data}, #{byteSize}, NOW())
|
||||
</insert>
|
||||
|
||||
<select id="findById" resultType="com.sb.web.board.domain.BoardImage">
|
||||
SELECT id, member_id, content_type, data, byte_size, created_at
|
||||
FROM board_image
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user