第一次提交

This commit is contained in:
wyw
2024-08-08 00:31:26 +08:00
commit c202e2b63d
1819 changed files with 221890 additions and 0 deletions

View File

@ -0,0 +1,152 @@
<?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.fastbee.oss.mapper.OssConfigMapper">
<resultMap type="com.fastbee.oss.domain.OssConfig" id="OssConfigResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="configKey" column="config_key" />
<result property="accessKey" column="access_key" />
<result property="secretKey" column="secret_key" />
<result property="bucketName" column="bucket_name" />
<result property="prefix" column="prefix" />
<result property="endpoint" column="endpoint" />
<result property="domain" column="domain" />
<result property="isHttps" column="is_https" />
<result property="region" column="region" />
<result property="accessPolicy" column="access_policy" />
<result property="status" column="status" />
<result property="ext1" column="ext1" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectOssConfigVo">
select id, tenant_id, tenant_name, config_key, access_key, secret_key, bucket_name, prefix, endpoint, domain, is_https, region, access_policy, status, ext1, del_flag, create_by, create_time, update_by, update_time, remark from oss_config
</sql>
<select id="selectOssConfigList" parameterType="com.fastbee.oss.domain.OssConfig" resultMap="OssConfigResult">
<include refid="selectOssConfigVo"/>
<where>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
<if test="configKey != null and configKey != ''"> and config_key = #{configKey}</if>
<if test="accessKey != null and accessKey != ''"> and access_key = #{accessKey}</if>
<if test="secretKey != null and secretKey != ''"> and secret_key = #{secretKey}</if>
<if test="bucketName != null and bucketName != ''"> and bucket_name like concat('%', #{bucketName}, '%')</if>
<if test="prefix != null and prefix != ''"> and prefix = #{prefix}</if>
<if test="endpoint != null and endpoint != ''"> and endpoint = #{endpoint}</if>
<if test="domain != null and domain != ''"> and domain = #{domain}</if>
<if test="isHttps != null and isHttps != ''"> and is_https = #{isHttps}</if>
<if test="region != null and region != ''"> and region = #{region}</if>
<if test="accessPolicy != null and accessPolicy != ''"> and access_policy = #{accessPolicy}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="ext1 != null and ext1 != ''"> and ext1 = #{ext1}</if>
</where>
</select>
<select id="selectOssConfigById" parameterType="Integer" resultMap="OssConfigResult">
<include refid="selectOssConfigVo"/>
where id = #{id}
</select>
<insert id="insertOssConfig" parameterType="com.fastbee.oss.domain.OssConfig" useGeneratedKeys="true" keyProperty="id">
insert into oss_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
<if test="configKey != null and configKey != ''">config_key,</if>
<if test="accessKey != null and accessKey != ''">access_key,</if>
<if test="secretKey != null and secretKey != ''">secret_key,</if>
<if test="bucketName != null and bucketName != ''">bucket_name,</if>
<if test="prefix != null and prefix != ''">prefix,</if>
<if test="endpoint != null and endpoint != ''">endpoint,</if>
<if test="domain != null and domain != ''">domain,</if>
<if test="isHttps != null and isHttps != ''">is_https,</if>
<if test="region != null and region != ''">region,</if>
<if test="accessPolicy != null and accessPolicy != ''">access_policy,</if>
<if test="status != null and status != ''">status,</if>
<if test="ext1 != null and ext1 != ''">ext1,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
<if test="configKey != null and configKey != ''">#{configKey},</if>
<if test="accessKey != null and accessKey != ''">#{accessKey},</if>
<if test="secretKey != null and secretKey != ''">#{secretKey},</if>
<if test="bucketName != null and bucketName != ''">#{bucketName},</if>
<if test="prefix != null and prefix != ''">#{prefix},</if>
<if test="endpoint != null and endpoint != ''">#{endpoint},</if>
<if test="domain != null and domain != ''">#{domain},</if>
<if test="isHttps != null and isHttps != ''">#{isHttps},</if>
<if test="region != null and region != ''">#{region},</if>
<if test="accessPolicy != null and accessPolicy != ''">#{accessPolicy},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="ext1 != null and ext1 != ''">#{ext1},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateOssConfig" parameterType="com.fastbee.oss.domain.OssConfig">
update oss_config
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
<if test="accessKey != null and accessKey != ''">access_key = #{accessKey},</if>
<if test="secretKey != null and secretKey != ''">secret_key = #{secretKey},</if>
<if test="bucketName != null and bucketName != ''">bucket_name = #{bucketName},</if>
<if test="prefix != null and prefix != ''">prefix = #{prefix},</if>
<if test="endpoint != null and endpoint != ''">endpoint = #{endpoint},</if>
<if test="domain != null and domain != ''">domain = #{domain},</if>
<if test="isHttps != null and isHttps != ''">is_https = #{isHttps},</if>
<if test="region != null and region != ''">region = #{region},</if>
<if test="accessPolicy != null and accessPolicy != ''">access_policy = #{accessPolicy},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="ext1 != null and ext1 != ''">ext1 = #{ext1},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOssConfigById" parameterType="Integer">
delete from oss_config where id = #{id}
</delete>
<delete id="deleteOssConfigByIds" parameterType="String">
delete from oss_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="resetConfigStatus">
update oss_config set status = 1
where status = 0
</update>
</mapper>

View File

@ -0,0 +1,110 @@
<?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.fastbee.oss.mapper.OssDetailMapper">
<resultMap type="com.fastbee.oss.domain.OssDetail" id="OssDetailResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="fileName" column="file_name" />
<result property="originalName" column="original_name" />
<result property="fileSuffix" column="file_suffix" />
<result property="url" column="url" />
<result property="service" column="service" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectOssDetailVo">
select id, tenant_id, tenant_name, file_name, original_name, file_suffix, url, service, del_flag, create_by, create_time, update_by, update_time, remark from oss_detail
</sql>
<select id="selectOssDetailList" parameterType="com.fastbee.oss.domain.OssDetail" resultMap="OssDetailResult">
<include refid="selectOssDetailVo"/>
<where>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="originalName != null and originalName != ''"> and original_name like concat('%', #{originalName}, '%')</if>
<if test="fileSuffix != null and fileSuffix != ''"> and file_suffix = #{fileSuffix}</if>
<if test="url != null and url != ''"> and url = #{url}</if>
<if test="service != null and service != ''"> and service = #{service}</if>
</where>
</select>
<select id="selectOssDetailById" parameterType="Integer" resultMap="OssDetailResult">
<include refid="selectOssDetailVo"/>
where id = #{id}
</select>
<insert id="insertOssDetail" parameterType="com.fastbee.oss.domain.OssDetail" useGeneratedKeys="true" keyProperty="id">
insert into oss_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="originalName != null and originalName != ''">original_name,</if>
<if test="fileSuffix != null and fileSuffix != ''">file_suffix,</if>
<if test="url != null and url != ''">url,</if>
<if test="service != null and service != ''">service,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="originalName != null and originalName != ''">#{originalName},</if>
<if test="fileSuffix != null and fileSuffix != ''">#{fileSuffix},</if>
<if test="url != null and url != ''">#{url},</if>
<if test="service != null and service != ''">#{service},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateOssDetail" parameterType="com.fastbee.oss.domain.OssDetail">
update oss_detail
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
<if test="originalName != null and originalName != ''">original_name = #{originalName},</if>
<if test="fileSuffix != null and fileSuffix != ''">file_suffix = #{fileSuffix},</if>
<if test="url != null and url != ''">url = #{url},</if>
<if test="service != null and service != ''">service = #{service},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOssDetailById" parameterType="Integer">
delete from oss_detail where id = #{id}
</delete>
<delete id="deleteOssDetailByIds" parameterType="String">
delete from oss_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,64 @@
-- ----------------------------
-- Table structure for oss_detail
-- ----------------------------
DROP TABLE IF EXISTS `oss_detail`;
CREATE TABLE `oss_detail`
(
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '文件id',
`tenant_id` bigint(20) NOT NULL DEFAULT 1 COMMENT '租户ID',
`tenant_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '租户名称',
`file_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件名',
`original_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '原名',
`file_suffix` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件后缀名',
`url` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'URL地址',
`service` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'aliyun' COMMENT '服务商',
`del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NOT NULL COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8
COLLATE = utf8_general_ci COMMENT = '文件记录表'
ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `oss_config`;
CREATE TABLE `oss_config`
(
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`tenant_id` bigint(20) NOT NULL DEFAULT 1 COMMENT '租户ID',
`tenant_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '租户名称',
`config_key` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '配置key',
`access_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'accessKey',
`secret_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '秘钥',
`bucket_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '桶名称',
`prefix` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT'前缀',
`endpoint` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '访问站点',
`domain` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '自定义域名',
`is_https` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否httpsY=是,N=否)',
`region` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '',
`access_policy` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1' COMMENT '桶权限类型(0=private 1=public 2=custom)',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1' COMMENT '是否默认0=是,1=否)',
`ext1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '扩展字段',
`del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '删除标志0代表存在 2代表删除',
`create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime(0) NOT NULL COMMENT '创建时间',
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8
COLLATE = utf8_general_ci COMMENT = '对象存储配置表'
ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of oss_config
-- ----------------------------
insert into oss_config values (1, 1, 'admin', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'fastbee', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '0' ,'0', '', '0', '', '2023-02-25 23:15:57', '', NULL, NULL);
insert into oss_config values (2, 1, 'admin', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'fastbee', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1' ,'1', '', '0', '', '2023-02-25 23:15:57', '', NULL, NULL);