fix(shell): satori: server: fix routes

This commit is contained in:
Il Harper 2024-03-08 19:43:47 +08:00
parent f4d5939565
commit 4af8985686
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
4 changed files with 7 additions and 6 deletions

View File

@ -52,11 +52,11 @@ export const apply = async (ctx: ChronocatContext) => {
register('guild.member.list', buildGuildMemberList(ctx))
register('guild.member.kick', buildGuildMemberKick(ctx))
register('message.create', buildMessageCreate(ctx))
register('chronocat.internal.message.create.forward', buildMessageCreate(ctx))
register('message.get', buildMessageGet(ctx))
register('message.delete', buildMessageDelete(ctx))
register('message.list', buildMessageList(ctx))
register('login.get', buildLoginGet(ctx))
register('chronocat.internal.message.create.forward', buildMessageCreate(ctx))
register('user.get', buildUserGet(ctx))
register('friend.list', buildFriendList(ctx))
register('friend.approve', buildFriendApprove(ctx))

View File

@ -10,8 +10,9 @@ export const guildMemberGet = async ({
}: RouteContext) => {
const payload = (await json()) as GuildMemberGetPayload
const validateResult =
await cctx.chronocat.validate('ChannelMutePayload')(payload)
const validateResult = await cctx.chronocat.validate('GuildMemberGetPayload')(
payload,
)
if (validateResult) {
const err = `解析 ${path} 请求时出现问题,来自 ${req.socket.remoteAddress}${validateResult}`

View File

@ -11,7 +11,7 @@ export const guildRemove = async ({
const payload = (await json()) as GuildRemovePayload
const validateResult =
await cctx.chronocat.validate('ChannelMutePayload')(payload)
await cctx.chronocat.validate('GuildRemovePayload')(payload)
if (validateResult) {
const err = `解析 ${path} 请求时出现问题,来自 ${req.socket.remoteAddress}${validateResult}`

View File

@ -12,7 +12,7 @@ import { guildMemberGet } from './guild/member/get'
import { guildMemberKick } from './guild/member/kick'
import { guildMemberList } from './guild/member/list'
import { guildRemove } from './guild/remove'
// import { loginGet } from './login/get'
import { loginGet } from './login/get'
import { messageCreate } from './message/create'
import { messageDelete } from './message/delete'
import { messageGet } from './message/get'
@ -45,7 +45,7 @@ const routesIntl = {
'guild.role.create': notImplemented,
'guild.role.update': notImplemented,
'guild.role.delete': notImplemented,
// 'login.get': loginGet,
'login.get': loginGet,
'message.create': messageCreate,
'message.get': messageGet,
'message.delete': messageDelete,