完成动态发布功能(审核未实现)
This commit is contained in:
@@ -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
|
||||
22
src/main/resources/com/bao/dating/mapper/PostMapper.xml
Normal file
22
src/main/resources/com/bao/dating/mapper/PostMapper.xml
Normal 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>
|
||||
Reference in New Issue
Block a user