添加上传文件后缀名称,以及上传名称和日期顺序放反
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -150,6 +150,10 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<version>1.18.40</version>
|
<version>1.18.40</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.realtime.controller;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.realtime.model.pojo.ChatList;
|
import com.realtime.model.pojo.ChatList;
|
||||||
import com.realtime.model.query.ChatListPageQueryReq;
|
import com.realtime.model.query.ChatListPageQueryReq;
|
||||||
|
import com.realtime.model.query.GetSessionIdReq;
|
||||||
import com.realtime.service.ChatListService;
|
import com.realtime.service.ChatListService;
|
||||||
import com.realtime.sysconst.Result;
|
import com.realtime.sysconst.Result;
|
||||||
import com.realtime.vo.ChatListInfoVo;
|
import com.realtime.vo.ChatListInfoVo;
|
||||||
@@ -44,4 +45,9 @@ public class ChatListController {
|
|||||||
Result<String> updateChatList(@RequestBody List<ChatList> chatList){
|
Result<String> updateChatList(@RequestBody List<ChatList> chatList){
|
||||||
return chatListService.updateChatListFName(chatList);
|
return chatListService.updateChatListFName(chatList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/querySessionId")
|
||||||
|
Result<Long> querySessionId(@RequestBody GetSessionIdReq getSessionIdReq){
|
||||||
|
return chatListService.querySessionId(getSessionIdReq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.realtime.model.pojo.ChatList;
|
import com.realtime.model.pojo.ChatList;
|
||||||
import com.realtime.model.query.ChatListPageQueryReq;
|
import com.realtime.model.query.ChatListPageQueryReq;
|
||||||
|
import com.realtime.model.query.GetSessionIdReq;
|
||||||
import com.realtime.vo.ChatListInfoVo;
|
import com.realtime.vo.ChatListInfoVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -15,6 +16,8 @@ public interface ChatListMapper extends BaseMapper<ChatList> {
|
|||||||
IPage<ChatListInfoVo> getChatList(@Param("reqPage") IPage<ChatListPageQueryReq> page, @Param("req") ChatListPageQueryReq chatListPageQueryReq);
|
IPage<ChatListInfoVo> getChatList(@Param("reqPage") IPage<ChatListPageQueryReq> page, @Param("req") ChatListPageQueryReq chatListPageQueryReq);
|
||||||
|
|
||||||
void deleteFriend(@Param("id") String id,@Param("receiver") String receiver);
|
void deleteFriend(@Param("id") String id,@Param("receiver") String receiver);
|
||||||
|
|
||||||
|
Long querySessionId(@Param("req") GetSessionIdReq getSessionIdReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,5 +15,5 @@ public class BaseTeamReq implements Serializable {
|
|||||||
* 访问令牌
|
* 访问令牌
|
||||||
*/
|
*/
|
||||||
@JsonProperty("access_token")
|
@JsonProperty("access_token")
|
||||||
private String accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiNjhlNzY0ZjBmOTU0ODg3MWMyMmY5M2I4IiwibGFzdExvZ2luIjoiMTc2NTQzNDMyNy41MjA5ODYifQ.Vj0ovpCsziFzeR2qroYnN-3KevR78krx-rDFQ9BKlgU";
|
private String accessToken;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.realtime.model.query;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GetSessionIdReq {
|
||||||
|
private String senderId;
|
||||||
|
private String receiverId;
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.realtime.model.pojo.ChatList;
|
import com.realtime.model.pojo.ChatList;
|
||||||
import com.realtime.model.query.ChatListPageQueryReq;
|
import com.realtime.model.query.ChatListPageQueryReq;
|
||||||
|
import com.realtime.model.query.GetSessionIdReq;
|
||||||
import com.realtime.sysconst.Result;
|
import com.realtime.sysconst.Result;
|
||||||
import com.realtime.vo.ChatListInfoVo;
|
import com.realtime.vo.ChatListInfoVo;
|
||||||
|
|
||||||
@@ -25,4 +26,6 @@ public interface ChatListService extends IService<ChatList> {
|
|||||||
|
|
||||||
|
|
||||||
Result<String> deleteSignChatList(ChatList ids);
|
Result<String> deleteSignChatList(ChatList ids);
|
||||||
|
|
||||||
|
Result<Long> querySessionId(GetSessionIdReq getSessionIdReq);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.realtime.mappers.ChatListMapper;
|
|||||||
import com.realtime.model.pojo.ChatList;
|
import com.realtime.model.pojo.ChatList;
|
||||||
import com.realtime.model.pojo.FriendRelationship;
|
import com.realtime.model.pojo.FriendRelationship;
|
||||||
import com.realtime.model.query.ChatListPageQueryReq;
|
import com.realtime.model.query.ChatListPageQueryReq;
|
||||||
|
import com.realtime.model.query.GetSessionIdReq;
|
||||||
import com.realtime.service.ChatListService;
|
import com.realtime.service.ChatListService;
|
||||||
import com.realtime.service.FriendRelationshipService;
|
import com.realtime.service.FriendRelationshipService;
|
||||||
import com.realtime.sysconst.Result;
|
import com.realtime.sysconst.Result;
|
||||||
@@ -140,6 +141,11 @@ public class ChatListServiceImpl extends ServiceImpl<ChatListMapper, ChatList>
|
|||||||
return Result.success("ok");
|
return Result.success("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<Long> querySessionId(GetSessionIdReq getSessionIdReq) {
|
||||||
|
return Result.success(baseMapper.querySessionId(getSessionIdReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class FileServiceImpl implements FileService {
|
|||||||
String originalFilename = file.getOriginalFilename();
|
String originalFilename = file.getOriginalFilename();
|
||||||
assert originalFilename != null;
|
assert originalFilename != null;
|
||||||
UploadVo uploadVo = new UploadVo();
|
UploadVo uploadVo = new UploadVo();
|
||||||
String storeFileName = originalFilename + Instant.now().getEpochSecond();
|
String storeFileName = Instant.now().getEpochSecond() +originalFilename;
|
||||||
String url = generateFileUrl(storeFileName);
|
String url = generateFileUrl(storeFileName);
|
||||||
uploadVo.setName(originalFilename);
|
uploadVo.setName(originalFilename);
|
||||||
uploadVo.setUrl(url);
|
uploadVo.setUrl(url);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public class SessionUtils {
|
|||||||
|
|
||||||
public static final Map<String, Channel> userIdChannelMap = new ConcurrentHashMap<>();
|
public static final Map<String, Channel> userIdChannelMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* groupId ---> channelgroup 群聊ID和群聊ChannelGroup映射
|
* groupId ---> channelgroup 群聊ID和群聊ChannelGroup映射
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ file:
|
|||||||
picMaxSize: 104857600 # 100MB
|
picMaxSize: 104857600 # 100MB
|
||||||
picMaxCount: 1
|
picMaxCount: 1
|
||||||
picAllowedFormats: png,jpg
|
picAllowedFormats: png,jpg
|
||||||
allowedFormats: doc,docx,xls,xlsx,ppt,pptx,txt,jpg,jpeg,png,gif,svg,mp3,mp4,zip,rar,exe,dmg,apk,md
|
allowedFormats: doc,docx,xls,xlsx,ppt,pptx,txt,jpg,jpeg,png,gif,svg,mp3,mp4,zip,rar,exe,dmg,apk,md,py,html
|
||||||
spring:
|
spring:
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|||||||
@@ -13,7 +13,10 @@
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<delete id="deleteFriend">
|
<delete id="deleteFriend">
|
||||||
delete from chat_list lt where lt.sender = #{id} and lt.receiver = #{receiver}
|
delete
|
||||||
|
from chat_list lt
|
||||||
|
where lt.sender = #{id}
|
||||||
|
and lt.receiver = #{receiver}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<resultMap id="getChatListMap" type="chatListInfoVo"/>
|
<resultMap id="getChatListMap" type="chatListInfoVo"/>
|
||||||
@@ -35,4 +38,10 @@
|
|||||||
from chat_list ch
|
from chat_list ch
|
||||||
where ch.sender = #{req.sendId}
|
where ch.sender = #{req.sendId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="querySessionId" resultType="java.lang.Long">
|
||||||
|
select session_id
|
||||||
|
from chat_list ch
|
||||||
|
where ch.sender = #{req.senderId}
|
||||||
|
and ch.receiver = #{req.receiverId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user