lrj
3 天以前 c61d4fe27c97d2ecc907756aa571a4ef14a7b9b6
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
# 轮播图(新闻与推广)GraphQL Schema
 
# 轮播图输入类型
input CarouselInput {
    id: ID
    title: String!
    content: String
    sortOrder: Int
}
 
# 轮播图响应类型
type CarouselResponse {
    id: ID!
    title: String!
    content: String
    sortOrder: Int
    mediaCount: Int
    createTime: String
    updateTime: String
}
 
# 轮播图分页响应类型
type CarouselPageResponse {
    content: [CarouselResponse!]!
    totalElements: Int!
    page: Int!
    size: Int!
}
 
# 扩展查询
extend type Query {
    # 分页查询轮播图
    carousels(page: Int!, size: Int!, title: String): CarouselPageResponse!
    
    # 根据ID查询轮播图
    carousel(id: ID!): CarouselResponse
    
    # 获取播放列表
    carouselPlayList: [CarouselResponse!]!
}
 
# 扩展变更
extend type Mutation {
    # 保存轮播图
    saveCarousel(carousel: CarouselInput!): CarouselResponse!
    
    # 删除轮播图
    deleteCarousel(id: ID!): Boolean!
    
    # 批量更新播放顺序
    updateCarouselSortOrders(sortOrders: [CarouselSortOrderInput!]!): Boolean!
}
 
# 排序输入类型
input CarouselSortOrderInput {
    id: ID!
    sortOrder: Int!
}