完成动态发布功能(审核未实现)

This commit is contained in:
KilLze
2025-12-18 10:59:29 +08:00
parent e1a4cb1d47
commit 6ef38ac5e0
15 changed files with 397 additions and 4 deletions

View File

@@ -8,9 +8,18 @@ spring:
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
# MyBatis 配置
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.bao.dating.pojo
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 阿里云 OSS 配置
aliyun:
oss:
endpoint: oss-cn-hangzhou.aliyuncs.com
access-key-id: LTAI5tKo9TpWH1aW6JxWm1Gp
access-key-secret: LHk9DdHECKCwIdaIM9fkGgEuowt18W
bucket-name: heimato

View File

@@ -0,0 +1,22 @@
<?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.bao.dating.mapper.PostMapper">
<!-- 动态添加 -->
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
INSERT INTO post
(user_id, content,
<if test="mediaOssKeys != null and mediaOssKeys != ''">
media_oss_keys,
</if>
tags,
<if test="location != null and location != ''">
location,
</if>
is_public, like_count, favorite_count, created_at, updated_at)
VALUES
(#{userId}, #{content}, #{mediaOssKeys}, #{tags}, #{location}, #{isPublic}, 0, 0, #{created_at}, #{updated_at})
</insert>
</mapper>