Skip to content

Commit

Permalink
基本聊天功能
Browse files Browse the repository at this point in the history
  • Loading branch information
tangllty committed Aug 6, 2023
1 parent 0a928a8 commit 20f56e7
Show file tree
Hide file tree
Showing 27 changed files with 2,423 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/api/app/chat/chat-list/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import request from '@/utils/request'
import { AppChatListQuery, AppChatListForm } from './types'

// 查询聊天列列表
export const listAppChatList = (queryParams: AppChatListQuery) => {
return request({
url: '/app/chat/chat-list/list',
method: 'get',
params: queryParams
})
}

// 查询当前用户聊天列表列表
export const listAppChatListAll = () => {
return request({
url: '/app/chat/chat-list/list-all',
method: 'get'
})
}

// 查询聊天列信息
export const getAppChatList = (chatListId: number) => {
return request({
url: '/app/chat/chat-list/' + chatListId,
method: 'get'
})
}

// 添加聊天列信息
export const addAppChatList = (data: AppChatListForm) => {
return request({
url: '/app/chat/chat-list',
method: 'post',
data
})
}

// 修改聊天列信息
export const editAppChatList = (data: AppChatListForm) => {
return request({
url: '/app/chat/chat-list',
method: 'put',
data
})
}

// 删除聊天列信息
export const deleteAppChatList = (chatListId: number) => {
return request({
url: '/app/chat/chat-list/' + chatListId,
method: 'delete'
})
}

// 批量删除聊天列信息
export const deleteAppChatLists = (chatListIds: number[]) => {
return request({
url: '/app/chat/chat-list',
method: 'delete',
data: chatListIds
})
}
45 changes: 45 additions & 0 deletions src/api/app/chat/chat-list/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 聊天列对象
export interface AppChatList {
chatListId: number
userId: number
friendId: number
username: string
nickname: string
name: string
avatar: string
message: string
unreadCount: number
time: string
stickFlag: string
displayFlag: string
muteFlag: string
createBy: string
updateBy: string
remark: string
}

// 聊天列表单对象
export interface AppChatListForm {
chatListId: number
userId: number
friendId: number
stickFlag: string
displayFlag: string
muteFlag: string
createBy: string
updateBy: string
remark: string
}

// 聊天列查询参数
export interface AppChatListQuery extends PageQuery {
chatListId: number
userId: number
friendId: number
stickFlag: string
displayFlag: string
muteFlag: string
createBy: string
updateBy: string
remark: string
}
80 changes: 80 additions & 0 deletions src/api/app/chat/friend-apply/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import request from '@/utils/request'
import { AppFriendApplyQuery, AppFriendApplyForm } from './types'
import { SysUserFuzzyQuery } from '@/api/system/user/types'

// 查询用户好友申请列表
export const listAppFriendApply = (queryParams: AppFriendApplyQuery) => {
return request({
url: '/app/chat/friend-apply/list',
method: 'get',
params: queryParams
})
}

// 模糊查询用户列表
export const listUserFuzzy = (queryParams: SysUserFuzzyQuery) => {
return request({
url: '/app/chat/friend-apply/list-fuzzy',
method: 'get',
params: queryParams
})
}

// 查询用户好友申请信息
export const getAppFriendApply = (applyId: number) => {
return request({
url: '/app/chat/friend-apply/' + applyId,
method: 'get'
})
}

// 添加用户好友申请信息
export const addAppFriendApply = (data: AppFriendApplyForm) => {
return request({
url: '/app/chat/friend-apply',
method: 'post',
data
})
}

// 修改用户好友申请信息
export const editAppFriendApply = (data: AppFriendApplyForm) => {
return request({
url: '/app/chat/friend-apply',
method: 'put',
data
})
}

// 同意好友申请
export const acceptAppFriendApply = (uniqueId: number) => {
return request({
url: '/app/chat/friend-apply/accept/' + uniqueId,
method: 'put'
})
}

// 拒绝好友申请
export const declineAppFriendApply = (uniqueId: number) => {
return request({
url: '/app/chat/friend-apply/decline/' + uniqueId,
method: 'put'
})
}

// 删除用户好友申请信息
export const deleteAppFriendApply = (applyId: number) => {
return request({
url: '/app/chat/friend-apply/' + applyId,
method: 'delete'
})
}

// 批量删除用户好友申请信息
export const deleteAppFriendApplys = (applyIds: number[]) => {
return request({
url: '/app/chat/friend-apply',
method: 'delete',
data: applyIds
})
}
50 changes: 50 additions & 0 deletions src/api/app/chat/friend-apply/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 用户好友申请对象
export interface AppFriendApply {
applyId: number
userId: number
friendId: number
requestorId: number
uniqueId: bigint
username: string
nickname: string
reason: string
applyType: string
status: string
createBy: string
updateBy: string
remark: string
}

// 用户好友申请表单对象
export interface AppFriendApplyForm {
applyId: number
userId: number
friendId: number
requestorId: number
uniqueId: bigint
reason: string
applyType: string
status: string
createBy: string
updateBy: string
remark: string
username: string
nickname: string
email: string
phone: string
}

// 用户好友申请查询参数
export interface AppFriendApplyQuery extends PageQuery {
applyId: number
userId: number
friendId: number
requestorId: number
uniqueId: bigint
reason: string
applyType: string
status: string
createBy: string
updateBy: string
remark: string
}
54 changes: 54 additions & 0 deletions src/api/app/chat/friend/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import request from '@/utils/request'
import { AppFriendQuery, AppFriendForm } from './types'

// 查询用户好友列表
export const listAppFriend = (queryParams: AppFriendQuery) => {
return request({
url: '/app/chat/friend/list',
method: 'get',
params: queryParams
})
}

// 查询用户好友信息
export const getAppFriend = (userFriendId: number) => {
return request({
url: '/app/chat/friend/' + userFriendId,
method: 'get'
})
}

// 添加用户好友信息
export const addAppFriend = (data: AppFriendForm) => {
return request({
url: '/app/chat/friend',
method: 'post',
data
})
}

// 修改用户好友信息
export const editAppFriend = (data: AppFriendForm) => {
return request({
url: '/app/chat/friend',
method: 'put',
data
})
}

// 删除用户好友信息
export const deleteAppFriend = (userFriendId: number) => {
return request({
url: '/app/chat/friend/' + userFriendId,
method: 'delete'
})
}

// 批量删除用户好友信息
export const deleteAppFriends = (userFriendIds: number[]) => {
return request({
url: '/app/chat/friend',
method: 'delete',
data: userFriendIds
})
}
34 changes: 34 additions & 0 deletions src/api/app/chat/friend/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 用户好友对象
export interface AppFriend {
userFriendId: number
userId: number
friendId: number
unionId: string
username: string
nickname: string
createBy: string
updateBy: string
remark: string
}

// 用户好友表单对象
export interface AppFriendForm {
userFriendId: number
userId: number
friendId: number
unionId: string
createBy: string
updateBy: string
remark: string
}

// 用户好友查询参数
export interface AppFriendQuery extends PageQuery {
userFriendId: number
userId: number
friendId: number
unionId: string
createBy: string
updateBy: string
remark: string
}
54 changes: 54 additions & 0 deletions src/api/app/chat/message/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import request from '@/utils/request'
import { AppChatMessageQuery, AppChatMessageForm } from './types'

// 查询聊天消息列表
export const listAppChatMessage = (queryParams: AppChatMessageQuery) => {
return request({
url: '/app/chat/message/list',
method: 'get',
params: queryParams
})
}

// 查询聊天消息信息
export const getAppChatMessage = (messageId: number) => {
return request({
url: '/app/chat/message/' + messageId,
method: 'get'
})
}

// 添加聊天消息信息
export const addAppChatMessage = (data: AppChatMessageForm) => {
return request({
url: '/app/chat/message',
method: 'post',
data
})
}

// 修改聊天消息信息
export const editAppChatMessage = (data: AppChatMessageForm) => {
return request({
url: '/app/chat/message',
method: 'put',
data
})
}

// 删除聊天消息信息
export const deleteAppChatMessage = (messageId: number) => {
return request({
url: '/app/chat/message/' + messageId,
method: 'delete'
})
}

// 批量删除聊天消息信息
export const deleteAppChatMessages = (messageIds: number[]) => {
return request({
url: '/app/chat/message',
method: 'delete',
data: messageIds
})
}
Loading

0 comments on commit 20f56e7

Please sign in to comment.