瀏覽代碼

add checkout

master
yusmar 3 年之前
父節點
當前提交
c7d952266c
共有 10 個檔案被更改,包括 230 行新增0 行删除
  1. +52
    -0
      api/cart/config/routes.json
  2. +8
    -0
      api/cart/controllers/cart.js
  3. +8
    -0
      api/cart/models/cart.js
  4. +38
    -0
      api/cart/models/cart.settings.json
  5. +8
    -0
      api/cart/services/cart.js
  6. +52
    -0
      api/checkout/config/routes.json
  7. +8
    -0
      api/checkout/controllers/checkout.js
  8. +8
    -0
      api/checkout/models/checkout.js
  9. +40
    -0
      api/checkout/models/checkout.settings.json
  10. +8
    -0
      api/checkout/services/checkout.js

+ 52
- 0
api/cart/config/routes.json 查看文件

@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/carts",
"handler": "cart.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/carts/count",
"handler": "cart.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/carts/:id",
"handler": "cart.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/carts",
"handler": "cart.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/carts/:id",
"handler": "cart.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/carts/:id",
"handler": "cart.delete",
"config": {
"policies": []
}
}
]
}

+ 8
- 0
api/cart/controllers/cart.js 查看文件

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};

+ 8
- 0
api/cart/models/cart.js 查看文件

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};

+ 38
- 0
api/cart/models/cart.settings.json 查看文件

@@ -0,0 +1,38 @@
{
"kind": "collectionType",
"collectionName": "carts",
"info": {
"name": "Cart",
"description": ""
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"product_name": {
"type": "string"
},
"product_price": {
"type": "biginteger"
},
"product_color": {
"type": "string"
},
"product_otr": {
"type": "string"
},
"product_img": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
}
}
}

+ 8
- 0
api/cart/services/cart.js 查看文件

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {};

+ 52
- 0
api/checkout/config/routes.json 查看文件

@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/checkouts",
"handler": "checkout.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/checkouts/count",
"handler": "checkout.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/checkouts/:id",
"handler": "checkout.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/checkouts",
"handler": "checkout.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/checkouts/:id",
"handler": "checkout.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/checkouts/:id",
"handler": "checkout.delete",
"config": {
"policies": []
}
}
]
}

+ 8
- 0
api/checkout/controllers/checkout.js 查看文件

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};

+ 8
- 0
api/checkout/models/checkout.js 查看文件

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};

+ 40
- 0
api/checkout/models/checkout.settings.json 查看文件

@@ -0,0 +1,40 @@
{
"kind": "collectionType",
"collectionName": "checkouts",
"info": {
"name": "Checkout"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"product_name": {
"type": "string"
},
"product_img": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
},
"product_color": {
"type": "string"
},
"product_quantity": {
"type": "string"
},
"product_total": {
"type": "biginteger"
},
"transaction_id": {
"type": "string"
}
}
}

+ 8
- 0
api/checkout/services/checkout.js 查看文件

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {};

Loading…
取消
儲存