mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
:fire:优化代码
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user