ziyi.liu 4 lat temu
rodzic
commit
feeab68bfd

+ 12 - 6
graphql-api/src/main/resources/graphqls/goods.graphqls

@@ -1,29 +1,35 @@
 type Goods {
     # ID
     id: ID!
-    # 商品序列
+    # 商品
     serialNo: String!
     # 商品名称
     name: String!
-    # 价
+    # 商品单
     price: BigDecimal!
-    # 商品数量
+    # 商品库存
     itemCount: Int!
-    # 图片
+    # 商品图片
     img: String!
-    # 描述
+    # 商品描述
     description: String
-    # 详情
+    # 商品详情
     detail: String
     # 订单列表
     orders: [Order]
 }
 
 input GoodsInput{
+    # 商品名称
     name: String!
+    # 商品价格
     price: BigDecimal!
+    # 商品库存
     itemCount: Int!
+    # 商品图片
     img: String!
+    # 商品描述
     description: String
+    # 商品详情
     detail: String
 }

+ 3 - 0
graphql-api/src/main/resources/graphqls/mutation.graphqls

@@ -1,5 +1,8 @@
 type Mutation{
+    # 增加商品
     createGoods(input:GoodsInput): Goods!
+    # 创建订单
     createOrder(input:OrderInput): Order!
+    # 新增用户
     createUser(input:UserInput): User!
 }

+ 13 - 0
graphql-api/src/main/resources/graphqls/order.graphqls

@@ -1,18 +1,31 @@
 type Order {
+    # ID
     id: ID!
+    # 订单号
     orderNo: String!
+    # 商品编码
     goodsSerialNo: String!
+    # 用户ID
     userID: ID!
+    # 折扣
     discount: Float!
+    # 原始价格
     originalAmount: BigDecimal!
+    # 折扣价格
     discountAmount: BigDecimal!
+    # 订单创建时间
     createTime: DateTime!
+    # 订单更新时间
     updateTime: DateTime!
+    # 商品对象
     goods: Goods!
+    # 用户对象
     user: User!
 }
 
 input OrderInput{
+    # 商品编码
     goodsSerialNo: String!
+    # 用户ID
     userID: ID!
 }

+ 8 - 0
graphql-api/src/main/resources/graphqls/query.graphqls

@@ -1,12 +1,20 @@
 type Query{
+    # 通过商品编号查询商品信息
     goods(serialNo: String!): Goods!
+    # 查询所有商品列表
     goodsList: [Goods]
 
+    # 通过订单编号查询订单信息
     orderInfo(orderNo: String!): Order!
+    # 查询所有订单列表
     orderList: [Order]
+    # 通过商品编号查询订单列表
     orderQuery(goodsSerialNo: String!): [Order]
 
+    # 通过用户ID查询用户信息
     userInfo(userID: ID!): User
+    # 查询所有用户列表
     userList: [User]
+    # 通过用户名称模糊查询用户信息
     userQuery(username: String!): User
 }

+ 20 - 0
graphql-api/src/main/resources/graphqls/user.graphqls

@@ -1,15 +1,27 @@
 type User {
+    # 用户ID
     id: ID!
+    # 用户名
     username: String!
+    # 密码
     password: String!
+    # 昵称
     nickname: String!
+    # 头像
     img: String!
+    # 性别
     gender: Gender!
+    # 年龄
     age: Int!
+    # 生日
     birthday: Date!
+    # 地址列表
     addresses:[String]
+    # 注册时间
     createTime: DateTime!
+    # 最后操作时间
     updateTime: DateTime!
+    # 订单列表
     orders: [Order]
 }
 
@@ -19,12 +31,20 @@ enum Gender{
 }
 
 input UserInput{
+    # 用户名
     username: String!
+    # 密码
     password: String!
+    # 昵称
     nickname: String!
+    # 头像
     img: String!
+    # 性别
     gender: Gender!
+    # 年龄
     age: Int!
+    # 生日
     birthday: Date!
+    # 地址列表
     addresses:[String]
 }