Codex Assistant
14 小时以前 915d80766dd8e0157e9b9510b3634ed758eb5c5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 员工相关的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!
}