lrj
6 小时以前 ae3349d2ff53767b5bc9cb30e1bf7e15f9e814ee
backend/src/main/resources/graphql/auth.graphqls
@@ -1,87 +1,78 @@
extend type Query {
    # 这个文件主要是 mutation, 所以 query 可能是空的
    _: Boolean
}
extend type Mutation {
    "Web端用户登录"
    webLogin(input: LoginRequest): LoginResponse
    "微信小程序登录"
    wxLogin(input: WxLoginRequest): WxLoginResponse
    "解密微信手机号(旧版API)"
    webLogin(input: LoginRequest!): LoginResponse
    wxLogin(input: WxLoginRequest!): WxLoginResponse
    decryptPhoneNumber(encryptedData: String!, iv: String!, sessionKey: String!): PhoneDecryptResponse
    "获取微信手机号(新版API)"
    getPhoneNumberByCode(code: String!): PhoneDecryptResponse
}
"登录请求"
input LoginRequest {
    phone: String!
    password: String!
}
"登录响应"
type LoginResponse {
    token: String!
    userInfo: UserInfo!
input WxLoginRequest {
    code: String
    wxOpenid: String
    wxUnionid: String
    phone: String
    loginIp: String
    deviceInfo: String
    phoneAuthorized: Boolean
    sessionKey: String
}
"用户信息"
type LoginResponse {
    token: String
    userInfo: UserInfo
}
type WxLoginResponse {
    token: String
    userInfo: UserInfo
    isNewUser: Boolean
    loginRecordId: Long
    sessionKey: String
}
type UserInfo {
    userId: ID!
    name: String!
    userId: Long
    name: String
    phone: String
    userType: String!
    wxOpenid: String
    userType: String
    employee: EmployeeInfo
    judge: JudgeInfo
    player: PlayerInfo
}
"员工信息"
type EmployeeInfo {
    id: ID!
    name: String!
    roleId: String!
    id: Long
    name: String
    roleId: String
    description: String
}
"评委信息"
type JudgeInfo {
    id: ID!
    name: String!
    id: Long
    name: String
    title: String
    company: String
    description: String
}
"学员信息"
type PlayerInfo {
    id: ID!
    name: String!
    id: Long
    name: String
    phone: String
    description: String
}
"微信登录请求"
input WxLoginRequest {
    code: String
    wxOpenid: String
    wxUnionid: String
    loginIp: String
    deviceInfo: String
    sessionKey: String
    phoneAuthorized: Boolean
    phone: String
}
"微信登录响应"
type WxLoginResponse {
    token: String!
    userInfo: UserInfo!
    isNewUser: Boolean!
    loginRecordId: ID!
    sessionKey: String
}
"手机号解密响应"
type PhoneDecryptResponse {
    phoneNumber: String!
    phoneNumber: String
    purePhoneNumber: String
    countryCode: String
}