注册登录,用户等级,社交,动态,新手任务
Change-Id: I1d3183526517fb3c0dab665e0e7547eefa5c9d76
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 0590333..80f468d 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,12 +1,12 @@
server.port=8080
-spring.datasource.url=jdbc:mysql://localhost:3306/pt
+spring.datasource.url=jdbc:mysql://localhost:3306/ptProject
spring.datasource.username=root
-spring.datasource.password=root
+spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
-
# Mail configuration
spring.mail.password=tljnebonhzhqecda
spring.mail.username=2370523716@qq.com
@@ -17,15 +17,8 @@
spring.jpa.enabled=false
-spring.jpa.hibernate.ddl-auto=none
+spring.jpa.hibernate.ddl-auto=update
spring.jpa.open-in-view=false
-# tracker??
-pt.tracker.port=6969
-pt.tracker.torrent-dir=${user.dir}/data/torrents
-
-pt.tracker.allow-foreign=false
-pt.tracker.announce-url=/custom-announce
-
-mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml
+mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml
\ No newline at end of file
diff --git a/src/main/resources/files/files.torrent b/src/main/resources/files/files.torrent
deleted file mode 100644
index e04974f..0000000
--- a/src/main/resources/files/files.torrent
+++ /dev/null
@@ -1 +0,0 @@
-d8:announce22:https://tracker.byr.pt10:created by21:qBittorrent v4.5.3.1013:creation datei1747717901e4:infod5:filesld6:lengthi173e4:pathl13:valid.torrenteee4:name5:files12:piece lengthi16384e6:pieces20:/ñíèEô5ã<òûìÕQ¡ûee
\ No newline at end of file
diff --git a/src/main/resources/mapper/FavoriteMapper.xml b/src/main/resources/mapper/FavoriteMapper.xml
deleted file mode 100644
index 1048ec2..0000000
--- a/src/main/resources/mapper/FavoriteMapper.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?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.example.myproject.mapper.FavoriteMapper">
-
-</mapper>
diff --git a/src/main/resources/mapper/PromotionMapper.xml b/src/main/resources/mapper/PromotionMapper.xml
deleted file mode 100644
index 72ffd95..0000000
--- a/src/main/resources/mapper/PromotionMapper.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?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.example.myproject.mapper.PromotionMapper">
-
- <insert id="insert" parameterType="com.example.myproject.entity.Promotion">
- INSERT INTO promotion (
- name, description, start_time, end_time, discount_percentage, applicable_torrent_ids
- ) VALUES (
- #{name}, #{description}, #{startTime}, #{endTime}, #{discountPercentage}, #{applicableTorrentIds}
- )
- </insert>
-
-</mapper>
diff --git a/src/main/resources/mapper/TorrentMapper.xml b/src/main/resources/mapper/TorrentMapper.xml
deleted file mode 100644
index d5f018e..0000000
--- a/src/main/resources/mapper/TorrentMapper.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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.example.myproject.mapper.TorrentMapper">
- <resultMap id="BaseResultMap" type="com.example.myproject.entity.TorrentEntity">
- <id column="info_hash" property="infoHash"/>
- <result column="file_name" property="fileName"/>
- <result column="uploader" property="uploader"/>
- <result column="upload_time" property="uploadTime"/>
- <result column="size" property="size"/>
- <result column="title" property="title"/>
- <result column="description" property="description"/>
- <result column="category" property="category"/>
- <result column="image_url" property="imageUrl"/>
- </resultMap>
-
- <select id="selectByInfoHash" resultMap="BaseResultMap">
- SELECT * FROM torrent WHERE info_hash = #{infoHash}
- </select>
- <select id="selectBySeedId" resultMap="BaseResultMap">
- SELECT * FROM torrent WHERE seed_id = #{seedId}
- </select>
-
-
-
-
- <update id="update" parameterType="com.example.myproject.entity.TorrentEntity">
- UPDATE torrent
- SET file_name = #{fileName},
- uploader = #{uploader},
- upload_time = #{uploadTime},
- size = #{size},
- title = #{title},
- description = #{description},
- category = #{category},
- image_url = #{imageUrl}
- WHERE info_hash = #{infoHash}
- </update>
- <select id="search" resultType="com.example.myproject.entity.TorrentEntity">
- SELECT * FROM torrent
- <where>
- <if test="param.category != null">
- AND category = #{param.category}
- </if>
-
- <!-- <if test="param.free != null and param.free != ''">-->
- <!-- AND free = #{param.free}-->
- <!-- </if>-->
- <if test="param.free != null">
- <choose>
- <!-- 筛选“正在促销中”的种子 -->
- <when test="param.free == true">
- AND EXISTS (
- SELECT 1 FROM promotion p
- WHERE
- JSON_CONTAINS(p.applicable_torrent_ids, JSON_ARRAY(t.id))
- AND NOW() BETWEEN p.start_time AND p.end_time
- AND p.is_deleted = 0
- )
- </when>
- <!-- 筛选“未在促销中”的种子 -->
- <otherwise>
- AND NOT EXISTS (
- SELECT 1 FROM promotion p
- WHERE
- JSON_CONTAINS(p.applicable_torrent_ids, JSON_ARRAY(t.id))
- AND NOW() BETWEEN p.start_time AND p.end_time
- AND p.is_deleted = 0
- )
- </otherwise>
- </choose>
- </if>
-
- <if test="param.likeExpressions != null and param.likeExpressions.size > 0">
- AND (
- <foreach collection="param.likeExpressions" item="item" open="(" separator=" AND " close=")">
-
- ( title LIKE CONCAT('%', #{item}, '%') ) or ( description LIKE CONCAT('%', #{item}, '%') ) or ( tags LIKE CONCAT('%', #{item}, '%') )
- </foreach>
- )
- </if>
- </where>
-
- <if test="param.prop != null and param.sort != null">
- ORDER BY ${param.prop} ${param.sort}
- </if>
- </select>
- <select id="checkFavorite" resultType="boolean">
- SELECT COUNT(*) > 0
- FROM favorite
- WHERE seed_id = #{seedId} AND user_id = #{userId}
- </select>
- <insert id="addFavorite">
- INSERT INTO favorite (seed_id, user_id)
- VALUES (#{seedId}, #{userId})
- </insert>
- <delete id="removeFavorite">
- DELETE FROM favorite
- WHERE seed_id = #{seedId} AND user_id = #{userId}
- </delete>
-
-
-</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
deleted file mode 100644
index f03ab0a..0000000
--- a/src/main/resources/mapper/UserMapper.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?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.example.myproject.mapper.UserMapper">
- <!-- 根据用户名查找用户 -->
- <select id="selectByUsername" parameterType="string" resultType="com.example.myproject.entity.User">
- SELECT * FROM user WHERE username = #{username}
- </select>
- <!-- 根据用户名和密码查找用户 -->
- <select id="selectByUsernameAndPassword" parameterType="map" resultType="com.example.myproject.entity.User">
- SELECT * FROM user WHERE username = #{username} AND password = #{password}
- </select>
- <!-- 根据邮箱查找用户 -->
- <select id="selectByEmail" parameterType="string" resultType="com.example.myproject.entity.User">
- SELECT * FROM user WHERE email = #{email}
- </select>
- <!-- 根据用户名包含查找用户 -->
- <select id="selectByUsernameContaining" parameterType="string" resultType="com.example.myproject.entity.User">
- SELECT * FROM user WHERE username LIKE CONCAT('%', #{name}, '%')
- </select>
-</mapper>
diff --git a/src/main/resources/mapper/VerificationTokenMapper.xml b/src/main/resources/mapper/VerificationTokenMapper.xml
deleted file mode 100644
index 53b19a5..0000000
--- a/src/main/resources/mapper/VerificationTokenMapper.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?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.example.myproject.mapper.VerificationTokenMapper">
- <!-- 通过 token 和 email 查询 VerificationToken -->
- <select id="findByTokenAndEmail" resultType="com.example.myproject.entity.VerificationToken">
- SELECT * FROM verification_token
- WHERE token = #{token} AND email = #{email}
- </select>
-</mapper>
diff --git a/src/main/resources/output/valid.torrent b/src/main/resources/output/valid.torrent
deleted file mode 100644
index 6a90e52..0000000
--- a/src/main/resources/output/valid.torrent
+++ /dev/null
@@ -1 +0,0 @@
-d10:created by18:qBittorrent v5.1.013:creation datei1745948995e4:infod6:lengthi22e4:name15:example.torrent12:piece lengthi16384e6:pieces20:Fnð¶)ú<Ç æÂh£tl7:privatei1eee
\ No newline at end of file