Kaynağa Gözat

add collection accessories

master
Yusmardianto 4 yıl önce
ebeveyn
işleme
9835a440c8
13 değiştirilmiş dosya ile 106 ekleme ve 149 silme
  1. +6
    -0
      .env.example
  2. +12
    -12
      api/accessories/config/routes.json
  3. +0
    -0
      api/accessories/controllers/accessories.js
  4. +0
    -0
      api/accessories/models/accessories.js
  5. +85
    -0
      api/accessories/models/accessories.settings.json
  6. +0
    -0
      api/accessories/services/accessories.js
  7. +0
    -24
      api/category/models/category.settings.json
  8. +3
    -11
      api/product/models/product.settings.json
  9. +0
    -52
      api/restaurant/config/routes.json
  10. +0
    -8
      api/restaurant/controllers/restaurant.js
  11. +0
    -8
      api/restaurant/models/restaurant.js
  12. +0
    -26
      api/restaurant/models/restaurant.settings.json
  13. +0
    -8
      api/restaurant/services/restaurant.js

+ 6
- 0
.env.example Dosyayı Görüntüle

@@ -1,2 +1,8 @@
HOST=0.0.0.0
PORT=1337

DATABASE_HOST=172.16.1.8
DATABASE_PORT=3306
DATABASE_NAME=thamrin_ecomm_tbg
DATABASE_USERNAME=root
DATABASE_PASSWORD=Master81

api/category/config/routes.json → api/accessories/config/routes.json Dosyayı Görüntüle

@@ -2,48 +2,48 @@
"routes": [
{
"method": "GET",
"path": "/categories",
"handler": "category.find",
"path": "/accessories",
"handler": "accessories.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/categories/count",
"handler": "category.count",
"path": "/accessories/count",
"handler": "accessories.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/categories/:id",
"handler": "category.findOne",
"path": "/accessories/:id",
"handler": "accessories.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/categories",
"handler": "category.create",
"path": "/accessories",
"handler": "accessories.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/categories/:id",
"handler": "category.update",
"path": "/accessories/:id",
"handler": "accessories.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/categories/:id",
"handler": "category.delete",
"path": "/accessories/:id",
"handler": "accessories.delete",
"config": {
"policies": []
}

api/category/controllers/category.js → api/accessories/controllers/accessories.js Dosyayı Görüntüle


api/category/models/category.js → api/accessories/models/accessories.js Dosyayı Görüntüle


+ 85
- 0
api/accessories/models/accessories.settings.json Dosyayı Görüntüle

@@ -0,0 +1,85 @@
{
"kind": "collectionType",
"collectionName": "accessories",
"info": {
"name": "accessories",
"description": ""
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "richtext"
},
"price": {
"type": "biginteger"
},
"part_code": {
"type": "string"
},
"img": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
},
"category": {
"type": "enumeration",
"enum": [
"YGP",
"Yamalube",
"Helmet",
"Apparel",
"Accessories"
]
},
"stock": {
"type": "string"
},
"img_relate1": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
},
"img_relate2": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
},
"img_relate3": {
"model": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
}
}
}

api/category/services/category.js → api/accessories/services/accessories.js Dosyayı Görüntüle


+ 0
- 24
api/category/models/category.settings.json Dosyayı Görüntüle

@@ -1,24 +0,0 @@
{
"kind": "collectionType",
"collectionName": "categories",
"info": {
"name": "category"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"name": {
"type": "string",
"required": true,
"unique": true
},
"restaurants": {
"collection": "restaurant",
"via": "categories",
"dominant": true
}
}
}

+ 3
- 11
api/product/models/product.settings.json Dosyayı Görüntüle

@@ -42,23 +42,15 @@
"accessories": {
"type": "richtext"
},
"film": {
"collection": "file",
"via": "related",
"allowedTypes": [
"images",
"files",
"videos"
],
"plugin": "upload",
"required": false
},
"business_partner": {
"model": "business-partner",
"via": "products"
},
"stock": {
"type": "biginteger"
},
"film": {
"type": "richtext"
}
}
}

+ 0
- 52
api/restaurant/config/routes.json Dosyayı Görüntüle

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

+ 0
- 8
api/restaurant/controllers/restaurant.js Dosyayı Görüntüle

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

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

module.exports = {};

+ 0
- 8
api/restaurant/models/restaurant.js Dosyayı Görüntüle

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

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

module.exports = {};

+ 0
- 26
api/restaurant/models/restaurant.settings.json Dosyayı Görüntüle

@@ -1,26 +0,0 @@
{
"kind": "collectionType",
"collectionName": "restaurants",
"info": {
"name": "restaurant"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"name": {
"type": "string",
"required": true,
"unique": true
},
"description": {
"type": "richtext"
},
"categories": {
"via": "restaurants",
"collection": "category"
}
}
}

+ 0
- 8
api/restaurant/services/restaurant.js Dosyayı Görüntüle

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

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

module.exports = {};

Yükleniyor…
İptal
Kaydet