# 员工相关的GraphQL Schema定义
|
|
# 员工响应类型
|
type EmployeeResponse {
|
id: Long!
|
name: String!
|
phone: String!
|
roleId: String!
|
description: String
|
state: Int!
|
createTime: String
|
updateTime: String
|
}
|
|
# 员工输入类型
|
input EmployeeInput {
|
id: Long
|
name: String!
|
phone: String!
|
password: String
|
roleId: String!
|
description: String
|
}
|
|
# 分页结果类型 - 简化版本,直接使用Spring Data Page对象
|
# Spring Data的Page对象会自动映射到GraphQL
|
|
# 扩展查询类型
|
|
|
type EmployeeReviewApplication {
|
id: Long!
|
playerName: String
|
projectName: String
|
activityName: String
|
state: Int
|
stateText: String
|
stateType: String
|
applyTime: String
|
}
|
|
type EmployeeReviewPage {
|
content: [EmployeeReviewApplication!]!
|
totalElements: Int!
|
page: Int!
|
size: Int!
|
}
|
|
type EmployeeReviewStats {
|
pendingCount: Int!
|
approvedCount: Int!
|
rejectedCount: Int!
|
}
|
|
extend type Query {
|
# 获取所有员工列表
|
employees: [EmployeeResponse!]!
|
|
# 根据名称搜索员工
|
employeesByName(name: String): [EmployeeResponse!]!
|
|
# 根据ID获取员工详情
|
employee(id: Long!): EmployeeResponse
|
|
# 员工审核统计
|
employeeReviewStats(keyword: String): EmployeeReviewStats!
|
|
# 员工审核列表
|
employeeReviewApplications(keyword: String, state: Int, page: Int, size: Int): EmployeeReviewPage!
|
}
|
|
# 扩展变更类型
|
extend type Mutation {
|
# 保存员工(新增或更新)
|
saveEmployee(input: EmployeeInput!): EmployeeResponse!
|
|
# 删除员工
|
deleteEmployee(id: Long!): Boolean!
|
}
|