- Renamed XML mapper files for consistency. - Added new fields `is_admin` and `is_banned` to the `Reader` entity and updated the database schema. - Introduced `AuthCheck` annotation for method-level authorization. - Implemented JWT utility for token generation and validation. - Enhanced service and controller layers for `Book`, `Reader`, and `Orders` with new methods and improved error handling. - Added global exception handling for better API response management. - Updated `pom.xml` to include new dependencies for JWT and Spring Security.
25 lines
1.0 KiB
XML
25 lines
1.0 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.grtsinry43.bookmanagement.mapper.OrderItemMapper">
|
|
|
|
<select id="findByOrderId" resultType="com.grtsinry43.bookmanagement.entity.OrderItem">
|
|
SELECT * FROM order_item WHERE order_id = #{orderId}
|
|
</select>
|
|
|
|
<insert id="insert" parameterType="com.grtsinry43.bookmanagement.entity.OrderItem" useGeneratedKeys="true" keyProperty="orderItemId">
|
|
INSERT INTO order_item (order_id, book_id, quantity, unit_price)
|
|
VALUES (#{orderId}, #{bookId}, #{quantity}, #{unitPrice})
|
|
</insert>
|
|
|
|
<!-- Example for batch insert -->
|
|
<!--
|
|
<insert id="insertBatch" parameterType="java.util.List">
|
|
INSERT INTO order_item (order_id, book_id, quantity, unit_price) VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.orderId}, #{item.bookId}, #{item.quantity}, #{item.unitPrice})
|
|
</foreach>
|
|
</insert>
|
|
-->
|
|
|
|
</mapper>
|