聊天室创建逻辑修改和样式修正
This commit is contained in:
@@ -60,7 +60,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/workcase/chat")
|
||||
public class WorkcaseChatContorller {
|
||||
public class WorkcaseChatController {
|
||||
|
||||
@Autowired
|
||||
private WorkcaseChatService workcaseChatService;
|
||||
@@ -78,7 +78,8 @@ public class WorkcaseChatContorller {
|
||||
@PostMapping("/room")
|
||||
public ResultDomain<TbChatRoomDTO> createChatRoom(@RequestBody TbChatRoomDTO chatRoom) {
|
||||
ValidationResult vr = ValidationUtils.validate(chatRoom, Arrays.asList(
|
||||
ValidationUtils.requiredString("guestId", "来客ID")
|
||||
ValidationUtils.requiredString("guestId", "来客ID"),
|
||||
ValidationUtils.requiredString("deviceCode", "设备代码")
|
||||
));
|
||||
if (!vr.isValid()) {
|
||||
return ResultDomain.failure(vr.getAllErrors());
|
||||
@@ -88,7 +89,7 @@ public class WorkcaseChatContorller {
|
||||
return chatRoomService.createChatRoom(chatRoom);
|
||||
} catch (Exception e) {
|
||||
return ResultDomain.failure(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "更新聊天室")
|
||||
@@ -13,6 +13,7 @@
|
||||
<result column="guest_name" property="guestName" jdbcType="VARCHAR"/>
|
||||
<result column="ai_session_id" property="aiSessionId" jdbcType="VARCHAR"/>
|
||||
<result column="message_count" property="messageCount" jdbcType="INTEGER"/>
|
||||
<result column="device_code" property="deviceCode" jdbcType="VARCHAR"/>
|
||||
<result column="last_message_time" property="lastMessageTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="last_message" property="lastMessage" jdbcType="VARCHAR"/>
|
||||
<result column="comment_level" property="commentLevel" jdbcType="INTEGER"/>
|
||||
@@ -36,6 +37,7 @@
|
||||
<result column="guest_name" property="guestName" jdbcType="VARCHAR"/>
|
||||
<result column="ai_session_id" property="aiSessionId" jdbcType="VARCHAR"/>
|
||||
<result column="message_count" property="messageCount" jdbcType="INTEGER"/>
|
||||
<result column="device_code" property="deviceCode" jdbcType="VARCHAR"/>
|
||||
<result column="unread_count" property="unreadCount" jdbcType="INTEGER"/>
|
||||
<result column="last_message_time" property="lastMessageTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="last_message" property="lastMessage" jdbcType="VARCHAR"/>
|
||||
@@ -51,13 +53,13 @@
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
room_id, optsn, workcase_id, room_name, room_type, status, guest_id, guest_name,
|
||||
ai_session_id, message_count, last_message_time, last_message, comment_level, closed_by, closed_time,
|
||||
ai_session_id, message_count, device_code, last_message_time, last_message, comment_level, closed_by, closed_time,
|
||||
creator, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<insert id="insertChatRoom" parameterType="org.xyzh.api.workcase.dto.TbChatRoomDTO">
|
||||
INSERT INTO workcase.tb_chat_room (
|
||||
optsn, room_id, workcase_id, room_name, guest_id, guest_name, creator
|
||||
optsn, room_id, workcase_id, room_name, guest_id, guest_name, device_code, creator
|
||||
<if test="roomType != null">, room_type</if>
|
||||
<if test="status != null">, status</if>
|
||||
<if test="aiSessionId != null">, ai_session_id</if>
|
||||
@@ -65,7 +67,7 @@
|
||||
<if test="lastMessageTime != null">, last_message_time</if>
|
||||
<if test="lastMessage != null">, last_message</if>
|
||||
) VALUES (
|
||||
#{optsn}, #{roomId}, #{workcaseId}, #{roomName}, #{guestId}, #{guestName}, #{creator}
|
||||
#{optsn}, #{roomId}, #{workcaseId}, #{roomName}, #{guestId}, #{guestName}, #{deviceCode}, #{creator}
|
||||
<if test="roomType != null">, #{roomType}</if>
|
||||
<if test="status != null">, #{status}</if>
|
||||
<if test="aiSessionId != null">, #{aiSessionId}</if>
|
||||
@@ -84,6 +86,7 @@
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="aiSessionId != null">ai_session_id = #{aiSessionId},</if>
|
||||
<if test="messageCount != null">message_count = #{messageCount},</if>
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
|
||||
<if test="lastMessageTime != null">last_message_time = #{lastMessageTime},</if>
|
||||
<if test="lastMessage != null">last_message = #{lastMessage},</if>
|
||||
<if test="commentLevel != null">comment_level = #{commentLevel},</if>
|
||||
@@ -124,7 +127,7 @@
|
||||
|
||||
<select id="selectChatRoomPage" resultMap="VOResultMap">
|
||||
SELECT r.room_id, r.optsn, r.workcase_id, r.room_name, r.room_type, r.status,
|
||||
r.guest_id, r.guest_name, r.ai_session_id, r.message_count,
|
||||
r.guest_id, r.guest_name, r.ai_session_id, r.message_count, r.device_code,
|
||||
r.last_message_time, r.last_message, r.comment_level, r.closed_by, r.closed_time,
|
||||
r.creator, r.create_time, r.update_time, r.delete_time, r.deleted,
|
||||
COALESCE(m.unread_count, 0) as unread_count
|
||||
|
||||
Reference in New Issue
Block a user