:fire:优化代码

This commit is contained in:
tiansh
2024-03-19 11:17:05 +08:00
parent 0ede684acb
commit 113e69fff2
2 changed files with 6 additions and 16 deletions
@@ -12,10 +12,7 @@ import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.Bucket;
import com.amazonaws.services.s3.model.DeleteObjectRequest;
import com.amazonaws.services.s3.model.ObjectListing;
import com.amazonaws.services.s3.model.PutObjectRequest;
import com.amazonaws.services.s3.model.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,6 +56,9 @@ public class S3Imageupload {
String ShortUIDName = entry.getKey().get("name");
file = entry.getValue();
stream = new FileInputStream(file);
//解决存储源不能浏览图片的问题
// ObjectMetadata objectMetadata = new ObjectMetadata();
// objectMetadata.addUserMetadata();
AS3.putObject(
new PutObjectRequest(
KEY.getBucketname(),
+2 -12
View File
@@ -53,7 +53,6 @@
</where>
</select>
<!-- 查询当前用户:根据邮箱,根据id -->
<select id="getUsers" parameterType="cn.hellohao.pojo.User" resultType="cn.hellohao.pojo.User">
SELECT id,
username,
@@ -85,7 +84,7 @@
</if>
</where>
</select>
<!-- 查询当前用户:根据id -->
<select id="getUsersid" parameterType="integer" resultType="cn.hellohao.pojo.User">
SELECT id,
username,
@@ -101,7 +100,7 @@
FROM user
WHERE id = #{id}
</select>
<!-- 查询当前用户:根据uid -->
<select id="getUsersMail" parameterType="string" resultType="cn.hellohao.pojo.User">
SELECT id,
username,
@@ -118,13 +117,6 @@
WHERE uid = #{uid}
</select>
<!-- 插入图片信息 -->
<!-- <insert id="insertimg" parameterType="cn.hellohao.pojo.Images">-->
<!-- INSERT INTO imgdata (id, imgname, imgurl, userid, updatetime,sizes,abnormal,source,imgtype,md5key,imguid,format,about,violation)-->
<!-- VALUES (NULL, #{imgname}, #{imgurl}, #{userid}, #{updatetime},#{sizes},#{abnormal},#{source},#{imgtype},#{md5key},#{imguid},#{format},#{about},null)-->
<!-- </insert>-->
<!-- 修改资料 -->
<update id="change" parameterType="cn.hellohao.pojo.User">
UPDATE `user`
<set>
@@ -185,12 +177,10 @@
SELECT count(username) FROM `user` where username=#{username}
</select>
<!-- 查询用户总数 -->
<select id="getUserTotal" resultType="integer">
SELECT count(*) FROM `user`
</select>
<!-- 获取用户的详细信息 -->
<select id="getuserlist" resultType="cn.hellohao.pojo.User" parameterType="string">
SELECT
id,