Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
成尧 江
ChatRoom2
Commits
5b05db40
Commit
5b05db40
authored
Aug 22, 2025
by
成尧 江
Browse files
completed
parent
1a0c27d8
Changes
44
Show whitespace changes
Inline
Side-by-side
src/lib/prisma.ts
0 → 100644
View file @
5b05db40
import
{
PrismaClient
}
from
"
@prisma/client
"
;
declare
global
{
var
prisma
:
PrismaClient
|
undefined
;
}
export
const
prisma
=
global
.
prisma
||
new
PrismaClient
({
log
:
[
"
query
"
],
});
if
(
process
.
env
.
NODE_ENV
!==
"
production
"
)
global
.
prisma
=
prisma
;
src/types/chat.ts
0 → 100644
View file @
5b05db40
export
interface
Message
{
messageId
:
number
;
// 消息 id
roomId
:
number
;
// 房间 id
sender
:
string
;
// 发送人的 username
content
:
string
;
// 消息内容
time
:
number
;
// 消息发送时间戳
}
export
interface
RoomPreviewInfo
{
roomId
:
number
;
roomName
:
string
;
lastMessage
:
Message
|
null
;
}
tailwind.config.ts
0 → 100644
View file @
5b05db40
import
type
{
Config
}
from
"
tailwindcss
"
;
const
config
:
Config
=
{
theme
:
{
extend
:
{},
},
plugins
:
[],
};
export
default
config
;
tsconfig.json
0 → 100644
View file @
5b05db40
{
"compilerOptions"
:
{
"target"
:
"ES2017"
,
"lib"
:
[
"dom"
,
"dom.iterable"
,
"esnext"
],
"allowJs"
:
true
,
"skipLibCheck"
:
true
,
"strict"
:
true
,
"noEmit"
:
true
,
"esModuleInterop"
:
true
,
"module"
:
"esnext"
,
"moduleResolution"
:
"bundler"
,
"resolveJsonModule"
:
true
,
"isolatedModules"
:
true
,
"jsx"
:
"preserve"
,
"incremental"
:
true
,
"plugins"
:
[
{
"name"
:
"next"
}
],
"paths"
:
{
"@/*"
:
[
"./src/*"
]
}
},
"include"
:
[
"next-env.d.ts"
,
"**/*.ts"
,
"**/*.tsx"
,
".next/types/**/*.ts"
],
"exclude"
:
[
"node_modules"
]
}
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment