update:add ci cd files ==> do not edit those file
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60c069fb41cf5fb1b0b32b2d"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "زنجیره تامین خطوط لوله نفت، گاز و آب",
|
||||
"description": "<p>یکی از مهمترین فعالیت های شرکت اُریس اوکسین تأمین لوله های فولادی جهت خطوط انتقال نفت و گاز متناسب با محیط های ترش و شیرین به صورت بدون درز و درزدار می باشد...</p>"
|
||||
},
|
||||
"en": {
|
||||
"title": "SUPPLY CHAIN OF OIL, GAS AND WATER PIPELINES",
|
||||
"description": "<p>One of the most important activities of Oris Oxin Company is to supply seamed and seamless steel pipes for oil and gas transmission lines proportionate to sour and sweet mediums...</p>"
|
||||
}
|
||||
},
|
||||
"cover": "activity_1670110870931.jpg",
|
||||
"thumb": "activityThumb_1671972749687.jpg",
|
||||
"sections": [],
|
||||
"images": [],
|
||||
"videos": [],
|
||||
"created_at": {
|
||||
"$date": "2021-12-03T13:40:32.689Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-12-25T13:32:29.708Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"pipe_module": true,
|
||||
"sheet_module": false
|
||||
}]
|
||||
@@ -0,0 +1,66 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60c069fb41cf5fb1b0b32b2d"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "پتروشیمی",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Petrochemical",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-06-09T08:52:59.271Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-06-09T08:52:59.271Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c06a9a41cf5fb1b0b32b30"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "یونیت های فرآورش و نمک زدایی",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Processing and desalination units",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-06-09T08:55:38.484Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-04T14:32:14.788Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "617faaec8a9a1a5636ae7b7e"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "پروژه گوره به جاسک",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Gore-Jask pipeline",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-11-01T04:53:00.609Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-06-28T06:18:18.326Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "638be24fd940b41bafbd01b5"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نماینده A"
|
||||
},
|
||||
"en": {
|
||||
"title": "Agent A"
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2022-12-03T23:57:03.214Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:57:03.214Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,102 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "6166b9e8650ad9bf729af0c9"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": ""
|
||||
},
|
||||
"en": {
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"showInFa": true,
|
||||
"showInEn": true,
|
||||
"file": "orisoxin_catalog_1635772447318_SKID MOUNTED final1 (1).pdf",
|
||||
"cover": "orisoxsin_cover_1660110880628.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-10-13T10:50:16.644Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-08-10T05:54:40.754Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "629f2de399018f59cfeab008"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "کاتالوگ 3لتی اریس اوکسین"
|
||||
},
|
||||
"en": {
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"showInFa": true,
|
||||
"showInEn": true,
|
||||
"file": "orisoxin_catalog_1654599139144_OXin.pdf",
|
||||
"cover": "orisoxin_catalog_cover_1654599139145.jpg",
|
||||
"created_at": {
|
||||
"$date": "2022-06-07T10:52:19.200Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-06-07T10:52:19.200Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "62c276bc6662dd01ad9c83cb"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "کاتالوگ کارخانه Wonjin _ مواد نسوز"
|
||||
},
|
||||
"en": {
|
||||
"title": "ٌٌWonjin company refactory materials"
|
||||
}
|
||||
},
|
||||
"showInFa": true,
|
||||
"showInEn": true,
|
||||
"file": "orisoxin_catalog_1656911548348_WONJIN CATALOGUE_IFB.pdf",
|
||||
"cover": "orisoxin_catalog_cover_1656911548349.jpg",
|
||||
"created_at": {
|
||||
"$date": "2022-07-04T05:12:28.429Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-11T11:51:20.100Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"category": {
|
||||
"$oid": "638be24fd940b41bafbd01b5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "65ad0965097ed0a3810e78be"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "پرزنتیشن اریس اوکسین "
|
||||
},
|
||||
"en": {
|
||||
"title": "Oris Oxin Presentation "
|
||||
}
|
||||
},
|
||||
"showInFa": true,
|
||||
"showInEn": true,
|
||||
"category": {
|
||||
"$oid": "638be24fd940b41bafbd01b5"
|
||||
},
|
||||
"file": "orisoxin_catalog_1705838949594_ORIS OXIN presentation ÙÙØ§ÛÛ1402.pdf",
|
||||
"cover": "orisoxin_catalog_cover_1705838949595.jpg",
|
||||
"created_at": {
|
||||
"$date": "2024-01-21T12:09:09.894Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2024-01-21T12:09:09.894Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,306 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "6154d1d64b787cbf8b9bd4c4"
|
||||
},
|
||||
"locale": "fa",
|
||||
"read": true,
|
||||
"name": "Test test",
|
||||
"email": "test@mail.com",
|
||||
"subject": "test",
|
||||
"message": "ما از سال 2001 تا 2016 بسیاری از جوایز کارخانه را به دست آوردیم و بسیاری از گواهینامه ها را دریافت کردیم",
|
||||
"created_at": {
|
||||
"$date": "2021-09-29T20:51:34.807Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T04:13:51.006Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "61e6b5927978228a32d8bd26"
|
||||
},
|
||||
"locale": "fa",
|
||||
"read": true,
|
||||
"name": "سحر",
|
||||
"email": "sahar_eilkhani@yahoo.com",
|
||||
"subject": "تست پیام",
|
||||
"message": "تست ",
|
||||
"created_at": {
|
||||
"$date": "2022-01-18T12:41:54.020Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T04:14:08.366Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "621f501faaeec4629b7de3bf"
|
||||
},
|
||||
"locale": "fa",
|
||||
"read": true,
|
||||
"name": "Dirk Van Landeghem",
|
||||
"email": "dirk.vanlandeghem@arcelormittal.com",
|
||||
"subject": "plates",
|
||||
"message": "Dear Sirs,\n\nPlse send me the contact person in your export depatment. Thanks.",
|
||||
"created_at": {
|
||||
"$date": "2022-03-02T11:08:15.530Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T04:14:18.967Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6263bee20539489837ab89ba"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Mary M.",
|
||||
"email": "adi@ndmails.com",
|
||||
"subject": "Design Work",
|
||||
"message": "Just wanted to ask if you would be interested in getting external help with graphic design? We do all design work like banners, advertisements, photo edits, logos, flyers, etc. for a fixed monthly fee. \n\nWe don't charge for each task. What kind of work do you need on a regular basis? Let me know and I'll share my portfolio with you.",
|
||||
"created_at": {
|
||||
"$date": "2022-04-23T08:54:58.305Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T04:14:34.377Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6263fad50539489837ab8aac"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Abdulla Azar",
|
||||
"email": "abdulla_azar@hotmail.com",
|
||||
"subject": "FRIENDLY REMARK ",
|
||||
"message": "Dear Nima, \nit is always pleasure to see your advancement , kindly in your first page in the web below message is printed\n\nPipelines, Petrochemical Industry, Drilling Industry\nFOUNDED IN 1387\n\nKindly have it corrected ( FOUNDED 1387 Iranian Calendar / 1998 Christian calendar) \n\n1387 creates a message that you are in this business almost 650 years\n\nI love to see your advancements",
|
||||
"created_at": {
|
||||
"$date": "2022-04-23T13:10:45.386Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T04:13:06.797Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6263fad50539489837ab8aae"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Abdulla Azar",
|
||||
"email": "abdulla_azar@hotmail.com",
|
||||
"subject": "FRIENDLY REMARK ",
|
||||
"message": "Dear Nima, \nit is always pleasure to see your advancement , kindly in your first page in the web below message is printed\n\nPipelines, Petrochemical Industry, Drilling Industry\nFOUNDED IN 1387\n\nKindly have it corrected ( FOUNDED 1387 Iranian Calendar / 1998 Christian calendar) \n\n1387 creates a message that you are in this business almost 650 years\n\nI love to see your advancements",
|
||||
"created_at": {
|
||||
"$date": "2022-04-23T13:10:45.400Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T05:14:58.839Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6263fad50539489837ab8ab0"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Abdulla Azar",
|
||||
"email": "abdulla_azar@hotmail.com",
|
||||
"subject": "FRIENDLY REMARK ",
|
||||
"message": "Dear Nima, \nit is always pleasure to see your advancement , kindly in your first page in the web below message is printed\n\nPipelines, Petrochemical Industry, Drilling Industry\nFOUNDED IN 1387\n\nKindly have it corrected ( FOUNDED 1387 Iranian Calendar / 1998 Christian calendar) \n\n1387 creates a message that you are in this business almost 650 years\n\nI love to see your advancements",
|
||||
"created_at": {
|
||||
"$date": "2022-04-23T13:10:45.404Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T05:15:12.379Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6263fad50539489837ab8ab2"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Abdulla Azar",
|
||||
"email": "abdulla_azar@hotmail.com",
|
||||
"subject": "FRIENDLY REMARK ",
|
||||
"message": "Dear Nima, \nit is always pleasure to see your advancement , kindly in your first page in the web below message is printed\n\nPipelines, Petrochemical Industry, Drilling Industry\nFOUNDED IN 1387\n\nKindly have it corrected ( FOUNDED 1387 Iranian Calendar / 1998 Christian calendar) \n\n1387 creates a message that you are in this business almost 650 years\n\nI love to see your advancements",
|
||||
"created_at": {
|
||||
"$date": "2022-04-23T13:10:45.407Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-05-28T05:15:16.445Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "62ff4f9f3baf2d01b4836ae5"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Cathy Wu",
|
||||
"email": "cathy@permanentsteel.com",
|
||||
"subject": "steel pipes supplier",
|
||||
"message": "Hi,this is Cathy Wu from Permanent Steel Manufacturing Co.,Ltd(PMC),we are a 28-years joint venturecompany with rich experience in steel manufacturing and export.Committed to become one-stop Chinese steel products supplier for worldwide clients,besides main seamless and welded steel pipe factories,we also invested some related factories,including fittings mills (valve/??flange/elbow/tee/reducer/caps/bend etc.),structure steel mills, anti-corrosion,insulation mills,etc.Any interest please not hesitate to email/call/whatsapp me,regards.",
|
||||
"created_at": {
|
||||
"$date": "2022-08-19T08:53:51.899Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-08-20T11:06:04.394Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "62ff4fa06662dd01ad9d5df5"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Cathy Wu",
|
||||
"email": "cathy@permanentsteel.com",
|
||||
"subject": "steel pipes supplier",
|
||||
"message": "Hi,this is Cathy Wu from Permanent Steel Manufacturing Co.,Ltd(PMC),we are a 28-years joint venturecompany with rich experience in steel manufacturing and export.Committed to become one-stop Chinese steel products supplier for worldwide clients,besides main seamless and welded steel pipe factories,we also invested some related factories,including fittings mills (valve/??flange/elbow/tee/reducer/caps/bend etc.),structure steel mills, anti-corrosion,insulation mills,etc.Any interest please not hesitate to email/call/whatsapp me,regards.",
|
||||
"created_at": {
|
||||
"$date": "2022-08-19T08:55:36.061Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-08-20T11:07:21.837Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "62ff4fa06662dd01ad9d5df7"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Cathy Wu",
|
||||
"email": "cathy@permanentsteel.com",
|
||||
"subject": "steel pipes supplier",
|
||||
"message": "Hi,this is Cathy Wu from Permanent Steel Manufacturing Co.,Ltd(PMC),we are a 28-years joint venturecompany with rich experience in steel manufacturing and export.Committed to become one-stop Chinese steel products supplier for worldwide clients,besides main seamless and welded steel pipe factories,we also invested some related factories,including fittings mills (valve/??flange/elbow/tee/reducer/caps/bend etc.),structure steel mills, anti-corrosion,insulation mills,etc.Any interest please not hesitate to email/call/whatsapp me,regards.",
|
||||
"created_at": {
|
||||
"$date": "2022-08-19T08:55:36.064Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-08-20T11:07:25.875Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "62ff4fa06662dd01ad9d5df9"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "Cathy Wu",
|
||||
"email": "cathy@permanentsteel.com",
|
||||
"subject": "steel pipes supplier",
|
||||
"message": "Hi,this is Cathy Wu from Permanent Steel Manufacturing Co.,Ltd(PMC),we are a 28-years joint venturecompany with rich experience in steel manufacturing and export.Committed to become one-stop Chinese steel products supplier for worldwide clients,besides main seamless and welded steel pipe factories,we also invested some related factories,including fittings mills (valve/??flange/elbow/tee/reducer/caps/bend etc.),structure steel mills, anti-corrosion,insulation mills,etc.Any interest please not hesitate to email/call/whatsapp me,regards.",
|
||||
"created_at": {
|
||||
"$date": "2022-08-19T08:55:36.067Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-08-20T11:07:29.721Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "63038f5c1f8bb92efb8812b8"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "jimmy",
|
||||
"email": "jimmy.yang@sunrisesgroup.com",
|
||||
"subject": "Glass jars and closures",
|
||||
"message": "Hi, I hope you are doing well! My name is Jimmy, and I work at Sunrise glass jar. We are a factory with more than 20 years of experience in producing glass jars and closures. We have a wide range of products available, including round, square, and hexagonal shapes, in various sizes and colors. If you are interested, please feel free to contact us for more information and samples. We look forward to hearing from you soon.",
|
||||
"created_at": {
|
||||
"$date": "2022-11-08T07:12:44.089Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-11-08T07:12:44.089Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "63038f5c1f8bb92efb8812ba"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "jimmy",
|
||||
"email": "jimmy.yang@sunrisesgroup.com",
|
||||
"subject": "Glass jars and closures",
|
||||
"message": "Hi, I hope you are doing well! My name is Jimmy, and I work at Sunrise glass jar. We are a factory with more than 20 years of experience in producing glass jars and closures. We have a wide range of products available, including round, square, and hexagonal shapes, in various sizes and colors. If you are interested, please feel free to contact us for more information and samples. We look forward to hearing from you soon.",
|
||||
"created_at": {
|
||||
"$date": "2022-11-08T07:12:44.090Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-11-08T07:12:44.090Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "63038f5c1f8bb92efb8812bc"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "jimmy",
|
||||
"email": "jimmy.yang@sunrisesgroup.com",
|
||||
"subject": "Glass jars and closures",
|
||||
"message": "Hi, I hope you are doing well! My name is Jimmy, and I work at Sunrise glass jar. We are a factory with more than 20 years of experience in producing glass jars and closures. We have a wide range of products available, including round, square, and hexagonal shapes, in various sizes and colors. If you are interested, please feel free to contact us for more information and samples. We look forward to hearing from you soon.",
|
||||
"created_at": {
|
||||
"$date": "2022-11-08T07:12:44.091Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-11-08T07:12:44.091Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "63038f5c1f8bb92efb8812be"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "jimmy",
|
||||
"email": "jimmy.yang@sunrisesgroup.com",
|
||||
"subject": "Glass jars and closures",
|
||||
"message": "Hi, I hope you are doing well! My name is Jimmy, and I work at Sunrise glass jar. We are a factory with more than 20 years of experience in producing glass jars and closures. We have a wide range of products available, including round, square, and hexagonal shapes, in various sizes and colors. If you are interested, please feel free to contact us for more information and samples. We look forward to hearing from you soon.",
|
||||
"created_at": {
|
||||
"$date": "2022-11-08T07:12:44.092Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-11-08T07:12:44.092Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "63038f5c1f8bb92efb8812c0"
|
||||
},
|
||||
"locale": "en",
|
||||
"read": true,
|
||||
"name": "jimmy",
|
||||
"email": "jimmy.yang@sunrisesgroup.com",
|
||||
"subject": "Glass jars and closures",
|
||||
"message": "Hi, I hope you are doing well! My name is Jimmy, and I work at Sunrise glass jar. We are a factory with more than 20 years of experience in producing glass jars and closures. We have a wide range of products available, including round, square, and hexagonal shapes, in various sizes and colors. If you are interested, please feel free to contact us for more information and samples. We look forward to hearing from you soon.",
|
||||
"created_at": {
|
||||
"$date": "2022-11-08T07:12:44.093Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-11-08T07:12:44.093Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,75 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60c604af3dc3e9d231fd016f"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "پتروشیمی جم",
|
||||
"position": "سهامی خاص",
|
||||
"comment": "احتراما بازگشت به نامه شماره ox-ad-97-08-851 مورخ ۹۷/۰۸/ ۰۹۷ ضمن تشکر و تقدیر از خدمات شرکت اریس اوکسین بدین وسیله مراتب رضایت خود را از عملکرد آن شرکت محترم در خصوص تقاضای ۹۷۰۷۱۱ جهت تامین ۱۰۰ برگ پلیت گرید A516Gr.70 اعلام میدارد."
|
||||
},
|
||||
"en": {
|
||||
"name": "JPC",
|
||||
"position": "CEO",
|
||||
"comment": "Regards, return to letter number ox-ad-97-08-851 dated 08/09/97, while thanking and appreciating the services of Eris Oxen. Hereby, it expresses its satisfaction with the performance of that esteemed company regarding the demand of 970711 for supplying 100 sheets of A516Gr.70 plate."
|
||||
}
|
||||
},
|
||||
"image": "customer_1625651866973.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-06-13T13:14:23.589Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-07-07T09:57:47.057Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60e57bba793444cf51b25792"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "ماشین سازی اراک",
|
||||
"position": "سهامی عام",
|
||||
"comment": "احتراما\" بازگشت به نامه شماره 956-04-98-OX-AD مورخ 98/4/19 بدينوسيله اين شركت رضايت خود را از همكاري به عمل آمده در تأمين ورقهاي مورد نياز با جنس S 355GR+N مربوط به ورقهاي پايه هاي پروژه مخزن كروي كاويان اعلام مي دارد. \nاميد است اين روند در پروژه هاي آتي ادامه يابد و منجر به انجام هر چه بهترپروژه هاي ملي گردد."
|
||||
},
|
||||
"en": {
|
||||
"name": "MSA",
|
||||
"position": "CMO",
|
||||
"comment": "Sincerely, Return to Letter No. 956-04-98-OX-AD dated 19/4/98. Hereby, this company expresses its satisfaction with the cooperation made in supplying the required sheets with material S 355GR + N related to the base sheets of the tank project. Spherical Kavian announces."
|
||||
}
|
||||
},
|
||||
"image": "customer_1625652154603.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-07-07T10:02:34.633Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-07-07T10:02:34.633Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60e57e6c793444cf51b25793"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "فاتح صنعت کیمیا",
|
||||
"position": "سهامی خاص",
|
||||
"comment": "بدینوسیله این شرکت رضایت خود را از عملکرد شرکت اریس اوکسین در تحویل و تولید ۳۴،۶۱۹ کیلوگرم ورق A516 Gr70N مربوط به پیش فاکتور شماره OX-PI-A-9804 -147 اعلام می دارد.\n"
|
||||
},
|
||||
"en": {
|
||||
"name": "FatehSanat Kimia",
|
||||
"position": "CEO",
|
||||
"comment": "Hereby, the company expresses its satisfaction with the performance of Eris Oxin Company in the delivery and production of 34,619 kg of A516 Gr70N sheet related to the pre-invoice number OX-PI-A-9804 -147.\n"
|
||||
}
|
||||
},
|
||||
"image": "customer_1625652844926.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-07-07T10:14:04.957Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-07-07T10:14:04.957Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,12 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60e6e00fc49a11bff9915d3a"
|
||||
},
|
||||
"name": "default"
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60b3a96ac77488f47875431d"
|
||||
},
|
||||
"name": "default"
|
||||
}]
|
||||
@@ -0,0 +1,520 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "6155a587ff19a48ba7b81504"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "6155a4fdff19a48ba7b814e3"
|
||||
},
|
||||
"image": "gallery_1634121369862.jpg",
|
||||
"thumb": "thumb_gallery_1634121369862.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:54:47.376Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:36:09.934Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a598ff19a48ba7b8150b"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "6155a4fdff19a48ba7b814e3"
|
||||
},
|
||||
"image": "gallery_1634121364507.jpg",
|
||||
"thumb": "thumb_gallery_1634121364507.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:55:04.025Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:36:04.583Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a5a3ff19a48ba7b81511"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "6155a4fdff19a48ba7b814e3"
|
||||
},
|
||||
"image": "gallery_1634121358419.jpg",
|
||||
"thumb": "thumb_gallery_1634121358419.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:55:15.857Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:35:58.493Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a5afff19a48ba7b81517"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "6155a4fdff19a48ba7b814e3"
|
||||
},
|
||||
"image": "gallery_1634121349333.jpg",
|
||||
"thumb": "thumb_gallery_1634121349333.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:55:27.738Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:35:49.401Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a5bfff19a48ba7b8151d"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "6155a4fdff19a48ba7b814e3"
|
||||
},
|
||||
"image": "gallery_1634121344143.jpg",
|
||||
"thumb": "thumb_gallery_1634121344143.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:55:43.687Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:35:44.210Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a62aff19a48ba7b8155c"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121287578.jpg",
|
||||
"thumb": "thumb_gallery_1634121287578.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:57:30.886Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:47.646Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a636ff19a48ba7b81560"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121280502.jpg",
|
||||
"thumb": "thumb_gallery_1634121280502.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:57:42.582Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:40.567Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a649ff19a48ba7b81568"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121274782.jpg",
|
||||
"thumb": "thumb_gallery_1634121274782.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:58:01.116Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:34.858Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a656ff19a48ba7b8156e"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121270262.jpg",
|
||||
"thumb": "thumb_gallery_1634121270262.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:58:14.350Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:30.330Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a662ff19a48ba7b81574"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121265557.jpg",
|
||||
"thumb": "thumb_gallery_1634121265557.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:58:26.469Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:25.629Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a66eff19a48ba7b8157a"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121261448.jpg",
|
||||
"thumb": "thumb_gallery_1634121261448.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:58:38.535Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:21.516Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a67aff19a48ba7b8157e"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"image": "gallery_1634121252667.jpg",
|
||||
"thumb": "thumb_gallery_1634121252667.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:58:50.457Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:34:12.738Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a69aff19a48ba7b81584"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121173923.jpg",
|
||||
"thumb": "thumb_gallery_1634121173923.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:59:22.718Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:53.999Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a6a7ff19a48ba7b8158a"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121168166.jpg",
|
||||
"thumb": "thumb_gallery_1634121168166.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:59:35.308Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:48.191Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a6b3ff19a48ba7b81590"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121162220.jpg",
|
||||
"thumb": "thumb_gallery_1634121162220.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:59:47.116Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:42.246Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a6c6ff19a48ba7b8159f"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121157684.jpg",
|
||||
"thumb": "thumb_gallery_1634121157684.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:00:06.673Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:37.708Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a6d2ff19a48ba7b815a5"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121142223.jpg",
|
||||
"thumb": "thumb_gallery_1634121142223.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:00:18.590Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:22.300Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a732ff19a48ba7b815b5"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121135157.jpg",
|
||||
"thumb": "thumb_gallery_1634121135157.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:01:54.515Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:15.229Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a747ff19a48ba7b815c4"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121131034.jpg",
|
||||
"thumb": "thumb_gallery_1634121131034.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:02:15.700Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:11.105Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a757ff19a48ba7b815ca"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"caption": ""
|
||||
},
|
||||
"en": {
|
||||
"caption": ""
|
||||
}
|
||||
},
|
||||
"noCategory": false,
|
||||
"category": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"image": "gallery_1634121124929.jpg",
|
||||
"thumb": "thumb_gallery_1634121124929.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:02:31.660Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-13T10:32:05.004Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,308 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60c0611641cf5fb1b0b32b08"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال ۹۵",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Oil,Gas and petrochemical Exhibitions in 1395",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-06-09T06:35:02.285Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-05T06:33:51.316Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730366647.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730366647.jpg",
|
||||
"index": 6,
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c0626941cf5fb1b0b32b0c"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال۹۳",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Oil,Gas and petrochemical Exhibitions in 1393",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-06-09T06:40:41.197Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:54:07.290Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730422777.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730422777.jpg",
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"index": 2
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c062ed41cf5fb1b0b32b10"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال ۹۲",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Oil,Gas and petrochemical Exhibitions in 1392",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-06-09T06:42:53.369Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:54:19.116Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730479469.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730479469.jpg",
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"index": 2
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c07dda41cf5fb1b0b32b32"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال ۹۱",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Specialized exhibition of oil, gas and petrochemical industry in 2012",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-06-09T08:37:46.125Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:56:13.040Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730537819.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730537819.jpg",
|
||||
"index": 1,
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a4fdff19a48ba7b814e3"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "سمینار نمک زدایی(پارک نوآوری فناوری-تهران خرداد ۱۴۰۰)",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Desalination Seminar (Technology Innovation Park-Tehran khordad 1400)",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T11:52:29.346Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:54:30.648Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730623620.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730623620.jpg",
|
||||
"categoryType": {
|
||||
"$oid": "638be18dd940b41bafbd0135"
|
||||
},
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a93dff19a48ba7b81638"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال ۹۷",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Specialized exhibition of oil, gas and petrochemical industry in 1397",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:10:37.520Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:55:20.510Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730657403.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730657403.jpg",
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a96cff19a48ba7b8163e"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال ۹۸",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Specialized exhibition of oil, gas and petrochemical industry in 1398",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:11:24.526Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:55:28.493Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730704904.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730704904.jpg",
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6155a991ff19a48ba7b81645"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت، گاز و پتروشیمی سال ۹۹",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Specialized exhibition of oil, gas and petrochemical industry in 1399",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T12:12:01.954Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:55:43.051Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"cover": "categoryIMG_1653730798044.jpg",
|
||||
"thumb": "thumb_categoryIMG_1653730798044.jpg",
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"index": 1
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "62b6f241e1c2a31a75839115"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه تخصصی صنعت نفت و گاز و پتروشیمی تهران 1401",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "2022 Oil,Gas and petrochemical Exhibitions in",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"index": 0,
|
||||
"cover": "categoryIMG_1662808216817.jpg",
|
||||
"thumb": "thumb_categoryIMG_1662808216817.jpg",
|
||||
"created_at": {
|
||||
"$date": "2022-06-25T11:32:17.767Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:55:50.991Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6309e04c2616125886007a3f"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "سمپوزیوم و نمایشگاه بینالمللی فولاد1400",
|
||||
"description": "جزیره کیش-سال 1400"
|
||||
},
|
||||
"en": {
|
||||
"title": "International Steel Exhibition2021",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"index": 0,
|
||||
"cover": "categoryIMG_1661591627391.jpg",
|
||||
"thumb": "thumb_categoryIMG_1661591627391.jpg",
|
||||
"created_at": {
|
||||
"$date": "2022-08-27T09:13:48.219Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:56:05.422Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "6680ffeb097ed0a38116a82c"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "بیست و هشتمین نمایشگاه تخصصی صنعت نفت ، گاز ، پالایش و پتروشیمی تهران 1403",
|
||||
"description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "The 28th specialized exhibition of oil, gas, refining and petrochemical industry in Tehran 1403",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"categoryType": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"index": 8,
|
||||
"cover": "categoryIMG_1719730294140.jpg",
|
||||
"thumb": "thumb_categoryIMG_1719730294140.jpg",
|
||||
"created_at": {
|
||||
"$date": "2024-06-30T06:49:15.830Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2024-06-30T06:51:35.690Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,40 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه"
|
||||
},
|
||||
"en": {
|
||||
"title": "Exhibition"
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2022-12-03T23:53:26.591Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:53:26.591Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "638be18dd940b41bafbd0135"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "سمینار های نفتی"
|
||||
},
|
||||
"en": {
|
||||
"title": "Oil seminars"
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2022-12-03T23:53:49.628Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:53:49.628Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,202 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "61544c563faa5a3b86031986"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "ورقهای آلیاژی و API"
|
||||
},
|
||||
"en": {
|
||||
"name": "Alloy Sheet and API"
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "آلیاژی"
|
||||
},
|
||||
"en": {
|
||||
"name": "Alloy"
|
||||
}
|
||||
},
|
||||
"_id": {
|
||||
"$oid": "615d97c9afd26657fe9c5d59"
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-10-06T12:34:17.290Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-06T12:34:17.290Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "API"
|
||||
},
|
||||
"en": {
|
||||
"name": "API"
|
||||
}
|
||||
},
|
||||
"_id": {
|
||||
"$oid": "615d97d2afd26657fe9c5d5f"
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-10-06T12:34:26.576Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-06T12:34:26.576Z"
|
||||
}
|
||||
}
|
||||
],
|
||||
"created_at": {
|
||||
"$date": "2021-09-29T11:21:58.995Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-03-07T11:20:02.928Z"
|
||||
},
|
||||
"__v": 4
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "61544d0d41304b825a19901c"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "خطوط لوله"
|
||||
},
|
||||
"en": {
|
||||
"name": "Pipeline"
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "لوله های ERW"
|
||||
},
|
||||
"en": {
|
||||
"name": "pipes ERW"
|
||||
}
|
||||
},
|
||||
"_id": {
|
||||
"$oid": "61554c6c4b787cbf8b9bd6f7"
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T05:34:36.933Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-09-30T05:34:36.933Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "لوله های LSAW"
|
||||
},
|
||||
"en": {
|
||||
"name": "LSAW pipes"
|
||||
}
|
||||
},
|
||||
"_id": {
|
||||
"$oid": "61554c9e4b787cbf8b9bd6fd"
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2021-09-30T05:35:26.193Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-09-30T05:35:26.193Z"
|
||||
}
|
||||
}
|
||||
],
|
||||
"created_at": {
|
||||
"$date": "2021-09-29T11:25:01.213Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-03-07T11:20:15.967Z"
|
||||
},
|
||||
"__v": 2
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "61544d48340d0704add10a10"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "صنایع پتروشیمی و پالایشی"
|
||||
},
|
||||
"en": {
|
||||
"name": "Petrochemical and Refining Industries"
|
||||
}
|
||||
},
|
||||
"tags": [],
|
||||
"created_at": {
|
||||
"$date": "2021-09-29T11:26:00.272Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-03-07T11:20:24.336Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "615450d66bf0592ea095d18c"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"name": "گوره به جاسک"
|
||||
},
|
||||
"en": {
|
||||
"name": "Gore to Jask"
|
||||
}
|
||||
},
|
||||
"tags": [],
|
||||
"created_at": {
|
||||
"$date": "2021-09-29T11:41:10.680Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-03-07T11:20:38.204Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "638be176d940b41bafbd012f"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "نمایشگاه"
|
||||
},
|
||||
"en": {
|
||||
"title": "Exhibition"
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2022-12-03T23:53:26.591Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:53:26.591Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "638be18dd940b41bafbd0135"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "سمینار های نفتی"
|
||||
},
|
||||
"en": {
|
||||
"title": "Oil seminars"
|
||||
}
|
||||
},
|
||||
"created_at": {
|
||||
"$date": "2022-12-03T23:53:49.628Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-12-03T23:53:49.628Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,272 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2401"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd823",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "1000 عدد Heat Exchanger Tube",
|
||||
"client": "پالایش نفت شیراز"
|
||||
},
|
||||
"en": {
|
||||
"title": "1000 Heat Exchanger Tubes",
|
||||
"client": "Shiraz Oil Refining Company"
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1394",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2021-10-09T05:49:14.479Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2402"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd822",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "1000 عدد Heat Exchanger Tube",
|
||||
"short_description": " ... ",
|
||||
"description": "",
|
||||
"client": "پالایش نفت شیراز",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "1000 Heat Exchanger Tubes",
|
||||
"short_description": " ... ",
|
||||
"description": "",
|
||||
"client": "Shiraz Oil Refining Company",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1396",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2022-08-10T06:52:49.355Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2403"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd825",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "19256 شاخه Heat Exchanger Tube",
|
||||
"short_description": " ... ",
|
||||
"description": "",
|
||||
"client": "پالایش نفت آبادان",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "19256 Heat Exchanger Tubes",
|
||||
"short_description": " ... ",
|
||||
"description": "",
|
||||
"client": "Abadan Oil Refining Co",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1396",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2022-08-10T07:00:43.933Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2404"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd824",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "دو قلم تیوب فلزی",
|
||||
"client": "پالایش نفت بندرعباس"
|
||||
},
|
||||
"en": {
|
||||
"title": "Two Metal Tubes",
|
||||
"client": "Bandar Abbas Oil Refining Company"
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1395",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2021-10-09T05:49:14.479Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2405"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd826",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "لوله 26 اینچ (15 شاخه)",
|
||||
"short_description": " ... ... ",
|
||||
"description": "",
|
||||
"client": "پالایش نفت آبادان",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "26-inch Pipes (15 pieces)",
|
||||
"short_description": " ... ... ",
|
||||
"description": "",
|
||||
"client": "Abadan Oil Refining Co",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d0d41304b825a19901c",
|
||||
"project_date": "1396",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2022-10-09T11:18:59.527Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2406"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd828",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "تأمین تیوب استنلس استیل 316L",
|
||||
"client": "پتروشیمی شهید تندگویان"
|
||||
},
|
||||
"en": {
|
||||
"title": "Supply of Stainless Steel 316L Tubes",
|
||||
"client": "Shahid Tondguyan Petrochemical Company"
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1393",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2021-10-09T05:49:14.479Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2407"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd829",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "تأمین 442,070 متر ورق و پانل دیواری 4 سانت دورو آلوزینک دیرسوز",
|
||||
"short_description": " ... ",
|
||||
"description": "",
|
||||
"client": "مجتمع صنعتی ماموت",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
},
|
||||
"en": {
|
||||
"title": "Supply of 442,070 meters of 4 cm Fire-Resistant Double-Sided Aluzinc Sheets and Wall Panels",
|
||||
"short_description": " ... ",
|
||||
"description": "",
|
||||
"client": "Mammut Industrial Complex",
|
||||
"size": "",
|
||||
"area": "",
|
||||
"s3_title": "",
|
||||
"s3_description": "",
|
||||
"s5_title": "",
|
||||
"s5_description": "",
|
||||
"s6_title": "",
|
||||
"s6_description": ""
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1399",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2022-06-27T06:20:03.332Z",
|
||||
"version": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "668c77029e6c0554b72f2408"
|
||||
},
|
||||
"id": "61612d5adddaa231b46bd827",
|
||||
"locale": {
|
||||
"fa": {
|
||||
"title": "3 قلم Pipe Alloy Steel",
|
||||
"client": "پالایش نفت اصفهان"
|
||||
},
|
||||
"en": {
|
||||
"title": "3 Alloy Steel Pipes",
|
||||
"client": "Isfahan Oil Refining Company"
|
||||
}
|
||||
},
|
||||
"has_details": false,
|
||||
"importWithCode": true,
|
||||
"category": "61544d48340d0704add10a10",
|
||||
"project_date": "1398",
|
||||
"images": [],
|
||||
"created_at": "2021-10-09T05:49:14.479Z",
|
||||
"updated_at": "2021-10-09T05:49:14.479Z",
|
||||
"version": 0
|
||||
}]
|
||||
@@ -0,0 +1,42 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "61643d25f99954aad5454210"
|
||||
},
|
||||
"isImage": true,
|
||||
"image": "slider_1633959205185.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-10-11T13:33:25.347Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-11T13:33:25.347Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "61643d5ef99954aad5454214"
|
||||
},
|
||||
"isImage": false,
|
||||
"video": "slider_1633959262185.mp4",
|
||||
"created_at": {
|
||||
"$date": "2021-10-11T13:34:22.186Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-10-11T13:34:22.186Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "65801b35097ed0a3810d21f4"
|
||||
},
|
||||
"isImage": true,
|
||||
"image": "slider_1702894388991.jpg",
|
||||
"created_at": {
|
||||
"$date": "2023-12-18T10:13:09.415Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2023-12-18T10:13:09.415Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,115 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60b3afe00462d2f8938d1077"
|
||||
},
|
||||
"scope": [
|
||||
"admin"
|
||||
],
|
||||
"username": "negareh_support",
|
||||
"password": "$2a$10$Oz6i2zBMsY/cq.c7Uh6G3e8Vu3.sJ3zx8QKhZSdO8hlDi6rmaB1S.",
|
||||
"created_at": {
|
||||
"$date": "2021-05-30T15:31:44.592Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2024-06-30T06:01:04.161Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MGIzYWZlMDA0NjJkMmY4OTM4ZDEwNzciLCJpYXQiOjE3MTk3MjcyNjQsImV4cCI6MTcyMDMzMjA2NH0.eLhlyzTz_VuJRlJzJH3WwXPcnp5vZ93pKLxFtfoKYaw",
|
||||
"first_name": "negar"
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60b3afe00462d2f8938d1078"
|
||||
},
|
||||
"scope": [
|
||||
"admin"
|
||||
],
|
||||
"username": "orisoxin_admin",
|
||||
"password": "$2a$10$og3eV.bfirfzGv.pc/.tvOZ7cKvD3JRmAYHyy8vM0dCt/vkIdh3GW",
|
||||
"created_at": {
|
||||
"$date": "2021-05-30T15:31:44.786Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2023-04-24T10:21:20.573Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"token": null
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c588247084c383c231c857"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"first_name": "ارسلان",
|
||||
"last_name": "احمدی",
|
||||
"position": "مدیرعامل"
|
||||
},
|
||||
"en": {
|
||||
"first_name": "Arsalan",
|
||||
"last_name": "Ahmadi",
|
||||
"position": "CEO"
|
||||
}
|
||||
},
|
||||
"index": 1,
|
||||
"image": "team_Arsalan_1635851235792.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-06-13T04:23:00.300Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2021-11-02T11:16:13.621Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c588bc7084c383c231c858"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"first_name": "نیما",
|
||||
"last_name": "کلانتریان",
|
||||
"position": "نایب رییس هیئت مدیره"
|
||||
},
|
||||
"en": {
|
||||
"first_name": "Nima",
|
||||
"last_name": "Kalantarian",
|
||||
"position": "Vice Chairman of the Board"
|
||||
}
|
||||
},
|
||||
"index": 2,
|
||||
"image": "team_Nima_1635851618268.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-06-13T04:25:32.705Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-03-07T11:42:22.702Z"
|
||||
},
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60c58cbb7084c383c231c859"
|
||||
},
|
||||
"locale": {
|
||||
"fa": {
|
||||
"first_name": "هوتن",
|
||||
"last_name": "خورسند",
|
||||
"position": "ريیس هیئت مدیره"
|
||||
},
|
||||
"en": {
|
||||
"first_name": "Hootan",
|
||||
"last_name": "Khorsand",
|
||||
"position": "Chairman of the Board"
|
||||
}
|
||||
},
|
||||
"index": 3,
|
||||
"image": "team_Hootan_1635851688023.jpg",
|
||||
"created_at": {
|
||||
"$date": "2021-06-13T04:42:35.299Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2022-03-07T11:42:24.156Z"
|
||||
},
|
||||
"__v": 0
|
||||
}]
|
||||
@@ -0,0 +1,91 @@
|
||||
const jwt = require('jsonwebtoken')
|
||||
const User = require('./models/User')
|
||||
|
||||
const authentication = {
|
||||
// secret for generating jwt token
|
||||
secretKey: '6fe26a8a97c5815f00c14acca4137ec6c466dd75985168b3627ebf08b2dfd7f42ee69a322af6e3fd6dfe48ce747f3ca65a8765db425e602e08178a104e725ff9',
|
||||
// check if just logged in (admin-or-user) (middleware)
|
||||
isLoggedIn: function (req, res, next) {
|
||||
const token = req.headers.authorization
|
||||
if (token) {
|
||||
// check if token is not destroyed
|
||||
User.findOne({token: token}, (err, user) => {
|
||||
if (err) throw err
|
||||
if (user) {
|
||||
// verifies secret and checks if the token is expired
|
||||
jwt.verify(user.token.replace(/^Bearer\s/, ''), authentication.secretKey, (err, decoded) => {
|
||||
if (err) return res.status(401).json({message: 'unauthorized'})
|
||||
else return next()
|
||||
})
|
||||
} else return res.status(401).json({message: 'unauthorized'})
|
||||
})
|
||||
} else {
|
||||
return res.status(401).json({message: 'unauthorized'})
|
||||
}
|
||||
},
|
||||
// check if admin logged in (middleware)
|
||||
isAdmin: function (req, res, next) {
|
||||
const token = req?.headers?.authorization?.replace(/^Bearer\s/, '')
|
||||
if (token) {
|
||||
// check if token is not destroyed
|
||||
User.findOne({token: token}, (err, user) => {
|
||||
if (err) throw err
|
||||
if (user) {
|
||||
// verifies secret and checks if the token is expired
|
||||
jwt.verify(user.token.replace(/^Bearer\s/, ''), authentication.secretKey, (err, decoded) => {
|
||||
if (err || !user.scope.includes('admin')) return res.status(401).json({message: 'unauthorized'})
|
||||
else return next()
|
||||
})
|
||||
} else return res.status(401).json({message: 'unauthorized'})
|
||||
})
|
||||
} else {
|
||||
return res.status(401).json({message: 'unauthorized'})
|
||||
}
|
||||
},
|
||||
// check if admin logged in (middleware)
|
||||
isUser: function (req, res, next) {
|
||||
const token = req.headers.authorization
|
||||
if (token) {
|
||||
// check if token is not destroyed
|
||||
User.findOne({token: token}, (err, user) => {
|
||||
if (err) throw err
|
||||
if (user) {
|
||||
// verifies secret and checks if the token is expired
|
||||
jwt.verify(user.token.replace(/^Bearer\s/, ''), authentication.secretKey, (err, decoded) => {
|
||||
if (err || !user.scope.includes('user')) return res.status(401).json({message: 'unauthorized'})
|
||||
else return next()
|
||||
})
|
||||
} else return res.status(401).json({message: 'unauthorized'})
|
||||
})
|
||||
} else {
|
||||
return res.status(401).json({message: 'unauthorized'})
|
||||
}
|
||||
},
|
||||
// get user id from token
|
||||
getID: (req) => {
|
||||
const token = req.headers.authorization
|
||||
return jwt.verify(token.replace(/^Bearer\s/, ''), authentication.secretKey, (err, decoded) => {
|
||||
if (err) return 'unauthorized'
|
||||
else return decoded._id
|
||||
})
|
||||
},
|
||||
// check if user has permission (middleware)
|
||||
hasPermission: (permission) => {
|
||||
return (req, res, next) => {
|
||||
const token = req.headers.authorization
|
||||
if (token) {
|
||||
// check if token is not destroyed
|
||||
User.findOne({token: token}, (err, user) => {
|
||||
if (err || !user) return res.status(401).json({message: 'unauthorized'})
|
||||
if (user.permissions.includes('super-admin')) return next()
|
||||
if (!user.permissions.includes(permission)) return res.status(401).json({message: 'unauthorized'})
|
||||
else return next()
|
||||
})
|
||||
} else {
|
||||
return res.status(401).json({message: 'unauthorized'})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = authentication
|
||||
@@ -0,0 +1,132 @@
|
||||
const BlogCategory = require('../models/BlogCategory')
|
||||
const BlogPost = require('../models/BlogPost')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('fa_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return BlogCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return BlogCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {fa_title, en_title, fa_description, en_description} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title,
|
||||
description: fa_description
|
||||
},
|
||||
en: {
|
||||
title: en_title,
|
||||
description: en_description
|
||||
}
|
||||
}
|
||||
}
|
||||
const category = new BlogCategory(data)
|
||||
category.save(err => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
BlogCategory.find({}, (err, categories) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(categories)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
BlogCategory.findById(req.params.id, (err, category) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(category)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('fa_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return BlogCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category && category._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return BlogCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category && category._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {fa_title, en_title, fa_description, en_description} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title,
|
||||
description: fa_description
|
||||
},
|
||||
en: {
|
||||
title: en_title,
|
||||
description: en_description
|
||||
}
|
||||
}
|
||||
}
|
||||
BlogCategory.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const posts = await BlogPost.find({category: req.params.id})
|
||||
if (posts.length) return res.status(403).json({message: 'Can not remove categories that have posts.'})
|
||||
BlogCategory.findByIdAndRemove(req.params.id, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,358 @@
|
||||
const BlogCategory = require('../models/BlogCategory')
|
||||
const BlogPost = require('../models/BlogPost')
|
||||
const mongoose = require('mongoose')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
|
||||
// variables
|
||||
const coverWidth = 1920
|
||||
const coverHeight = 300
|
||||
const coverQuality = 100
|
||||
|
||||
const coverThumbWidth = 400
|
||||
const coverThumbHeight = 210
|
||||
const coverThumbQuality = 100
|
||||
|
||||
const lastSectionImageWidth = 1920
|
||||
const lastSectionImageHeight = 400
|
||||
const lastSectionImageQuality = 100
|
||||
|
||||
const blogPaginateLimit = 10
|
||||
|
||||
const shortDescriptionLength = 250
|
||||
|
||||
const videoLimit = 150;
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return BlogPost.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(post => {
|
||||
if (post) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('fa_title')
|
||||
.if((value, {req}) => value)
|
||||
.custom((value, {req}) => {
|
||||
return BlogPost.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(post => {
|
||||
if (post) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
if (!req.files || !req.files.cover) return res.status(422).json({validation: {cover: {msg: _sr['fa'].required.cover}}})
|
||||
if (!_sr.supportedImageFormats.includes(req.files.cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const {
|
||||
fa_title,
|
||||
en_title
|
||||
} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title
|
||||
},
|
||||
en: {
|
||||
title: en_title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const image = req.files.cover
|
||||
const imageName = 'blog_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverQuality})
|
||||
.toFile(`./static/uploads/images/blog/${imageName}`)
|
||||
|
||||
await target
|
||||
.resize(coverThumbWidth, coverThumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverThumbQuality})
|
||||
.toFile(`./static/uploads/images/blog/thumb/${imageThumb}`)
|
||||
|
||||
data.cover = imageName
|
||||
data.thumb = imageThumb
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
|
||||
const post = new BlogPost(data)
|
||||
post.save((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
async (req, res) => {
|
||||
///////////// get available options
|
||||
// '/api/public/blogPosts' --> gets all published posts
|
||||
// '/api/public/blogPosts?getAll=true' --> gets all posts either published or not
|
||||
// '/api/public/blogPosts?limit=4' --> gets only 4 published post of all categories
|
||||
// '/api/public/blogPosts?category=${encodeURIComponent(categoryTitle)}&page=${pageNumber}' --> gets posts depend on the category title and in chunked data
|
||||
|
||||
if (req.query.category) {
|
||||
try {
|
||||
const categoryID = await BlogCategory.findOne({$or: [{'locale.fa.title': req.query.category}, {'locale.en.title': req.query.category}]})
|
||||
const filter = req.query.category === 'all' ? {published: true} : {published: true, category: categoryID._id}
|
||||
BlogPost.paginate(filter, {page: req.query.page, limit: blogPaginateLimit, populate: 'category', sort: {_id: -1}}, (err, posts) => {
|
||||
if (err) return res500(res, {message: _sr['fa'].not_found.item_id})
|
||||
return res.json(posts)
|
||||
})
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
} else {
|
||||
let query = {published: true}
|
||||
if (req.query.getAll) delete query.published
|
||||
const limit = Number(req.query.limit) || false
|
||||
BlogPost.find(query).sort({_id: -1}).limit(limit).populate('category').exec((err, posts) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(posts)
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
const query = req.params.id
|
||||
const isObjectId = mongoose.isValidObjectId(query)
|
||||
const noCategory = req.query.noCategory
|
||||
const filter = isObjectId ? {_id: query} : {$or: [{'locale.fa.title': query}, {'locale.en.title': query}]}
|
||||
BlogPost.findOne(filter).populate(noCategory ? '' : 'category').exec((err, post) => {
|
||||
if (err || !post) return res404(res, err)
|
||||
else return res.json(post)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return BlogPost.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(post => {
|
||||
if (post && post._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('fa_title')
|
||||
.if((value, {req}) => value)
|
||||
.custom((value, {req}) => {
|
||||
return BlogPost.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(post => {
|
||||
if (post && post._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('category')
|
||||
.notEmpty().withMessage(_sr['fa'].required.category)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
if (mongoose.isValidObjectId(value)) {
|
||||
return BlogCategory.findById(value)
|
||||
.then(category => {
|
||||
if (!category) return Promise.reject(_sr['fa'].not_found.item_id)
|
||||
else return true
|
||||
})
|
||||
} else return Promise.reject(_sr['fa'].required.category)
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {
|
||||
fa_title,
|
||||
en_title,
|
||||
fa_description,
|
||||
en_description,
|
||||
fa_short_description,
|
||||
en_short_description,
|
||||
fa_last_section_image_title,
|
||||
en_last_section_image_title,
|
||||
fa_last_section_image_description,
|
||||
en_last_section_image_description,
|
||||
fa_last_section_title,
|
||||
en_last_section_title,
|
||||
fa_last_section_description,
|
||||
en_last_section_description,
|
||||
category,
|
||||
published
|
||||
} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title || '',
|
||||
description: fa_description || '',
|
||||
short_description: fa_short_description.slice(0, shortDescriptionLength) || '' + ' ... ',
|
||||
last_section_image_title: fa_last_section_image_title || '',
|
||||
last_section_image_description: fa_last_section_image_description || '',
|
||||
last_section_title: fa_last_section_title || '',
|
||||
last_section_description: fa_last_section_description || ''
|
||||
},
|
||||
en: {
|
||||
title: en_title || '',
|
||||
description: en_description || '',
|
||||
short_description: en_short_description.slice(0, shortDescriptionLength) || '' + ' ... ',
|
||||
last_section_image_title: en_last_section_image_title || '',
|
||||
last_section_image_description: en_last_section_image_description || '',
|
||||
last_section_title: en_last_section_title || '',
|
||||
last_section_description: en_last_section_description || ''
|
||||
}
|
||||
},
|
||||
category, published
|
||||
}
|
||||
|
||||
if (req.files) {
|
||||
if (req.files.cover) {
|
||||
if (!_sr.supportedImageFormats.includes(req.files.cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const image = req.files.cover
|
||||
const imageName = 'blog_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverQuality})
|
||||
.toFile(`./static/uploads/images/blog/${imageName}`)
|
||||
|
||||
await target
|
||||
.resize(coverThumbWidth, coverThumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverThumbQuality})
|
||||
.toFile(`./static/uploads/images/blog/thumb/${imageThumb}`)
|
||||
data.cover = imageName
|
||||
data.thumb = imageThumb
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
if (req.files.last_section_image) {
|
||||
if (!_sr.supportedImageFormats.includes(req.files.last_section_image.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const image = req.files.last_section_image
|
||||
const imageName = 'blog_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(lastSectionImageWidth, lastSectionImageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: lastSectionImageQuality})
|
||||
.toFile(`./static/uploads/images/blog/${imageName}`)
|
||||
|
||||
data.last_section_image = imageName
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
if (req.files.video) {
|
||||
const file = req?.files?.video
|
||||
if (file.mimetype.split('/')[1] !== 'mp4') return res.status(422).json({validation: {video: {msg: _sr['fa'].format.video}}})
|
||||
|
||||
///// start convert byte to mb
|
||||
const mb = file.size / (1024 * 1024);
|
||||
|
||||
///// check limit size of video
|
||||
if (mb > videoLimit) {
|
||||
return res.status(422).json({
|
||||
validation: {file: {msg: `${_sr['fa'].max_char.data_size} 150 مگابایت`}}
|
||||
});
|
||||
}
|
||||
|
||||
const videoName = 'blog_' + Date.now() + '.mp4'
|
||||
const uploadPath = `./static/uploads/videos/blog/${videoName}`;
|
||||
|
||||
try {
|
||||
await file.mv(uploadPath);
|
||||
data.video = videoName
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BlogPost.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (req.files && req.files.cover) {
|
||||
fs.unlink(`./static/${oldData.cover}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${oldData.thumb}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (req.files && req.files.last_section_image && oldData.last_section_image) {
|
||||
fs.unlink(`./static/${oldData.last_section_image}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (req.files && req.files.video && oldData.video) {
|
||||
fs.unlink(`./static/${oldData.video}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
BlogPost.findByIdAndRemove(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
fs.unlink(`./static/${data.cover}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${data.thumb}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
if (data.last_section_image) fs.unlink(`./static/${data.last_section_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
if (data.video) fs.unlink(`./static/${data.video}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,160 @@
|
||||
const Catalog = require('../models/Catalog')
|
||||
const mongoose = require('mongoose')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
const {res404, res500} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
|
||||
// variables
|
||||
const coverWidth = 390
|
||||
const coverHeight = 551
|
||||
const coverQuality = 100
|
||||
|
||||
module.exports.create = [
|
||||
async (req, res) => {
|
||||
if (!req.files || !req.files.file) return res.status(422).json({validation: {file: {msg: _sr['fa'].required.file}}})
|
||||
if (!req.files || !req.files.cover) return res.status(422).json({validation: {cover: {msg: _sr['fa'].required.cover}}})
|
||||
if (!_sr.supportedImageFormats.includes(req.files.cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const {showInFa, showInEn, fa_title, en_title} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title
|
||||
},
|
||||
en: {
|
||||
title: en_title
|
||||
}
|
||||
},
|
||||
showInFa, showInEn
|
||||
}
|
||||
|
||||
// file
|
||||
const file = req.files.file
|
||||
const fileName = 'orisoxin_catalog_' + Date.now() + '_' + file.name
|
||||
file.mv(`./static/uploads/catalogs/file/${fileName}`)
|
||||
data.file = fileName
|
||||
|
||||
// cover
|
||||
const image = req.files.cover
|
||||
const imageName = 'orisoxin_catalog_cover_' + Date.now() + '.jpg'
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
|
||||
await target
|
||||
.resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverQuality})
|
||||
.toFile(`./static/uploads/catalogs/cover/${imageName}`)
|
||||
|
||||
data.cover = imageName
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
|
||||
const catalog = new Catalog(data)
|
||||
catalog.save((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
Catalog.find({}).sort({_id: -1}).exec((err, images) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(images)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
Catalog.findById(req.params.id, (err, image) => {
|
||||
if (err || !image) return res404(res, err)
|
||||
else return res.json(image)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
async (req, res) => {
|
||||
const {showInFa, showInEn, fa_title, en_title} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title
|
||||
},
|
||||
en: {
|
||||
title: en_title
|
||||
}
|
||||
},
|
||||
showInFa, showInEn
|
||||
}
|
||||
|
||||
if (req.files) {
|
||||
if (req.files.file) {
|
||||
const file = req.files.file
|
||||
const fileName = 'orisoxin_catalog_' + Date.now() + '_' + file.name
|
||||
file.mv(`./static/uploads/catalogs/file/${fileName}`)
|
||||
data.file = fileName
|
||||
}
|
||||
|
||||
if (req.files.cover) {
|
||||
if (!_sr.supportedImageFormats.includes(req.files.cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const image = req.files.cover
|
||||
const imageName = 'orisoxsin_cover_' + Date.now() + '.jpg'
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverQuality})
|
||||
.toFile(`./static/uploads/catalogs/cover/${imageName}`)
|
||||
|
||||
data.cover = imageName
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Catalog.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (req.files && req.files.file) {
|
||||
fs.unlink(`./static/${oldData.file}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (req.files && req.files.cover) {
|
||||
fs.unlink(`./static/${oldData.cover}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
Catalog.findByIdAndRemove(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
fs.unlink(`./static/${data.file}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${data.cover}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,125 @@
|
||||
const ContactUs = require('../models/ContactUs')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const nodemailer = require('nodemailer')
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('locale')
|
||||
.isLength({min: 2}).withMessage('locale is required')
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return value === 'fa' || value === 'en' ? true : Promise.reject('locale is not correct')
|
||||
}),
|
||||
|
||||
body('name')
|
||||
.notEmpty().withMessage((value, {req}) => _sr[req.body.locale].required.name)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr[req.body.locale].min_char.min2),
|
||||
|
||||
body('email')
|
||||
.notEmpty().withMessage((value, {req}) => _sr[req.body.locale].required.email)
|
||||
.bail()
|
||||
.isEmail().withMessage((value, {req}) => _sr[req.body.locale].format.email),
|
||||
|
||||
body('subject')
|
||||
.notEmpty().withMessage((value, {req}) => _sr[req.body.locale].required.subject)
|
||||
.bail()
|
||||
.isLength({min: 4}).withMessage((value, {req}) => _sr[req.body.locale].min_char.min4),
|
||||
|
||||
body('message')
|
||||
.notEmpty().withMessage((value, {req}) => _sr[req.body.locale].required.message)
|
||||
.bail()
|
||||
.isLength({min: 10}).withMessage((value, {req}) => _sr[req.body.locale].min_char.min10)
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {locale, name, email, subject, message} = req.body
|
||||
|
||||
const data = {locale, name, email, subject, message}
|
||||
|
||||
|
||||
let transporter = nodemailer.createTransport({
|
||||
host: 'mail.negareh-demo2.ir',
|
||||
port: 587,
|
||||
secure: false, // true for 465, false for other ports
|
||||
auth: {
|
||||
user: 'client@negareh-demo2.ir',
|
||||
pass: 'JSAT}Q-RB_s0'
|
||||
},
|
||||
tls: {
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
})
|
||||
|
||||
const emailHTMLTemplate = `
|
||||
<div style="direction: rtl;background-color: #ed1d24;overflow: hidden;">
|
||||
<div style="width: 50%;border-radius: 10px;margin: 150px auto;background: #fff;text-align: center;padding: 20px;box-shadow: 0 15px 30px #000;">
|
||||
|
||||
|
||||
<h2 style="color: #000;font-size: 22px;font-weight: bold;">
|
||||
عنوان پیام:
|
||||
</h2>
|
||||
<p style="color: #000;margin-bottom: 20px;">${subject}</p>
|
||||
|
||||
|
||||
<h2 style="color: #000;font-size: 22px;font-weight: bold;">
|
||||
متن پیام:
|
||||
</h2>
|
||||
<p style="color: #000;margin-bottom: 20px;">${message}</p>
|
||||
|
||||
|
||||
<div style="text-align: center;margin-top: 20px;">
|
||||
<h2 style="color: #000;font-size: 22px;font-weight: bold;">
|
||||
مشخصات فرستنده:
|
||||
</h2>
|
||||
<span>${name}</span>
|
||||
<span>-</span>
|
||||
<span>${email}</span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<span style="opacity: 0">${Date.now()}</span>
|
||||
</div>
|
||||
`
|
||||
|
||||
// send mail with defined transport object
|
||||
transporter.sendMail({
|
||||
from: '"OrisOxin Website" <client@negareh-demo2.ir>', // sender address
|
||||
to: 'info@orisoxin.com', // list of receivers
|
||||
subject: subject,
|
||||
text: message,
|
||||
html: emailHTMLTemplate
|
||||
})
|
||||
|
||||
|
||||
new ContactUs(data).save((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
return res.json({message: _sr[req.body.locale].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
ContactUs.find({}, (err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
ContactUs.findById(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
data.read = true
|
||||
data.save((err, message) => {
|
||||
if (err) console.log(err)
|
||||
return res.json(message)
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,184 @@
|
||||
const CustomerComment = require('../models/CustomerComment')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
|
||||
|
||||
// variables
|
||||
const imageWidth = 350
|
||||
const imageHeight = 350
|
||||
const imageQuality = 100
|
||||
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('fa_name')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.name)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2),
|
||||
|
||||
body('en_name')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.name)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2),
|
||||
|
||||
body('fa_comment')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.caption)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2),
|
||||
|
||||
body('en_comment')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.caption)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2)
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {fa_name, en_name, fa_position, en_position, fa_comment, en_comment} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
name: fa_name,
|
||||
position: fa_position,
|
||||
comment: fa_comment
|
||||
},
|
||||
en: {
|
||||
name: en_name,
|
||||
position: en_position,
|
||||
comment: en_comment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (req.files && req.files.image) {
|
||||
const image = req.files.image
|
||||
const imageName = 'customer_' + Date.now() + '.jpg'
|
||||
data.image = imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
|
||||
await target
|
||||
.resize(imageWidth, imageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/customer/${imageName}`)
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
new CustomerComment(data).save((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
CustomerComment.find({}, (err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
CustomerComment.findById(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
else return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('fa_name')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.name)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2),
|
||||
|
||||
body('en_name')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.name)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2),
|
||||
|
||||
body('fa_comment')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.caption)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2),
|
||||
|
||||
body('en_comment')
|
||||
.notEmpty().withMessage((value, {req}) => _sr['fa'].required.caption)
|
||||
.bail()
|
||||
.isLength({min: 2}).withMessage((value, {req}) => _sr['fa'].min_char.min2)
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {fa_name, en_name, fa_position, en_position, fa_comment, en_comment} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
name: fa_name,
|
||||
position: fa_position,
|
||||
comment: fa_comment
|
||||
},
|
||||
en: {
|
||||
name: en_name,
|
||||
position: en_position,
|
||||
comment: en_comment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (req.files && req.files.image) {
|
||||
const image = req.files.image
|
||||
const imageName = 'customer_' + Date.now() + '.jpg'
|
||||
data.image = imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
|
||||
await target
|
||||
.resize(imageWidth, imageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/customer/${imageName}`)
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
CustomerComment.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (oldData.image && req.files && req.files.image) {
|
||||
fs.unlink(`./static/${oldData.image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
CustomerComment.findByIdAndRemove(req.params.id, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (oldData.image) {
|
||||
fs.unlink(`./static/${oldData.image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,221 @@
|
||||
const GalleryCategory = require('../models/GalleryCategory')
|
||||
const Gallery = require('../models/Gallery')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
|
||||
const imageQuality = 100
|
||||
const imageThumbWidth = 500
|
||||
const imageThumbHeight = 500
|
||||
const imageThumbQuality = 80
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('fa_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return GalleryCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return GalleryCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {fa_title, en_title, fa_description, en_description , index} = req.body
|
||||
if (!req.files || !req.files.cover) return res.status(422).json({validation: {cover: {msg: _sr['fa'].required.cover}}})
|
||||
if (!_sr.supportedImageFormats.includes(req.files.cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const image = req.files.cover
|
||||
const imageName = 'categoryIMG_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title,
|
||||
description: fa_description
|
||||
},
|
||||
en: {
|
||||
title: en_title,
|
||||
description: en_description
|
||||
}
|
||||
},
|
||||
index
|
||||
}
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/galleryCover/${imageName}`)
|
||||
|
||||
await target
|
||||
.resize(imageThumbWidth, imageThumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageThumbQuality})
|
||||
.toFile(`./static/uploads/images/galleryCover/thumb/${imageThumb}`)
|
||||
|
||||
data.cover = imageName
|
||||
data.thumb = imageThumb
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
const category = new GalleryCategory(data)
|
||||
category.save(err => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
GalleryCategory.find({}, (err, categories) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(categories)
|
||||
}).sort({index : 1})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
GalleryCategory.findById(req.params.id, (err, category) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(category)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('fa_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return GalleryCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category && category._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return GalleryCategory.findOne({$or: [{'locale.fa.title': value}, {'locale.en.title': value}]})
|
||||
.then(category => {
|
||||
if (category && category._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {fa_title, en_title, fa_description, en_description,index} = req.body
|
||||
const image = req?.files?.cover
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title,
|
||||
description: fa_description
|
||||
},
|
||||
en: {
|
||||
title: en_title,
|
||||
description: en_description
|
||||
}
|
||||
},
|
||||
index
|
||||
}
|
||||
|
||||
|
||||
if (image) {
|
||||
if (!_sr.supportedImageFormats.includes(req.files.cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
|
||||
const imageName = 'categoryIMG_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/galleryCover/${imageName}`)
|
||||
|
||||
await target
|
||||
.resize(imageThumbWidth, imageThumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageThumbQuality})
|
||||
.toFile(`./static/uploads/images/galleryCover/thumb/${imageThumb}`)
|
||||
|
||||
data.cover = imageName
|
||||
data.thumb = imageThumb
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
GalleryCategory.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
else {
|
||||
if (image && oldData.cover) {
|
||||
fs.unlink(`./static/${oldData.cover}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${oldData.thumb}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const posts = await Gallery.find({category: req.params.id})
|
||||
if (posts.length) return res.status(403).json({message: 'Can not remove categories that have posts.'})
|
||||
GalleryCategory.findByIdAndRemove(req.params.id, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
else {
|
||||
|
||||
if (oldData.cover) {
|
||||
fs.unlink(`./static/${oldData.cover}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${oldData.thumb}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,190 @@
|
||||
const Gallery = require('../models/Gallery')
|
||||
const mongoose = require('mongoose')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
|
||||
// variables
|
||||
const imageQuality = 100
|
||||
|
||||
const imageThumbWidth = 500
|
||||
const imageThumbHeight = 500
|
||||
const imageThumbQuality = 80
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('category')
|
||||
.if((value, {req}) => req.body.noCategory === 'false')
|
||||
.notEmpty().withMessage(_sr['fa'].required.category)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return mongoose.isValidObjectId(value) ? true : Promise.reject(_sr['fa'].required.category)
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
try {
|
||||
if (!req.files || !req.files.image) return res.status(422).json({validation: {image: {msg: _sr['fa'].required.image}}})
|
||||
if (!_sr.supportedImageFormats.includes(req.files.image.mimetype.split('/')[1])) return res.status(422).json({validation: {image: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const {fa_caption, en_caption, category, noCategory} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
caption: fa_caption
|
||||
},
|
||||
en: {
|
||||
caption: en_caption
|
||||
}
|
||||
},
|
||||
noCategory
|
||||
}
|
||||
if (mongoose.isValidObjectId(category)) data.category = category
|
||||
const image = req.files.image
|
||||
const imageName = 'gallery_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/gallery/${imageName}`)
|
||||
|
||||
await target
|
||||
.resize(imageThumbWidth, imageThumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageThumbQuality})
|
||||
.toFile(`./static/uploads/images/gallery/${imageThumb}`)
|
||||
|
||||
data.image = imageName
|
||||
data.thumb = imageThumb
|
||||
} catch (e) {
|
||||
return res500(res , _sr['fa'].response.problem)
|
||||
}
|
||||
|
||||
const post = new Gallery(data)
|
||||
post.save((err, data) => {
|
||||
if (err) return res500(res , _sr['fa'].response.problem)
|
||||
return res.json(data)
|
||||
})
|
||||
}catch (e) {
|
||||
return res500(res , _sr['fa'].response.problem)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
Gallery.find({}).populate('category').sort({_id: -1}).exec((err, images) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(images)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getByCategoryId = [
|
||||
(req, res) => {
|
||||
Gallery.find({category: req.params.id}).sort({_id: -1}).exec((err, images) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(images)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
Gallery.findById(req.params.id, (err, image) => {
|
||||
if (err || !image) return res404(res, err)
|
||||
else return res.json(image)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('category')
|
||||
.if((value, {req}) => req.body.noCategory === 'false')
|
||||
.notEmpty().withMessage(_sr['fa'].required.category)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return mongoose.isValidObjectId(value) ? true : Promise.reject(_sr['fa'].required.category)
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {fa_caption, en_caption, category, noCategory} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
caption: fa_caption
|
||||
},
|
||||
en: {
|
||||
caption: en_caption
|
||||
}
|
||||
},
|
||||
noCategory
|
||||
}
|
||||
if (mongoose.isValidObjectId(category)) data.category = category
|
||||
if (req.files && req.files.image) {
|
||||
if (!_sr.supportedImageFormats.includes(req.files.image.mimetype.split('/')[1])) return res.status(422).json({validation: {image: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const image = req.files.image
|
||||
const imageName = 'gallery_' + Date.now() + '.jpg'
|
||||
const imageThumb = 'thumb_' + imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/gallery/${imageName}`)
|
||||
|
||||
await target
|
||||
.resize(imageThumbWidth, imageThumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageThumbQuality})
|
||||
.toFile(`./static/uploads/images/gallery/${imageThumb}`)
|
||||
|
||||
data.image = imageName
|
||||
data.thumb = imageThumb
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
Gallery.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (req.files && req.files.image) {
|
||||
fs.unlink(`./static/${oldData.image}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${oldData.thumb}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
Gallery.findByIdAndRemove(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
fs.unlink(`./static/${data.image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${data.thumb}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,247 @@
|
||||
const Project = require('../models/Project')
|
||||
const ProjectCategory = require('../models/ProjectCategory')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('fa_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return ProjectCategory.findOne({$or: [{'locale.fa.name': value}, {'locale.en.name': value}]})
|
||||
.then(product => {
|
||||
if (product) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('en_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return ProjectCategory.findOne({$or: [{'locale.fa.name': value}, {'locale.en.name': value}]})
|
||||
.then(product => {
|
||||
if (product) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {fa_name, en_name} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
name: fa_name
|
||||
},
|
||||
en: {
|
||||
name: en_name
|
||||
}
|
||||
}
|
||||
}
|
||||
const projectCategory = new ProjectCategory(data)
|
||||
projectCategory.save((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
ProjectCategory.find({}).exec((err, projects) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(projects)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
ProjectCategory.findById(req.params.id, (err, projectCategory) => {
|
||||
if (err || !projectCategory) return res404(res, err)
|
||||
else return res.json(projectCategory)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('fa_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return ProjectCategory.findOne({$or: [{'locale.fa.name': value}, {'locale.en.name': value}]})
|
||||
.then(product => {
|
||||
if (product && product._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('en_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
return ProjectCategory.findOne({$or: [{'locale.fa.name': value}, {'locale.en.name': value}]})
|
||||
.then(product => {
|
||||
if (product && product._id.toString() !== req.params.id) return Promise.reject(_sr['fa'].duplicated.title)
|
||||
else return true
|
||||
})
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {
|
||||
fa_name,
|
||||
en_name
|
||||
} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
name: fa_name
|
||||
},
|
||||
en: {
|
||||
name: en_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProjectCategory.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
async (req, res) => {
|
||||
const projects = await Project.find({category: req.params.id})
|
||||
if (projects.length) return res.status(403).json({message: 'نمیتوان دسته بندی هایی که دارای پروژه هستند را حذف کرد.'})
|
||||
|
||||
ProjectCategory.findByIdAndRemove(req.params.id, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
////////////////////////////
|
||||
|
||||
module.exports.addTagToCategory = [
|
||||
[
|
||||
body('fa_tagName')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title),
|
||||
|
||||
body('en_tagName')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title)
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {fa_tagName, en_tagName} = req.body
|
||||
ProjectCategory.findById(req.params.categoryId, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
data.tags.push({
|
||||
locale: {
|
||||
fa: {
|
||||
name: fa_tagName
|
||||
},
|
||||
en: {
|
||||
name: en_tagName
|
||||
}
|
||||
}
|
||||
})
|
||||
data.save(err => {
|
||||
if (err) console.log(err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.removeTagFromCategory = [
|
||||
async (req, res) => {
|
||||
const projects = await Project.find({tag: req.params.id})
|
||||
if (projects.length) return res.status(403).json({message: 'نمیتوان دسته بندی هایی که دارای پروژه هستند را حذف کرد.'})
|
||||
|
||||
ProjectCategory.findOne({'tags._id': req.params.tagId}, (err, project) => {
|
||||
if (err || !project) return res404(res, err)
|
||||
const tag = project.tags.id(req.params.tagId)
|
||||
tag.remove(err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
project.save(err => {
|
||||
if (err) console.log(err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
// module.exports.getAll = [
|
||||
// (req, res) => {
|
||||
// return res.json([
|
||||
// {
|
||||
// id: 'drilling',
|
||||
// locale: {
|
||||
// fa: {
|
||||
// name: 'صنعت حفاری',
|
||||
// },
|
||||
// en: {
|
||||
// name: 'Drilling industry'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// id: 'piping',
|
||||
// locale: {
|
||||
// fa: {
|
||||
// name: 'صنعت خطوط لوله و اتصالات',
|
||||
// },
|
||||
// en: {
|
||||
// name: 'Pipeline and fittings industry'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// id: 'ward',
|
||||
// locale: {
|
||||
// fa: {
|
||||
// name: 'صنعت پتروشیمی',
|
||||
// },
|
||||
// en: {
|
||||
// name: 'Petrochemical industry'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// // {
|
||||
// // id: 'srp',
|
||||
// // locale: {
|
||||
// // fa: {
|
||||
// // name: 'پمپ های درون چاهی SRP',
|
||||
// // },
|
||||
// // en: {
|
||||
// // name: 'Manufacturer of SRP well pumps'
|
||||
// // }
|
||||
// // }
|
||||
// // },
|
||||
// // {
|
||||
// // id: 'sm',
|
||||
// // locale: {
|
||||
// // fa: {
|
||||
// // name: 'طراحی و ساخت unit های فرآورش و نمک زدایی پیش ساخته Skid Mounted',
|
||||
// // },
|
||||
// // en: {
|
||||
// // name: 'Skid Mounted'
|
||||
// // }
|
||||
// // }
|
||||
// // },
|
||||
// ])
|
||||
// }
|
||||
// ]
|
||||
|
||||
@@ -0,0 +1,515 @@
|
||||
const Project = require('../models/Project')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const sharp = require('sharp')
|
||||
const mongoose = require('mongoose')
|
||||
const fs = require('fs')
|
||||
const readXlsxFile = require('read-excel-file/node')
|
||||
|
||||
// variables
|
||||
const shortDescriptionMaxLength = 250
|
||||
|
||||
const coverWidth = 1920
|
||||
const coverHeight = 418
|
||||
const coverQuality = 100
|
||||
|
||||
const thumbWidth = 770
|
||||
const thumbHeight = 354
|
||||
const thumbQuality = 80
|
||||
|
||||
|
||||
const s2ImageWidth = 1272
|
||||
const s2ImageHeight = 670
|
||||
const s2ImageQuality = 100
|
||||
|
||||
|
||||
const s4ImageWidth = 1920
|
||||
const s4ImageHeight = 500
|
||||
const s4ImageQuality = 100
|
||||
|
||||
|
||||
const s5ImageWidth = 1270
|
||||
const s5ImageHeight = 950
|
||||
const s5ImageQuality = 100
|
||||
|
||||
|
||||
const s6ImageWidth = 1270
|
||||
const s6ImageHeight = 950
|
||||
const s6ImageQuality = 100
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
|
||||
body('fa_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title),
|
||||
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title),
|
||||
|
||||
body('category')
|
||||
.notEmpty().withMessage(_sr['fa'].required.category),
|
||||
|
||||
body('project_date')
|
||||
.notEmpty().withMessage(_sr['fa'].required.date)
|
||||
.bail()
|
||||
.isNumeric().withMessage(_sr['fa'].format.number)
|
||||
.bail()
|
||||
.isLength({min: 4, max: 4}).withMessage('مقدار باید 4 رقمی باشد'),
|
||||
|
||||
body('has_details')
|
||||
.notEmpty().withMessage('this flag is required')
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {fa_title, en_title, fa_client, en_client, category, tag, has_details, project_date} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title,
|
||||
client: fa_client
|
||||
},
|
||||
en: {
|
||||
title: en_title,
|
||||
client: en_client
|
||||
}
|
||||
},
|
||||
category,
|
||||
has_details,
|
||||
project_date
|
||||
}
|
||||
if (tag) data.tag = tag
|
||||
if (!has_details) data.completed = true
|
||||
const project = new Project(data)
|
||||
project.save((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.addExel = [
|
||||
async (req, res) => {
|
||||
const allData = []
|
||||
|
||||
// const rows = await readXlsxFile(`LSAW.xlsx`, {sheet: 1})
|
||||
|
||||
// await Project.deleteMany({category : '61544d48340d0704add10a10'})
|
||||
|
||||
// for (let i = 0; i < rows.length; i++) {
|
||||
// // const project = await Project.findOne({$or : [
|
||||
// // {'locale.en.title' : rows[i][1].replace(/\n/g, " ")},
|
||||
// // {'locale.fa.title' : rows[i][1].replace(/\n/g, " ")}
|
||||
// // ]})
|
||||
//
|
||||
// // if (!project){
|
||||
// allData.push({
|
||||
// locale: {
|
||||
// fa: {
|
||||
// title:rows[i][1] && typeof rows[i][1]==='string'? rows[i][1].replace(/\n/g, " ") : rows[i][1],
|
||||
// client: rows[i][3],
|
||||
// area : rows[i][2]
|
||||
// },
|
||||
// en: {
|
||||
// title: rows[i][1] && typeof rows[i][1]==='string'? rows[i][1].replace(/\n/g, " ") : rows[i][1],
|
||||
// client: rows[i][3],
|
||||
// area : rows[i][2]
|
||||
// }
|
||||
// },
|
||||
// category : '61544d0d41304b825a19901c',
|
||||
// tag : '61554c9e4b787cbf8b9bd6fd',
|
||||
// importWithCode : true,
|
||||
// project_date : rows[i][4]
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// console.log(allData.length)
|
||||
// let addData = allData.map(data => Project.create(data));
|
||||
// const result = await Promise.all(addData)
|
||||
// return res.json(result)
|
||||
const allPro = await Project.find()
|
||||
for (const pro of allPro) {
|
||||
if (pro?.locale?.en?.size || pro?.locale?.en?.area){
|
||||
pro.size = pro.locale.en.size
|
||||
pro.area = pro.locale.en.size
|
||||
}
|
||||
}
|
||||
return res.json(allData)
|
||||
// return res.json(rows)
|
||||
// const data = {
|
||||
// locale: {
|
||||
// fa: {
|
||||
// title: fa_title,
|
||||
// client: fa_client
|
||||
// },
|
||||
// en: {
|
||||
// title: en_title,
|
||||
// client: en_client
|
||||
// }
|
||||
// },
|
||||
// category,
|
||||
// has_details,
|
||||
// project_date
|
||||
// }
|
||||
// if (tag) data.tag = tag
|
||||
// if (!has_details) data.completed = true
|
||||
// const project = new Project(data)
|
||||
// project.save((err, data) => {
|
||||
// if (err) return res500(res, err)
|
||||
// else return res.json(data)
|
||||
// })
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
Project.find().populate('category').sort({project_date : -1}).exec((err, projects) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(projects)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
const query = req.params.id
|
||||
const isObjectId = mongoose.isValidObjectId(query)
|
||||
const filter = isObjectId ? {_id: query} : {$or: [{'locale.fa.title': query}, {'locale.en.title': query}]}
|
||||
Project.findOne(filter, (err, project) => {
|
||||
if (err || !project) return res404(res, err)
|
||||
else return res.json(project)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('category')
|
||||
.notEmpty().withMessage(_sr['fa'].required.category),
|
||||
|
||||
body('fa_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title),
|
||||
|
||||
body('en_title')
|
||||
.notEmpty().withMessage(_sr['fa'].required.title),
|
||||
|
||||
body('category')
|
||||
.notEmpty().withMessage(_sr['fa'].required.category),
|
||||
|
||||
body('project_date')
|
||||
.notEmpty().withMessage(_sr['fa'].required.date)
|
||||
.bail()
|
||||
.isNumeric().withMessage(_sr['fa'].format.number)
|
||||
.bail()
|
||||
.isLength({min: 4, max: 4}).withMessage('مقدار باید 4 رقمی باشد'),
|
||||
|
||||
body('has_details')
|
||||
.notEmpty().withMessage('this flag is required')
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
const {
|
||||
fa_title,
|
||||
en_title,
|
||||
fa_short_description,
|
||||
en_short_description,
|
||||
fa_description,
|
||||
en_description,
|
||||
//
|
||||
fa_client,
|
||||
en_client,
|
||||
//
|
||||
fa_size,
|
||||
en_size,
|
||||
//
|
||||
fa_area,
|
||||
en_area,
|
||||
//
|
||||
fa_s3_title,
|
||||
en_s3_title,
|
||||
fa_s3_description,
|
||||
en_s3_description,
|
||||
//
|
||||
fa_s5_title,
|
||||
en_s5_title,
|
||||
fa_s5_description,
|
||||
en_s5_description,
|
||||
//
|
||||
fa_s6_title,
|
||||
en_s6_title,
|
||||
fa_s6_description,
|
||||
en_s6_description,
|
||||
category,
|
||||
tag,
|
||||
project_date,
|
||||
has_details
|
||||
} = req.body
|
||||
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
title: fa_title,
|
||||
short_description: fa_short_description.slice(0, shortDescriptionMaxLength) + ' ... ',
|
||||
description: fa_description,
|
||||
//
|
||||
client: fa_client,
|
||||
size: fa_size,
|
||||
area: fa_area,
|
||||
//
|
||||
s3_title: fa_s3_title,
|
||||
s3_description: fa_s3_description,
|
||||
//
|
||||
s5_title: fa_s5_title,
|
||||
s5_description: fa_s5_description,
|
||||
//
|
||||
s6_title: fa_s6_title,
|
||||
s6_description: fa_s6_description
|
||||
},
|
||||
en: {
|
||||
title: en_title,
|
||||
short_description: en_short_description.slice(0, shortDescriptionMaxLength) + ' ... ',
|
||||
description: en_description,
|
||||
//
|
||||
client: en_client,
|
||||
size: en_size,
|
||||
area: en_area,
|
||||
//
|
||||
s3_title: en_s3_title,
|
||||
s3_description: en_s3_description,
|
||||
//
|
||||
s5_title: en_s5_title,
|
||||
s5_description: en_s5_description,
|
||||
//
|
||||
s6_title: en_s6_title,
|
||||
s6_description: en_s6_description
|
||||
}
|
||||
},
|
||||
category,
|
||||
project_date,
|
||||
has_details,
|
||||
}
|
||||
if (tag) data.tag = tag
|
||||
if (req.files) {
|
||||
if (req.files.cover) {
|
||||
const cover = req.files.cover
|
||||
const coverName = 'project_' + Date.now() + '.jpg'
|
||||
if (!_sr.supportedImageFormats.includes(cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
data.cover = coverName
|
||||
data.thumb = 'thumb_' + coverName
|
||||
|
||||
const target = new sharp(cover.data)
|
||||
target
|
||||
.resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverQuality})
|
||||
.toFile(`./static/uploads/images/projects/${coverName}`)
|
||||
|
||||
target
|
||||
.resize(thumbWidth, thumbHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: thumbQuality})
|
||||
.toFile(`./static/uploads/images/projects/thumb_${coverName}`)
|
||||
}
|
||||
|
||||
if (req.files.s2_image) {
|
||||
const s2_image = req.files.s2_image
|
||||
const s2_imageName = 's2_image_' + Date.now() + '.jpg'
|
||||
if (!_sr.supportedImageFormats.includes(s2_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s2_image: {msg: _sr['fa'].format.image}}})
|
||||
data.s2_image = s2_imageName
|
||||
|
||||
const target = new sharp(s2_image.data)
|
||||
target
|
||||
.resize(s2ImageWidth, s2ImageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: s2ImageQuality})
|
||||
.toFile(`./static/uploads/images/projects/${s2_imageName}`)
|
||||
}
|
||||
|
||||
if (req.files.s4_image) {
|
||||
const s4_image = req.files.s4_image
|
||||
const s4_imageName = 's4_image_' + Date.now() + '.jpg'
|
||||
if (!_sr.supportedImageFormats.includes(s4_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s4_image: {msg: _sr['fa'].format.image}}})
|
||||
data.s4_image = s4_imageName
|
||||
|
||||
const target = new sharp(s4_image.data)
|
||||
target
|
||||
.resize(s4ImageWidth, s4ImageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: s4ImageQuality})
|
||||
.toFile(`./static/uploads/images/projects/${s4_imageName}`)
|
||||
}
|
||||
|
||||
if (req.files.s5_image) {
|
||||
const s5_image = req.files.s5_image
|
||||
const s5_imageName = 's5_image_' + Date.now() + '.jpg'
|
||||
if (!_sr.supportedImageFormats.includes(s5_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s5_image: {msg: _sr['fa'].format.image}}})
|
||||
data.s5_image = s5_imageName
|
||||
|
||||
const target = new sharp(s5_image.data)
|
||||
target
|
||||
.resize(s5ImageWidth, s5ImageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: s5ImageQuality})
|
||||
.toFile(`./static/uploads/images/projects/${s5_imageName}`)
|
||||
}
|
||||
|
||||
if (req.files.s6_image) {
|
||||
const s6_image = req.files.s6_image
|
||||
const s6_imageName = 's6_image_' + Date.now() + '.jpg'
|
||||
if (!_sr.supportedImageFormats.includes(s6_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s6_image: {msg: _sr['fa'].format.image}}})
|
||||
data.s6_image = s6_imageName
|
||||
|
||||
const target = new sharp(s6_image.data)
|
||||
target
|
||||
.resize(s6ImageWidth, s6ImageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: s6ImageQuality})
|
||||
.toFile(`./static/uploads/images/projects/${s6_imageName}`)
|
||||
}
|
||||
}
|
||||
|
||||
Project.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (req.files) {
|
||||
if (req.files.cover && oldData.cover) {
|
||||
fs.unlink(`./static/${oldData.cover}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${oldData.thumb}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
if (req.files.s2_image && oldData.s2_image) {
|
||||
fs.unlink(`./static/${oldData.s2_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (req.files.s4_image && oldData.s4_image) {
|
||||
fs.unlink(`./static/${oldData.s4_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (req.files.s5_image && oldData.s5_image) {
|
||||
fs.unlink(`./static/${oldData.s5_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (req.files.s6_image && oldData.s6_image) {
|
||||
fs.unlink(`./static/${oldData.s6_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
Project.findByIdAndRemove(req.params.id, async (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (oldData.cover) {
|
||||
fs.unlink(`./static/${oldData.cover}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`./static/${oldData.thumb}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
if (oldData.s2_image) {
|
||||
fs.unlink(`./static/${oldData.s2_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (oldData.s4_image) {
|
||||
fs.unlink(`./static/${oldData.s4_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (oldData.s5_image) {
|
||||
fs.unlink(`./static/${oldData.s5_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
if (oldData.s6_image) {
|
||||
fs.unlink(`./static/${oldData.s6_image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
////////////////////////////
|
||||
|
||||
module.exports.addImageToProjectGallery = [
|
||||
async (req, res) => {
|
||||
if (!req.files || !req.files.image) return res.status(422).json({validation: {image: {msg: _sr['fa'].required.image}}})
|
||||
try {
|
||||
const project = await Project.findById(req.params.project_id)
|
||||
if (!project) return res404(res, 'project not found')
|
||||
|
||||
|
||||
const image = req.files.image
|
||||
const imageName = 'project_images_' + Date.now() + '.jpg'
|
||||
const thumbName = 'thumb_' + imageName
|
||||
|
||||
if (!_sr.supportedImageFormats.includes(image.mimetype.split('/')[1])) return res.status(422).json({validation: {image: {msg: _sr['fa'].format.image}}})
|
||||
|
||||
const target = new sharp(image.data)
|
||||
target
|
||||
.resize(s4ImageWidth, s4ImageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: s4ImageQuality})
|
||||
.toFile(`./static/uploads/images/projects/${thumbName}`)
|
||||
|
||||
image.mv(`./static/uploads/images/projects/${imageName}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
|
||||
project.images.push({image: imageName, thumb: thumbName})
|
||||
project.save(err => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
|
||||
} catch (e) {
|
||||
return res404(res, e)
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.removeImageFromProject = [
|
||||
(req, res) => {
|
||||
Project.findOne({'images._id': req.params.image_id}, (err, project) => {
|
||||
if (err || !project) return res404(res, err)
|
||||
const image = project.images.id(req.params.image_id)
|
||||
image.remove(err => {
|
||||
if (err) console.log(err)
|
||||
fs.unlink(`../static/${image.image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
fs.unlink(`../static/${image.thumb}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
})
|
||||
project.save(err => {
|
||||
if (err) console.log(err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,193 @@
|
||||
const SiteSetting = require('../models/SiteSetting')
|
||||
const BlogPost = require('../models/BlogPost')
|
||||
const GalleryCategory = require('../models/GalleryCategory')
|
||||
const Project = require('../models/Project')
|
||||
const mongoose = require('mongoose')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
const {body, param, validationResult} = require('express-validator')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
|
||||
// variables
|
||||
const imageWidth = 1920
|
||||
const imageHeight = 600
|
||||
const imageQuality = 100
|
||||
|
||||
module.exports.update = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const setting = await SiteSetting.findOne()
|
||||
if (setting) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
return res500(res, _sr['fa'].response.problem)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAllByAdmin = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const images = await SiteSetting.findOne()
|
||||
if (images) {
|
||||
return res.json(images)
|
||||
} else {
|
||||
const create = await SiteSetting.create({})
|
||||
return res.json(create)
|
||||
}
|
||||
} catch (e) {
|
||||
return res500(res, _sr['fa'].response.problem)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.uploadCover = [
|
||||
[
|
||||
param('id')
|
||||
.notEmpty().withMessage('لطفا نوع عکس را مشخص کنید')
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
try {
|
||||
const picType = req?.params?.id
|
||||
const image = req?.files?.file
|
||||
|
||||
let validation = {validation: {}}
|
||||
|
||||
if (!image) {
|
||||
validation.validation[picType] = {msg: _sr['fa'].required.image}
|
||||
return res.status(422).json(validation)
|
||||
}
|
||||
|
||||
if (image.mimetype.split('/')[1] !== 'jpeg' && image.mimetype.split('/')[1] !== 'jpg') {
|
||||
validation.validation[picType] = {msg: _sr['fa'].format.image}
|
||||
res.status(422).json(validation)
|
||||
}
|
||||
|
||||
const setting = await SiteSetting.findOne()
|
||||
if (!setting) return res500(res, _sr['fa'].response.problem)
|
||||
if (!setting[picType]) {
|
||||
validation[picType] = {msg: 'نوع عکس وارد شده صحیح نمی باشد'}
|
||||
return res.status(422).json(validation)
|
||||
}
|
||||
|
||||
|
||||
const imageName = `setting_${picType}_${Date.now()}.jpeg`
|
||||
|
||||
|
||||
if (image && !setting[picType].includes('undefined')) {
|
||||
fs.unlink(`../static/${setting[picType]}`, (err) => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(imageWidth, imageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpeg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/setting/${imageName}`)
|
||||
|
||||
setting[picType] = imageName
|
||||
|
||||
await setting.save();
|
||||
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
} catch (e) {
|
||||
console.log(e.message)
|
||||
return res500(res, _sr['fa'].response.problem)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAllByUser = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const images = await SiteSetting.findOne()
|
||||
|
||||
if (images) {
|
||||
return res.json(images)
|
||||
} else {
|
||||
return res.json({
|
||||
aboutUS: null,
|
||||
activity: null,
|
||||
projects: null,
|
||||
gallery: null,
|
||||
catalog: null,
|
||||
blogs: null,
|
||||
})
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, _sr['fa'].response.problem)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.search = [
|
||||
async (req, res) => {
|
||||
const {terms} = req.query;
|
||||
|
||||
try {
|
||||
const requests = [
|
||||
BlogPost.find({
|
||||
published: true,
|
||||
$or: [
|
||||
{'locale.fa.title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.short_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.short_description': {$regex: terms, $options: 'i'}},
|
||||
]
|
||||
}),
|
||||
GalleryCategory.find({
|
||||
$or: [
|
||||
{'locale.fa.title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.title': {$regex: terms, $options: 'i'}},
|
||||
]
|
||||
}),
|
||||
Project.find({
|
||||
$or: [
|
||||
{'locale.fa.title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.short_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.s3_title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.s3_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.s5_title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.s5_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.s6_title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.fa.s6_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.short_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.s3_title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.s3_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.s5_title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.s5_description': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.s6_title': {$regex: terms, $options: 'i'}},
|
||||
{'locale.en.s6_description': {$regex: terms, $options: 'i'}},
|
||||
]
|
||||
})
|
||||
]
|
||||
|
||||
const getData = await Promise.all(requests);
|
||||
|
||||
let [blogs, categoryGallery, projects] = getData;
|
||||
|
||||
return res.json({
|
||||
blogs,
|
||||
categoryGallery,
|
||||
projects
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, _sr['fa'].response.problem);
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,281 @@
|
||||
const Slide = require('../models/Slide')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const sharp = require('sharp')
|
||||
const mongoose = require('mongoose')
|
||||
const fs = require('fs')
|
||||
|
||||
// variables
|
||||
const coverWidth = 1920
|
||||
const coverHeight = 1080
|
||||
const coverQuality = 100
|
||||
|
||||
module.exports.create = [
|
||||
async (req, res) => {
|
||||
try {
|
||||
const isImage = req.body.isImage === 'true'
|
||||
if (isImage && (!req.files || !req.files.image)) return res.status(422).json({validation: {image: {msg: _sr['fa'].required.image}}})
|
||||
if (!isImage && (!req.files || !req.files.video)) return res.status(422).json({validation: {video: {msg: _sr['fa'].required.video}}})
|
||||
if (isImage && !_sr.supportedImageFormats.includes(req.files.image.mimetype.split('/')[1])) return res.status(422).json({validation: {image: {msg: _sr['fa'].format.image}}})
|
||||
if (!isImage && !_sr.supportedVideoFormats.includes(req.files.video.mimetype.split('/')[1])) return res.status(422).json({validation: {video: {msg: _sr['fa'].format.video}}})
|
||||
const data = {isImage}
|
||||
|
||||
if (isImage) {
|
||||
const image = req.files.image
|
||||
const imageName = 'slider_' + Date.now() + '.jpg'
|
||||
data.image = imageName
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: coverQuality})
|
||||
.toFile(`./static/uploads/images/slider/${imageName}`)
|
||||
} else {
|
||||
const video = req.files.video
|
||||
const videoName = 'slider_' + Date.now() + '.' + video.mimetype.split('/')[1]
|
||||
data.video = videoName
|
||||
video.mv(`./static/uploads/images/slider/${videoName}`)
|
||||
}
|
||||
|
||||
const slide = new Slide(data)
|
||||
slide.save(err => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
Slide.find({}).exec((err, projects) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(projects)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
Slide.findById(req.params.id, (err, slide) => {
|
||||
if (err || !slide) return res404(res, err)
|
||||
else return res.json(slide)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
// module.exports.update = [
|
||||
// (req, res) => {
|
||||
// const {
|
||||
// fa_title,
|
||||
// en_title,
|
||||
// fa_short_description,
|
||||
// en_short_description,
|
||||
// fa_description,
|
||||
// en_description,
|
||||
// //
|
||||
// fa_client,
|
||||
// en_client,
|
||||
// //
|
||||
// fa_skills,
|
||||
// en_skills,
|
||||
// //
|
||||
// fa_website,
|
||||
// en_website,
|
||||
// //
|
||||
// fa_s3_title,
|
||||
// en_s3_title,
|
||||
// fa_s3_description,
|
||||
// en_s3_description,
|
||||
// //
|
||||
// fa_s5_title,
|
||||
// en_s5_title,
|
||||
// fa_s5_description,
|
||||
// en_s5_description,
|
||||
// //
|
||||
// fa_s6_title,
|
||||
// en_s6_title,
|
||||
// fa_s6_description,
|
||||
// en_s6_description,
|
||||
// category,
|
||||
// project_date,
|
||||
// has_details
|
||||
// } = req.body
|
||||
//
|
||||
// const data = {
|
||||
// locale: {
|
||||
// fa: {
|
||||
// title: fa_title,
|
||||
// short_description: fa_short_description.slice(0, shortDescriptionMaxLength) + ' ... ',
|
||||
// description: fa_description,
|
||||
// //
|
||||
// client: fa_client,
|
||||
// skills: fa_skills,
|
||||
// website: fa_website,
|
||||
// //
|
||||
// s3_title: fa_s3_title,
|
||||
// s3_description: fa_s3_description,
|
||||
// //
|
||||
// s5_title: fa_s5_title,
|
||||
// s5_description: fa_s5_description,
|
||||
// //
|
||||
// s6_title: fa_s6_title,
|
||||
// s6_description: fa_s6_description
|
||||
// },
|
||||
// en: {
|
||||
// title: en_title,
|
||||
// short_description: en_short_description.slice(0, shortDescriptionMaxLength) + ' ... ',
|
||||
// description: en_description,
|
||||
// //
|
||||
// client: en_client,
|
||||
// skills: en_skills,
|
||||
// website: en_website,
|
||||
// //
|
||||
// s3_title: en_s3_title,
|
||||
// s3_description: en_s3_description,
|
||||
// //
|
||||
// s5_title: en_s5_title,
|
||||
// s5_description: en_s5_description,
|
||||
// //
|
||||
// s6_title: en_s6_title,
|
||||
// s6_description: en_s6_description
|
||||
// }
|
||||
// },
|
||||
// category,
|
||||
// project_date,
|
||||
// has_details
|
||||
// }
|
||||
//
|
||||
// if (req.files) {
|
||||
// if (req.files.cover) {
|
||||
// const cover = req.files.cover
|
||||
// const coverName = 'project_' + Date.now() + '.jpg'
|
||||
// if (!_sr.supportedImageFormats.includes(cover.mimetype.split('/')[1])) return res.status(422).json({validation: {cover: {msg: _sr['fa'].format.image}}})
|
||||
// data.cover = coverName
|
||||
// data.thumb = 'thumb_' + coverName
|
||||
//
|
||||
// const target = new sharp(cover.data)
|
||||
// target
|
||||
// .resize(coverWidth, coverHeight, {fit: 'cover'})
|
||||
// .toFormat('jpg')
|
||||
// .jpeg({quality: coverQuality})
|
||||
// .toFile(`./static/uploads/images/projects/${coverName}`)
|
||||
//
|
||||
// target
|
||||
// .resize(thumbWidth, thumbHeight, {fit: 'cover'})
|
||||
// .toFormat('jpg')
|
||||
// .jpeg({quality: thumbQuality})
|
||||
// .toFile(`./static/uploads/images/projects/thumb_${coverName}`)
|
||||
// }
|
||||
//
|
||||
// if (req.files.s2_image) {
|
||||
// const s2_image = req.files.s2_image
|
||||
// const s2_imageName = 's2_image_' + Date.now() + '.jpg'
|
||||
// if (!_sr.supportedImageFormats.includes(s2_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s2_image: {msg: _sr['fa'].format.image}}})
|
||||
// data.s2_image = s2_imageName
|
||||
//
|
||||
// const target = new sharp(s2_image.data)
|
||||
// target
|
||||
// .resize(s2ImageWidth, s2ImageHeight, {fit: 'cover'})
|
||||
// .toFormat('jpg')
|
||||
// .jpeg({quality: s2ImageQuality})
|
||||
// .toFile(`./static/uploads/images/projects/${s2_imageName}`)
|
||||
// }
|
||||
//
|
||||
// if (req.files.s4_image) {
|
||||
// const s4_image = req.files.s4_image
|
||||
// const s4_imageName = 's4_image_' + Date.now() + '.jpg'
|
||||
// if (!_sr.supportedImageFormats.includes(s4_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s4_image: {msg: _sr['fa'].format.image}}})
|
||||
// data.s4_image = s4_imageName
|
||||
//
|
||||
// const target = new sharp(s4_image.data)
|
||||
// target
|
||||
// .resize(s4ImageWidth, s4ImageHeight, {fit: 'cover'})
|
||||
// .toFormat('jpg')
|
||||
// .jpeg({quality: s4ImageQuality})
|
||||
// .toFile(`./static/uploads/images/projects/${s4_imageName}`)
|
||||
// }
|
||||
//
|
||||
// if (req.files.s5_image) {
|
||||
// const s5_image = req.files.s5_image
|
||||
// const s5_imageName = 's5_image_' + Date.now() + '.jpg'
|
||||
// if (!_sr.supportedImageFormats.includes(s5_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s5_image: {msg: _sr['fa'].format.image}}})
|
||||
// data.s5_image = s5_imageName
|
||||
//
|
||||
// const target = new sharp(s5_image.data)
|
||||
// target
|
||||
// .resize(s5ImageWidth, s5ImageHeight, {fit: 'cover'})
|
||||
// .toFormat('jpg')
|
||||
// .jpeg({quality: s5ImageQuality})
|
||||
// .toFile(`./static/uploads/images/projects/${s5_imageName}`)
|
||||
// }
|
||||
//
|
||||
// if (req.files.s6_image) {
|
||||
// const s6_image = req.files.s6_image
|
||||
// const s6_imageName = 's6_image_' + Date.now() + '.jpg'
|
||||
// if (!_sr.supportedImageFormats.includes(s6_image.mimetype.split('/')[1])) return res.status(422).json({validation: {s6_image: {msg: _sr['fa'].format.image}}})
|
||||
// data.s6_image = s6_imageName
|
||||
//
|
||||
// const target = new sharp(s6_image.data)
|
||||
// target
|
||||
// .resize(s6ImageWidth, s6ImageHeight, {fit: 'cover'})
|
||||
// .toFormat('jpg')
|
||||
// .jpeg({quality: s6ImageQuality})
|
||||
// .toFile(`./static/uploads/images/projects/${s6_imageName}`)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Project.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
// if (err || !oldData) return res404(res, err)
|
||||
// if (req.files) {
|
||||
// if (req.files.cover && oldData.cover) {
|
||||
// fs.unlink(`./static/${oldData.cover}`, err => {
|
||||
// if (err) console.log(err)
|
||||
// })
|
||||
// fs.unlink(`./static/${oldData.thumb}`, err => {
|
||||
// if (err) console.log(err)
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// if (req.files.s2_image && oldData.s2_image) {
|
||||
// fs.unlink(`./static/${oldData.s2_image}`, err => {
|
||||
// if (err) console.log(err)
|
||||
// })
|
||||
// }
|
||||
// if (req.files.s4_image && oldData.s4_image) {
|
||||
// fs.unlink(`./static/${oldData.s4_image}`, err => {
|
||||
// if (err) console.log(err)
|
||||
// })
|
||||
// }
|
||||
// if (req.files.s5_image && oldData.s5_image) {
|
||||
// fs.unlink(`./static/${oldData.s5_image}`, err => {
|
||||
// if (err) console.log(err)
|
||||
// })
|
||||
// }
|
||||
// if (req.files.s6_image && oldData.s6_image) {
|
||||
// fs.unlink(`./static/${oldData.s6_image}`, err => {
|
||||
// if (err) console.log(err)
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return res.json({message: _sr['fa'].response.success_save})
|
||||
// })
|
||||
// }
|
||||
// ]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
Slide.findByIdAndRemove(req.params.id, async (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
fs.unlink(`./static/${oldData.isImage ? oldData.image : oldData.video}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,184 @@
|
||||
const Team = require('../models/Team')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const {res404, res500, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const sharp = require('sharp')
|
||||
const fs = require('fs')
|
||||
|
||||
// variables
|
||||
const imageWidth = 400
|
||||
const imageHeight = 500
|
||||
const imageQuality = 100
|
||||
|
||||
|
||||
module.exports.create = [
|
||||
[
|
||||
body('index')
|
||||
.notEmpty().withMessage('شماره ترتیب را انتخاب کنید'),
|
||||
|
||||
body('fa_first_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.first_name),
|
||||
|
||||
body('en_first_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.first_name),
|
||||
|
||||
body('fa_last_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.last_name),
|
||||
|
||||
body('en_last_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.last_name),
|
||||
|
||||
body('fa_position')
|
||||
.notEmpty().withMessage('سمت را بنویسید'),
|
||||
|
||||
body('en_position')
|
||||
.notEmpty().withMessage('سمت را بنویسید')
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
if (!req.files || !req.files.image) return res.status(422).json({validation: {image: {msg: _sr['fa'].required.image}}})
|
||||
|
||||
const {fa_first_name, en_first_name, fa_last_name, en_last_name, fa_position, en_position, index} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
first_name: fa_first_name,
|
||||
last_name: fa_last_name,
|
||||
position: fa_position
|
||||
},
|
||||
en: {
|
||||
first_name: en_first_name,
|
||||
last_name: en_last_name,
|
||||
position: en_position
|
||||
}
|
||||
},
|
||||
index
|
||||
}
|
||||
|
||||
const image = req.files.image
|
||||
const imageName = 'team_' + en_first_name + '_' + Date.now() + '.jpg'
|
||||
data.image = imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(imageWidth, imageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/team/${imageName}`)
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
|
||||
const teamMate = new Team(data)
|
||||
teamMate.save(err => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getAll = [
|
||||
(req, res) => {
|
||||
Team.find({}).sort({index: 1}).exec((err, data) => {
|
||||
if (err) return res500(res, err)
|
||||
else return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.getOne = [
|
||||
(req, res) => {
|
||||
Team.findById(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
else return res.json(data)
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.update = [
|
||||
[
|
||||
body('index')
|
||||
.notEmpty().withMessage('شماره ترتیب را انتخاب کنید'),
|
||||
|
||||
body('fa_first_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.first_name),
|
||||
|
||||
body('en_first_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.first_name),
|
||||
|
||||
body('en_last_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.last_name),
|
||||
|
||||
body('en_last_name')
|
||||
.notEmpty().withMessage(_sr['fa'].required.last_name),
|
||||
|
||||
body('fa_position')
|
||||
.notEmpty().withMessage('سمت را بنویسید'),
|
||||
|
||||
body('en_position')
|
||||
.notEmpty().withMessage('سمت را بنویسید')
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {fa_first_name, en_first_name, fa_last_name, en_last_name, fa_position, en_position, index} = req.body
|
||||
const data = {
|
||||
locale: {
|
||||
fa: {
|
||||
first_name: fa_first_name,
|
||||
last_name: fa_last_name,
|
||||
position: fa_position
|
||||
},
|
||||
en: {
|
||||
first_name: en_first_name,
|
||||
last_name: en_last_name,
|
||||
position: en_position
|
||||
}
|
||||
},
|
||||
index
|
||||
}
|
||||
|
||||
if (req.files && req.files.image) {
|
||||
const image = req.files.image
|
||||
const imageName = 'team_' + en_first_name + '_' + Date.now() + '.jpg'
|
||||
data.image = imageName
|
||||
|
||||
try {
|
||||
const target = await sharp(image.data)
|
||||
await target
|
||||
.resize(imageWidth, imageHeight, {fit: 'cover'})
|
||||
.withMetadata()
|
||||
.toFormat('jpg')
|
||||
.jpeg({quality: imageQuality})
|
||||
.toFile(`./static/uploads/images/team/${imageName}`)
|
||||
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
|
||||
Team.findByIdAndUpdate(req.params.id, data, (err, oldData) => {
|
||||
if (err || !oldData) return res404(res, err)
|
||||
if (req.files && req.files.image) {
|
||||
fs.unlink(`./static/${oldData.image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
module.exports.delete = [
|
||||
(req, res) => {
|
||||
Team.findByIdAndRemove(req.params.id, (err, data) => {
|
||||
if (err || !data) return res404(res, err)
|
||||
fs.unlink(`./static/${data.image}`, err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
return res.json({message: _sr['fa'].response.success_remove})
|
||||
})
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,141 @@
|
||||
const User = require('../models/User')
|
||||
const {body, validationResult} = require('express-validator')
|
||||
const bcrypt = require('bcryptjs')
|
||||
const jwt = require('jsonwebtoken')
|
||||
const sharp = require('sharp')
|
||||
const {secretKey, getID} = require('./../authentication')
|
||||
const {_sr} = require('../plugins/serverResponses')
|
||||
const {res404, res500, hasWhiteSpaces, isLatinCharactersWithSymbol, generateRandomDigits, removeWhiteSpaces, checkValidations} = require('../plugins/controllersHelperFunctions')
|
||||
const fs = require('fs')
|
||||
const moment = require('moment-jalaali')
|
||||
|
||||
module.exports.create_admin = [
|
||||
[
|
||||
body('username')
|
||||
.notEmpty().withMessage(_sr['fa'].required.username)
|
||||
.bail()
|
||||
.custom((value, {req}) => {
|
||||
if (hasWhiteSpaces(value)) return Promise.reject(_sr['fa'].response.whiteSpace)
|
||||
return User.findOne({username: value}).then(user => {
|
||||
if (user) return Promise.reject(_sr['fa'].duplicated.username)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('password')
|
||||
.custom((value, {req}) => {
|
||||
if (hasWhiteSpaces(value)) return Promise.reject(_sr['fa'].response.whiteSpace)
|
||||
if (removeWhiteSpaces(value).length < 4) return Promise.reject(_sr['fa'].min_char.min4)
|
||||
if (value !== req.body.password_confirmation) return Promise.reject(_sr['fa'].response.passwords_not_match)
|
||||
else return true
|
||||
})
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
async (req, res) => {
|
||||
const {username, password} = req.body
|
||||
|
||||
const data = {username, scope: ['admin']}
|
||||
|
||||
try {
|
||||
const salt = await bcrypt.genSalt(10)
|
||||
const hash = await bcrypt.hash(password, salt)
|
||||
data.password = hash
|
||||
|
||||
const admin = new User(data)
|
||||
await admin.save()
|
||||
return res.json({message: _sr['fa'].response.success_save})
|
||||
} catch (e) {
|
||||
return res500(res, e)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
/////////////////////////////////////////////////////////////////////// login
|
||||
module.exports.login = [
|
||||
[
|
||||
body('username')
|
||||
.isLength({min: 4}).withMessage(_sr['fa'].min_char.min4)
|
||||
.bail()
|
||||
.if((value, {req}) => {
|
||||
return req.body.password && req.body.password.length >= 4
|
||||
})
|
||||
.custom((value, {req}) => {
|
||||
return User.findOne({$or: [{email: value.toLowerCase()}, {username: value}]})
|
||||
.then(user => {
|
||||
if (!user) return Promise.reject(_sr['fa'].not_found.password)
|
||||
else return true
|
||||
})
|
||||
}),
|
||||
|
||||
body('password')
|
||||
.notEmpty().withMessage(_sr['fa'].required.password)
|
||||
.bail()
|
||||
.isLength({min: 4}).withMessage(_sr['fa'].min_char.min4),
|
||||
|
||||
body('remember_me')
|
||||
.exists().withMessage(_sr['fa'].required.remember_me)
|
||||
.bail()
|
||||
.isBoolean().withMessage(_sr['fa'].format.boolean)
|
||||
],
|
||||
checkValidations(validationResult),
|
||||
(req, res) => {
|
||||
User.findOne({$or: [{email: req.body.username.toLowerCase()}, {username: req.body.username}]}, (err, user) => {
|
||||
if (err || !user) return res404(res, err)
|
||||
bcrypt.compare(req.body.password, user.password, (err, isMatch) => {
|
||||
if (err || !isMatch) return res.status(422).json({validation: {username: {msg: _sr['fa'].not_found.password}}})
|
||||
if (user.token) {
|
||||
jwt.verify(user.token.replace(/^Bearer\s/, ''), secretKey, (err, decoded) => {
|
||||
if (err) {
|
||||
let token = jwt.sign({_id: user._id}, secretKey, {expiresIn: req.body.remember_me ? '7d' : '1h'})
|
||||
user.token = token
|
||||
user.save(err => {
|
||||
if (err) console.log(err)
|
||||
return res.json({token: token})
|
||||
})
|
||||
} else return res.json({token: user.token})
|
||||
})
|
||||
} else {
|
||||
let token = jwt.sign({_id: user._id}, secretKey, {expiresIn: req.body.remember_me ? '7d' : '1h'})
|
||||
user.token = token
|
||||
user.save(err => {
|
||||
if (err) console.log(err)
|
||||
return res.json({token: token})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
/////////////////////////////////////////////////////////////////////// logout
|
||||
module.exports.logout = [
|
||||
(req, res) => {
|
||||
const token = req.headers.authorization
|
||||
if (token) {
|
||||
User.findOneAndUpdate({token: token}, {token: null}, (err, oldData) => {
|
||||
if (err || !oldData) res.status(401).json({message: 'Your not logged in'})
|
||||
else return res.json({message: 'You are logged out.'})
|
||||
})
|
||||
} else {
|
||||
return res.status(401).json({message: 'Your not logged in'})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
/////////////////////////////////////////////////////////////////////// get user
|
||||
module.exports.getUser = [
|
||||
(req, res) => {
|
||||
const token = req.headers.authorization
|
||||
if (token) {
|
||||
jwt.verify(token, secretKey, (err, decoded) => {
|
||||
if (err) return res.status(401).json({message: 'unauthenticated'})
|
||||
User.findById(decoded._id, (err, user) => {
|
||||
if (err || !user) return res404(res, err)
|
||||
else return res.json({user: user})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
return res.status(401).json({message: 'unauthenticated'})
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,32 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
mongoose.plugin(schema => {
|
||||
schema.set('toObject', {
|
||||
getters: true
|
||||
})
|
||||
schema.set('toJSON', {
|
||||
getters: true
|
||||
})
|
||||
schema.set('timestamps', {
|
||||
createdAt: 'created_at',
|
||||
updatedAt: 'updated_at'
|
||||
})
|
||||
})
|
||||
|
||||
// mongodb database connection string. change it as per your needs. here "mydb" is the name of the database. You don't need to create DB from mongodb terminal. mongoose create the database automatically.
|
||||
// mongoose.connect('mongodb://negareh1_admin:admin1234@www.negareh-demo.ir:27017/negareh1_oris?serverSelectionTimeoutMS=5000&connectTimeoutMS=10000&authSource=negareh1_oris', {
|
||||
mongoose.connect('mongodb://root:UuPYfG7G6pFqWLW0gOya9oYt@grande-casse.liara.cloud:32644/orisoxin?authSource=admin', {
|
||||
// mongoose.connect('mongodb://localhost:27017/OrisOxin', {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
useFindAndModify: false,
|
||||
useCreateIndex: true
|
||||
})
|
||||
|
||||
const database = mongoose.connection
|
||||
database.on('error', console.error.bind(console, 'connection error:'))
|
||||
database.once('open', function callback() {
|
||||
console.log("MongoDB Connected...")
|
||||
})
|
||||
|
||||
module.exports = database
|
||||
@@ -0,0 +1,33 @@
|
||||
const express = require('express')
|
||||
const database = require('./database')
|
||||
const fileUpload = require('express-fileupload')
|
||||
const {isUser, isAdmin} = require('./authentication')
|
||||
const bodyParser = require('body-parser')
|
||||
const cronJobs = require('./plugins/cronJobs')
|
||||
const {createAdmins} = require('./plugins/privateAdmin')
|
||||
|
||||
// Create express instnace
|
||||
const app = express()
|
||||
cronJobs()
|
||||
createAdmins()
|
||||
// Init body-parser options (inbuilt with express)
|
||||
app.use(express.json())
|
||||
app.use(express.urlencoded({extended: true}))
|
||||
app.use(fileUpload())
|
||||
|
||||
// Require & Import API routes
|
||||
const Public = require('./routes/public')
|
||||
const admin = require('./routes/admin')
|
||||
const auth = require('./routes/auth')
|
||||
|
||||
// Use API Routes
|
||||
app.use('/public', Public)
|
||||
app.use('/auth', auth)
|
||||
app.use('/admin', isAdmin, admin)
|
||||
|
||||
|
||||
// Export the server middleware
|
||||
module.exports = {
|
||||
path: '/api',
|
||||
handler: app
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const BlogCategorySchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
title: String,
|
||||
description: String
|
||||
},
|
||||
en: {
|
||||
title: String,
|
||||
description: String
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('BlogCategory', BlogCategorySchema)
|
||||
@@ -0,0 +1,48 @@
|
||||
const mongoose = require('mongoose')
|
||||
const paginate = require('mongoose-paginate-v2')
|
||||
|
||||
function cover(img) {
|
||||
if (img) return '/uploads/images/blog/' + img
|
||||
}
|
||||
|
||||
function thumb(img) {
|
||||
return '/uploads/images/blog/thumb/' + img
|
||||
}
|
||||
|
||||
function video(vi) {
|
||||
if (vi) return '/uploads/videos/blog/' + vi
|
||||
}
|
||||
|
||||
|
||||
const BlogPostSchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
title: String,
|
||||
description: String,
|
||||
short_description: String,
|
||||
last_section_image_title: String,
|
||||
last_section_image_description: String,
|
||||
last_section_title: String,
|
||||
last_section_description: String
|
||||
},
|
||||
en: {
|
||||
title: String,
|
||||
description: String,
|
||||
short_description: String,
|
||||
last_section_image_title: String,
|
||||
last_section_image_description: String,
|
||||
last_section_title: String,
|
||||
last_section_description: String
|
||||
}
|
||||
},
|
||||
cover: {type: String, get: cover},
|
||||
thumb: {type: String, get: thumb},
|
||||
video : {type: String, get: video},
|
||||
last_section_image: {type: String, get: cover},
|
||||
category: {type: mongoose.ObjectId, ref: 'BlogCategory'},
|
||||
published: {type: Boolean, default: true}
|
||||
})
|
||||
|
||||
BlogPostSchema.plugin(paginate)
|
||||
|
||||
module.exports = mongoose.model('BlogPost', BlogPostSchema)
|
||||
@@ -0,0 +1,27 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function file(file) {
|
||||
return '/uploads/catalogs/file/' + file
|
||||
}
|
||||
|
||||
function cover(img) {
|
||||
return '/uploads/catalogs/cover/' + img
|
||||
}
|
||||
|
||||
const CatalogSchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
title: String
|
||||
},
|
||||
en: {
|
||||
title: String
|
||||
}
|
||||
},
|
||||
file: {type: String, get: file},
|
||||
cover: {type: String, get: cover},
|
||||
showInFa: {type: Boolean, default: false},
|
||||
showInEn: {type: Boolean, default: false}
|
||||
})
|
||||
|
||||
|
||||
module.exports = mongoose.model('Catalog', CatalogSchema)
|
||||
@@ -0,0 +1,17 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const contactUsSchema = mongoose.Schema({
|
||||
name: String,
|
||||
email: String,
|
||||
subject: String,
|
||||
message: String,
|
||||
locale: {
|
||||
type: String,
|
||||
enum: ['fa', 'en'],
|
||||
default: 'en'
|
||||
},
|
||||
read: {type: Boolean, default: false}
|
||||
})
|
||||
|
||||
|
||||
module.exports = mongoose.model('ContactUs', contactUsSchema)
|
||||
@@ -0,0 +1,23 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
if (img) return '/uploads/images/customer/' + img
|
||||
}
|
||||
|
||||
const CustomerCommentSchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
name: String,
|
||||
position: String,
|
||||
comment: String
|
||||
},
|
||||
en: {
|
||||
name: String,
|
||||
position: String,
|
||||
comment: String
|
||||
}
|
||||
},
|
||||
image: {type: String, get: image}
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('CustomerComment', CustomerCommentSchema)
|
||||
@@ -0,0 +1,23 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
return '/uploads/images/gallery/' + img
|
||||
}
|
||||
|
||||
const GallerySchema = mongoose.Schema({
|
||||
image: {type: String, get: image},
|
||||
thumb: {type: String, get: image},
|
||||
category: {type: mongoose.ObjectId, ref: 'GalleryCategory'},
|
||||
noCategory: {type: Boolean, default: false},
|
||||
locale: {
|
||||
fa: {
|
||||
caption: String
|
||||
},
|
||||
en: {
|
||||
caption: String
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
module.exports = mongoose.model('Gallery', GallerySchema)
|
||||
@@ -0,0 +1,25 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
return '/uploads/images/galleryCover/' + img
|
||||
}
|
||||
function image2(img) {
|
||||
return '/uploads/images/galleryCover/thumb/' + img
|
||||
}
|
||||
const GalleryCategorySchema = mongoose.Schema({
|
||||
cover: {type: String, get: image},
|
||||
thumb: {type: String, get: image2},
|
||||
locale: {
|
||||
fa: {
|
||||
title: String,
|
||||
description: String
|
||||
},
|
||||
en: {
|
||||
title: String,
|
||||
description: String
|
||||
}
|
||||
},
|
||||
index : {type : Number , default : 1}
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('GalleryCategory', GalleryCategorySchema)
|
||||
@@ -0,0 +1,65 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
if (img) return '/uploads/images/projects/' + img
|
||||
}
|
||||
|
||||
const ProjectImagesSchema = mongoose.Schema({
|
||||
image: {type: String, get: image},
|
||||
thumb: {type: String, get: image}
|
||||
})
|
||||
|
||||
const ProjectSchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
title: String,
|
||||
short_description: String,
|
||||
description: String,
|
||||
//
|
||||
client: String,
|
||||
size: String,
|
||||
area: String,
|
||||
//
|
||||
s3_title: String,
|
||||
s3_description: String,
|
||||
//
|
||||
s5_title: String,
|
||||
s5_description: String,
|
||||
//
|
||||
s6_title: String,
|
||||
s6_description: String
|
||||
},
|
||||
en: {
|
||||
title: String,
|
||||
short_description: String,
|
||||
description: String,
|
||||
//
|
||||
client: String,
|
||||
size: String,
|
||||
area: String,
|
||||
//
|
||||
s3_title: String,
|
||||
s3_description: String,
|
||||
//
|
||||
s5_title: String,
|
||||
s5_description: String,
|
||||
//
|
||||
s6_title: String,
|
||||
s6_description: String
|
||||
}
|
||||
},
|
||||
category: {type: mongoose.ObjectId, ref: 'ProjectCategory'},
|
||||
tag: {type: mongoose.ObjectId},
|
||||
cover: {type: String, get: image},
|
||||
thumb: {type: String, get: image},
|
||||
s2_image: {type: String, get: image},
|
||||
s4_image: {type: String, get: image},
|
||||
s5_image: {type: String, get: image},
|
||||
s6_image: {type: String, get: image},
|
||||
project_date: String,
|
||||
images: [ProjectImagesSchema],
|
||||
has_details: {type: Boolean, default: false},
|
||||
importWithCode : {type: Boolean, default: false}
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('Project', ProjectSchema)
|
||||
@@ -0,0 +1,27 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const CategoryTagSchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
name: String
|
||||
},
|
||||
en: {
|
||||
name: String
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const ProjectCategorySchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
name: String
|
||||
},
|
||||
en: {
|
||||
name: String
|
||||
}
|
||||
},
|
||||
tags: [CategoryTagSchema]
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('ProjectCategory', ProjectCategorySchema)
|
||||
@@ -0,0 +1,16 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function file(file) {
|
||||
if (file) return '/uploads/images/setting/' + file
|
||||
}
|
||||
|
||||
const SiteSettingSchema = mongoose.Schema({
|
||||
aboutUS: {type: String, get: file, default: 'undefined'},
|
||||
activity: {type: String, get: file, default: ''},
|
||||
projects: {type: String, get: file, default: ''},
|
||||
gallery: {type: String, get: file, default: ''},
|
||||
catalog: {type: String, get: file, default: ''},
|
||||
blogs: {type: String, get: file, default: ''},
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('SiteSetting', SiteSettingSchema)
|
||||
@@ -0,0 +1,25 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function file(file) {
|
||||
if (file) return '/uploads/images/slider/' + file
|
||||
}
|
||||
|
||||
const SlideSchema = mongoose.Schema({
|
||||
// locale: {
|
||||
// fa: {
|
||||
// name: String,
|
||||
// position: String,
|
||||
// comment: String
|
||||
// },
|
||||
// en: {
|
||||
// name: String,
|
||||
// position: String,
|
||||
// comment: String
|
||||
// }
|
||||
// },
|
||||
isImage: Boolean,
|
||||
image: {type: String, get: file},
|
||||
video: {type: String, get: file}
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('Slide', SlideSchema)
|
||||
@@ -0,0 +1,24 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
return '/uploads/images/team/' + img
|
||||
}
|
||||
|
||||
const TeamSchema = mongoose.Schema({
|
||||
locale: {
|
||||
fa: {
|
||||
first_name: String,
|
||||
last_name: String,
|
||||
position: String
|
||||
},
|
||||
en: {
|
||||
first_name: String,
|
||||
last_name: String,
|
||||
position: String
|
||||
}
|
||||
},
|
||||
image: {type: String, get: image},
|
||||
index: Number
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('Team', TeamSchema)
|
||||
@@ -0,0 +1,11 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
|
||||
const UserSchema = mongoose.Schema({
|
||||
username: String,
|
||||
password: String,
|
||||
scope: {type: Array, default: ['user']},
|
||||
token: String,
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('User', UserSchema)
|
||||
@@ -0,0 +1,79 @@
|
||||
module.exports.res404 = (res, err) => {
|
||||
return res.status(404).json({message: err})
|
||||
}
|
||||
|
||||
module.exports.res500 = (res, err) => {
|
||||
return res.status(500).json({message: err})
|
||||
}
|
||||
|
||||
module.exports.checkValidations = validationResult => {
|
||||
return (req, res, next) => {
|
||||
const errors = validationResult(req)
|
||||
if (!errors.isEmpty()) return res.status(422).json({validation: errors.mapped()})
|
||||
else next()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.removeWhiteSpaces = str => {
|
||||
return str.replace(/ /g, '')
|
||||
}
|
||||
|
||||
module.exports.nameOptimizer = name => {
|
||||
function regex(str) {
|
||||
return new RegExp(str)
|
||||
}
|
||||
|
||||
return name
|
||||
.replace(regex('آقای'), '')
|
||||
.replace(regex('آقا'), '')
|
||||
.replace(regex('جنابه'), '')
|
||||
.replace(regex('جناب'), '')
|
||||
.replace(regex('سرکار خانوم'), '')
|
||||
.replace(regex('سرکار خانم'), '')
|
||||
.replace(regex('سرکارخانوم'), '')
|
||||
.replace(regex('سرکارخانومه'), '')
|
||||
.replace(regex('سرکارخانمه'), '')
|
||||
.replace(regex('سرکارخانم'), '')
|
||||
.replace(regex('سرکار'), '')
|
||||
.replace(regex('خانوم'), '')
|
||||
.replace(regex('خانم'), '')
|
||||
}
|
||||
|
||||
module.exports.checkNationalCode = code => {
|
||||
var L = code.length
|
||||
|
||||
if (L < 8 || parseInt(code, 10) == 0) return false
|
||||
code = ('0000' + code).substr(L + 4 - 10)
|
||||
if (parseInt(code.substr(3, 6), 10) == 0) return false
|
||||
var c = parseInt(code.substr(9, 1), 10)
|
||||
var s = 0
|
||||
for (var i = 0; i < 9; i++) {
|
||||
s += parseInt(code.substr(i, 1), 10) * (10 - i)
|
||||
}
|
||||
s = s % 11;
|
||||
return (s < 2 && c == s) || (s >= 2 && c == (11 - s))
|
||||
}
|
||||
|
||||
module.exports.isLatinCharactersWithoutSymbol = str => {
|
||||
return str.match(/^[A-Za-z]+$/g)
|
||||
}
|
||||
|
||||
module.exports.isLatinCharactersWithSymbol = str => {
|
||||
return str.match(/^[a-zA-Z0-9()*_\-!#$%^&*,."\'\][]*$/g)
|
||||
}
|
||||
|
||||
module.exports.hasWhiteSpaces = str => {
|
||||
return str.includes(' ')
|
||||
}
|
||||
|
||||
module.exports.generateRandomDigits = digitsLength => {
|
||||
var add = 1, max = 12 - add // 12 is the min safe number Math.random() can generate without it starting to pad the end with zeros.
|
||||
if (digitsLength > max) {
|
||||
return generateRandomDigits(max) + generateRandomDigits(digitsLength - max)
|
||||
}
|
||||
max = Math.pow(10, digitsLength + add)
|
||||
var min = max / 10 // Math.pow(10, n) basically
|
||||
var number = Math.floor(Math.random() * (max - min + 1)) + min
|
||||
|
||||
return ('' + number).substring(add)
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
const User = require('../models/User')
|
||||
const Project = require('../models/Project')
|
||||
const ProjectCategory = require('../models/ProjectCategory')
|
||||
|
||||
const minute = 1000 * 60
|
||||
const hour = minute * 60
|
||||
const day = hour * 24
|
||||
|
||||
module.exports = () => {
|
||||
// check users for activation
|
||||
// setInterval(() => {
|
||||
// User.find({confirmed: false})
|
||||
// .then(users => {
|
||||
// if (users.length) {
|
||||
// ///////////////////////
|
||||
// users.forEach((item, index) => {
|
||||
// // item time and timeout
|
||||
// const itemTime = Date.parse(item.created_at)
|
||||
// const timeout = itemTime + day
|
||||
// ////////////////////////////
|
||||
// if (Date.now() >= timeout) {
|
||||
// item.remove()
|
||||
// }
|
||||
// if (index === users.length - 1) {
|
||||
// // console.log('Unconfirmed users deleted.')
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// .catch(err => {
|
||||
// console.log(err)
|
||||
// })
|
||||
// }, hour)
|
||||
|
||||
|
||||
// Project.find({}, async (err, data) => {
|
||||
// if (err) console.log(err)
|
||||
//
|
||||
// let index = 0
|
||||
// for await (const item of data) {
|
||||
// console.log(index)
|
||||
// if (item.category === 'ward') {
|
||||
// // item.category = '61489de2c1646e4b68e42878'
|
||||
// await item.save()
|
||||
// }
|
||||
// index++
|
||||
// }
|
||||
//
|
||||
// })
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
// province cities
|
||||
const eastazarbaijan1 = ['آذرشهر', 'اسکو', 'اهر', 'بستانآباد', 'بناب', 'تبریز', 'جلفا', 'چاراویماق', 'سراب', 'شبستر', 'مراغه']
|
||||
const westazarbaijan2 = ['ارومیه', 'اشنویه', 'بوکان', 'پیرانشهر', 'تکاب', 'چالدران', 'خوی', 'سردشت', 'سلماس', 'شاهیندژ', 'ماکو', 'مهاباد', 'میاندوآب', 'نقده']
|
||||
const ardabil3 = ['اردبیل', 'بیلهسوار', 'پارسآباد', 'خلخال', 'کوثر', 'گِرمی', 'مِشگینشهر', 'نَمین', 'نیر']
|
||||
const esfahan4 = ['آران و بیدگل', 'اردستان', 'اصفهان', 'برخوار و میمه', 'تیران و کرون', 'چادگان', 'خمینیشهر', 'خوانسار', 'سمیرم', 'شهرضا', 'سمیرم سفلی', 'فریدن', 'فریدونشهر', 'فلاورجان', 'کاشان', 'گلپایگان', 'لنجان', 'مبارکه', 'نائین', 'نجفآباد', 'نطنز']
|
||||
const ilam5 = ['آبدانان', 'ایلام', 'ایوان', 'درهشهر', 'دهلران', 'شیروان و چرداول', 'مهران']
|
||||
const booshehr6 = ['بوشهر', 'تنگستان', 'جم', 'دشتستان', 'دشتی', 'دیر', 'دیلم', 'کنگان', 'گناوه']
|
||||
const tehran7 = ['اسلامشهر', 'پاکدشت', 'تهران', 'دماوند', 'رباطکریم', 'ری', 'ساوجبلاغ', 'شمیرانات', 'شهریار', 'فیروزکوه', 'ورامین']
|
||||
const chaharmahalobakhtiari8 = ['اردل', 'بروجن', 'شهرکرد', 'فارسان', 'کوهرنگ', 'لردگان']
|
||||
const khorasanjonoobi9 = ['بیرجند', 'درمیان', 'سرایان', 'سربیشه', 'فردوس', 'قائنات', 'نهبندان']
|
||||
const khorasanrazavi10 = ['بردسکن', 'تایباد', 'تربت جام', 'تربت حیدریه', 'چناران', 'خلیلآباد', 'خواف', 'درگز', 'رشتخوار', 'سبزوار', 'سرخس', 'فریمان', 'قوچان', 'کاشمر', 'کلات', 'گناباد', 'مشهد', 'مه ولات', 'نیشابور']
|
||||
const khorasanshomali11 = ['اسفراین', 'بجنورد', 'جاجرم', 'شیروان', 'فاروج', 'مانه و سملقان']
|
||||
const khoozestan12 = ['آبادان', 'امیدیه', 'اندیمشک', 'اهواز', 'ایذه', 'باغملک', 'بندر ماهشهر', 'بهبهان', 'خرمشهر', 'دزفول', 'دشت آزادگان', 'رامشیر', 'رامهرمز', 'شادگان', 'شوش', 'شوشتر']
|
||||
const zanjan13 = ['ابهر', 'ایجرود', 'خدابنده', 'خرمدره', 'زنجان', 'طارم', 'ماهنشان']
|
||||
const semnan14 = ['دامغان', 'سمنان', 'شاهرود', 'گرمسار', 'مهدیشهر']
|
||||
const sistanobaloochestan15 = ['ایرانشهر', 'چابهار', 'خاش', 'دلگان', 'زابل', 'زاهدان', 'زهک', 'سراوان', 'سرباز', 'کنارک', 'نیکشهر']
|
||||
const fars16 = ['آباده', 'ارسنجان', 'استهبان', 'اقلید', 'بوانات', 'پاسارگاد', 'جهرم', 'خرمبید', 'خنج', 'داراب', 'زریندشت', 'سپیدان', 'شیراز', 'فراشبند', 'فسا', 'فیروزآباد', 'قیر و کارزین', 'کازرون', 'لارستان', 'لامِرد', 'مرودشت', 'ممسنی', 'مهر', 'نیریز']
|
||||
const qazvin17 = ['آبیک', 'البرز', 'بوئینزهرا', 'تاکستان', 'قزوین']
|
||||
const qom18 = ['قم']
|
||||
const kordestan19 = ['بانه', 'بیجار', 'دیواندره', 'سروآباد', 'سقز', 'سنندج', 'قروه', 'کامیاران', 'مریوان']
|
||||
const kerman20 = ['بافت', 'بردسیر', 'بم', 'جیرفت', 'راور', 'رفسنجان', 'رودبار جنوب', 'زرند', 'سیرجان', 'شهر بابک', 'عنبرآباد', 'قلعه گنج', 'کرمان', 'کوهبنان', 'کهنوج', 'منوجان']
|
||||
const kermanshah21 = ['اسلامآباد غرب', 'پاوه', 'ثلاث باباجانی', 'جوانرود', 'دالاهو', 'روانسر', 'سرپل ذهاب', 'سنقر', 'صحنه', 'قصر شیرین', 'کرمانشاه', 'کنگاور', 'گیلان غرب', 'هرسین']
|
||||
const kohkilooyevaboyrahmad22 = ['بویراحمد', 'بهمئی', 'دنا', 'کهگیلویه', 'گچساران']
|
||||
const golestan23 = ['آزادشهر', 'آققلا', 'بندر گز', 'ترکمن', 'رامیان', 'علیآباد', 'کردکوی', 'کلاله', 'گرگان', 'گنبد کاووس', 'مراوهتپه', 'مینودشت']
|
||||
const gilan24 = ['آستارا', 'آستانه اشرفیه', 'اَملَش', 'بندر انزلی', 'رشت', 'رضوانشهر', 'رودبار', 'رودسر', 'سیاهکل', 'شَفت', 'صومعهسرا', 'طوالش', 'فومَن', 'لاهیجان', 'لنگرود', 'ماسال']
|
||||
const lorestan25 = ['ازنا', 'الیگودرز', 'بروجرد', 'پلدختر', 'خرمآباد', 'دورود', 'دلفان', 'سلسله ,کوهدشت']
|
||||
const mazandaran26 = ['آمل', 'بابل', 'بابلسر', 'بهشهر', 'تنکابن', 'جویبار', 'چالوس', 'رامسر', 'ساری', 'سوادکوه', 'قائمشهر', 'گلوگاه', 'محمودآباد', 'نکا', 'نور', 'نوشهر']
|
||||
const markazi27 = ['آشتیان', 'اراک', 'تفرش', 'خمین', 'دلیجان', 'زرندیه', 'ساوه', 'شازند', 'کمیجان', 'محلات']
|
||||
const hormozgan28 = ['ابوموسی', 'بستک', 'بندر عباس', 'بندر لنگه', 'جاسک', 'حاجیآباد', 'شهرستان خمیر', 'رودان', 'قشم', 'گاوبندی', 'میناب']
|
||||
const hamedan29 = ['اسدآباد', 'بهار', 'تویسرکان', 'رزن', 'کبودرآهنگ', 'ملایر', 'نهاوند', 'همدان']
|
||||
const yazd30 = ['ابرکوه', 'اردکان', 'بافق', 'تفت', 'خاتم', 'صدوق', 'طبس', 'مهریز', 'مِیبُد', 'یزد']
|
||||
const alborz31 = ['کرج', 'نظرآباد', 'فردیس', 'اشتهارد', 'هشتگرد', 'طالقان']
|
||||
|
||||
|
||||
// provinces list
|
||||
module.exports.iranCities = [
|
||||
{
|
||||
name: 'آذربایجان شرقی',
|
||||
cities: eastazarbaijan1
|
||||
},
|
||||
{
|
||||
name: 'آذربایجان غربی',
|
||||
cities: westazarbaijan2
|
||||
},
|
||||
{
|
||||
name: 'اردبیل',
|
||||
cities: ardabil3
|
||||
},
|
||||
{
|
||||
name: 'اصفهان',
|
||||
cities: esfahan4
|
||||
},
|
||||
{
|
||||
name: 'ایلام',
|
||||
cities: ilam5
|
||||
},
|
||||
{
|
||||
name: 'بوشهر',
|
||||
cities: booshehr6
|
||||
},
|
||||
{
|
||||
name: 'تهران',
|
||||
cities: tehran7
|
||||
},
|
||||
{
|
||||
name: 'چهارمحال بختیاری',
|
||||
cities: chaharmahalobakhtiari8
|
||||
},
|
||||
{
|
||||
name: 'خراسان جنوبی',
|
||||
cities: khorasanjonoobi9
|
||||
},
|
||||
{
|
||||
name: 'خراسان رضوی',
|
||||
cities: khorasanrazavi10
|
||||
},
|
||||
{
|
||||
name: 'خراسان شمالی',
|
||||
cities: khorasanshomali11
|
||||
},
|
||||
{
|
||||
name: 'خوزستان',
|
||||
cities: khoozestan12
|
||||
},
|
||||
{
|
||||
name: 'زنجان',
|
||||
cities: zanjan13
|
||||
},
|
||||
{
|
||||
name: 'سمنان',
|
||||
cities: semnan14
|
||||
},
|
||||
{
|
||||
name: 'سیستان بلوچستان',
|
||||
cities: sistanobaloochestan15
|
||||
},
|
||||
{
|
||||
name: 'فارس',
|
||||
cities: fars16
|
||||
},
|
||||
{
|
||||
name: 'قزوین',
|
||||
cities: qazvin17
|
||||
},
|
||||
{
|
||||
name: 'قم',
|
||||
cities: qom18
|
||||
},
|
||||
{
|
||||
name: 'کردستان',
|
||||
cities: kordestan19
|
||||
},
|
||||
{
|
||||
name: 'کرمان',
|
||||
cities: kerman20
|
||||
},
|
||||
{
|
||||
name: 'کرمانشاه',
|
||||
cities: kermanshah21
|
||||
},
|
||||
{
|
||||
name: 'کهکیلویه و بویراحمد',
|
||||
cities: kohkilooyevaboyrahmad22
|
||||
},
|
||||
{
|
||||
name: 'گلستان',
|
||||
cities: golestan23
|
||||
},
|
||||
{
|
||||
name: 'گیلان',
|
||||
cities: gilan24
|
||||
},
|
||||
{
|
||||
name: 'لرستان',
|
||||
cities: lorestan25
|
||||
},
|
||||
{
|
||||
name: 'مازندران',
|
||||
cities: mazandaran26
|
||||
},
|
||||
{
|
||||
name: 'مرکزی',
|
||||
cities: markazi27
|
||||
},
|
||||
{
|
||||
name: 'هرمزگان',
|
||||
cities: hormozgan28
|
||||
},
|
||||
{
|
||||
name: 'همدان',
|
||||
cities: hamedan29
|
||||
},
|
||||
{
|
||||
name: 'یزد',
|
||||
cities: yazd30
|
||||
},
|
||||
{
|
||||
name: 'البرز',
|
||||
cities: alborz31
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
module.exports = [
|
||||
{
|
||||
name: 'مدیریت کاربران',
|
||||
value: 'users'
|
||||
},
|
||||
{
|
||||
name: 'مشاهده پیام های تماس با ما',
|
||||
value: 'contact-us'
|
||||
},
|
||||
{
|
||||
name: 'مدیریت سوالات متداول',
|
||||
value: 'faq'
|
||||
},
|
||||
{
|
||||
name: 'مدیریت تیکت ها',
|
||||
value: 'tickets'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,31 @@
|
||||
const User = require('../models/User')
|
||||
const _privateAdminInfo = require('./privateAdminData')
|
||||
const bcrypt = require('bcryptjs')
|
||||
const database = require('../database')
|
||||
|
||||
module.exports.createAdmins = () => {
|
||||
database.once('open', async cb => {
|
||||
for (const item of _privateAdminInfo) {
|
||||
try {
|
||||
const user = await User.findOne({username: item.username})
|
||||
if (!user) {
|
||||
const data = {
|
||||
username: item.username,
|
||||
scope: ['admin']
|
||||
}
|
||||
// hash password
|
||||
const salt = await bcrypt.genSalt(10)
|
||||
const hash = await bcrypt.hash(item.password, salt)
|
||||
data.password = hash
|
||||
const newUser = new User(data)
|
||||
newUser.save(err => {
|
||||
if (err) console.log(err)
|
||||
})
|
||||
}
|
||||
} catch
|
||||
(e) {
|
||||
console.log('Private admin creation has error -- ', e)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
////////////////////////////////// example
|
||||
//////////////////////////////////
|
||||
// module.exports = [
|
||||
// {
|
||||
// first_name: '',
|
||||
// last_name: '',
|
||||
// username: '',
|
||||
// password: ''
|
||||
// },
|
||||
// {
|
||||
// first_name: '',
|
||||
// last_name: '',
|
||||
// username: '',
|
||||
// password: ''
|
||||
// }
|
||||
// ]
|
||||
////////////////////////////////////
|
||||
//////////////////////////////////// example
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
// *remove data from this file after first run* //
|
||||
//////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
|
||||
module.exports = [
|
||||
// {
|
||||
// username: 'negareh_support',
|
||||
// password: '@admin1234'
|
||||
// },
|
||||
// {
|
||||
// username: 'orisoxin_admin',
|
||||
// password: '#fDeRTT@%!'
|
||||
// }
|
||||
]
|
||||
@@ -0,0 +1,750 @@
|
||||
module.exports._sr = {
|
||||
fa: {
|
||||
required: {
|
||||
token: 'توکن را وارد کنید',
|
||||
field: 'این فیلد نباید خالی باشد',
|
||||
// developer validations
|
||||
remember_me: 'پارامتر remember_me الزامی است',
|
||||
// registration validations
|
||||
name: 'نام را وارد کنید',
|
||||
first_name: 'نام را وارد کنید',
|
||||
last_name: 'نام خانوادگی را وارد کنید',
|
||||
email: 'ایمیل را وارد کنید',
|
||||
national_code: 'کد ملی الزامی است',
|
||||
email_personal: 'ایمیل شخصی الزامی است',
|
||||
email_company: 'ایمیل کمپانی برای اشخاص حقوقی الزامی است',
|
||||
company_name: 'درصورتی که شخص حقوقی هستید، نام کمپانی را وارد کنید',
|
||||
username: 'نام کاربری را وارد کنید',
|
||||
phone_number: 'شماره تماس را وارد کنید',
|
||||
password: 'پسورد را وارد کنید',
|
||||
birthdate: 'تاریخ تولد را وارد کنید',
|
||||
// addressing validations
|
||||
country: 'کشور را وارد کنید',
|
||||
province: 'استان را وارد کنید',
|
||||
city: 'شهر را وارد کنید',
|
||||
address: 'آدرس را وارد کنید',
|
||||
postal_code: 'کد پستی را وارد کنید',
|
||||
plaque: 'پلاک را وارد کنید',
|
||||
receiver_first_name: 'نام گیرنده را وارد کنید',
|
||||
receiver_last_name: 'نام خانوادگی گیرنده را وارد کنید',
|
||||
receiver_mobile: 'شماره موبایل گیرنده را وارد کنید',
|
||||
// global (post - gallery - ...)
|
||||
title: 'عنوان را وارد کنید',
|
||||
caption: 'متن را وارد کنید',
|
||||
description: 'توضیحات را وارد کنید',
|
||||
category: 'دسته بندی را انتخاب کنید',
|
||||
image: 'عکس اجباری است',
|
||||
cover: 'کاور اجباری است',
|
||||
file: 'فایل اجباری است',
|
||||
message: 'پیام را بنویسید',
|
||||
quantity: 'تعداد را وارد کنید',
|
||||
date: 'تاریخ را وارد کنید',
|
||||
reason: 'دلیل را انتخاب کنید',
|
||||
question: 'سوال را بنویسید',
|
||||
answer: 'جواب را بنویسید',
|
||||
price: 'قیمت را وارد کنید',
|
||||
type: 'نوع را انتخاب کنید',
|
||||
discount_code: 'کد تخفیف را وارد کنید',
|
||||
discount_amount: 'مقدار تخفیف را وارد کنید',
|
||||
discount_expire_date: 'تاریخ انقضای کد تخفیف را مشخص کنید',
|
||||
user_id: 'کاربر را انتخاب کنید',
|
||||
video: 'ویدیو اجباری است',
|
||||
subject: 'موضوع را وارد کنید'
|
||||
|
||||
},
|
||||
format: {
|
||||
phone_number: 'فرمت شماره تماس صحیح نیست',
|
||||
email: 'فرمت ایمیل قابل قبول نیست',
|
||||
number: 'مقدار باید از جنس عدد باشد',
|
||||
boolean: 'مقدار باید از جنس Boolean باشد',
|
||||
image: 'فرمت عکس قابل قبول نیست',
|
||||
video: 'فرمت ویدیو قابل قبول نیست',
|
||||
national_code: 'کد ملی صحیح نیست'
|
||||
},
|
||||
min_char: {
|
||||
min2: 'حداقل 2 کاراکتر',
|
||||
min4: 'حداقل 4 کاراکتر',
|
||||
min8: 'حداقل 8 کاراکتر',
|
||||
min10: 'حداقل 10 کاراکتر',
|
||||
min20: 'حداقل 20 کاراکتر',
|
||||
min30: 'حداقل 30 کاراکتر',
|
||||
min40: 'حداقل 40 کاراکتر',
|
||||
min50: 'حداقل 50 کاراکتر',
|
||||
min60: 'حداقل 60 کاراکتر',
|
||||
min100: 'حداقل 100 کاراکتر',
|
||||
min120: 'حداقل 120 کاراکتر',
|
||||
min150: 'حداقل 150 کاراکتر',
|
||||
min200: 'حداقل 200 کاراکتر',
|
||||
data_size: 'حجم قابل قبول حداقل: ',
|
||||
image_width_size: 'عرض حداقل: ',
|
||||
image_height_size: 'ارتفاع حداقل: ',
|
||||
},
|
||||
max_char: {
|
||||
max4: 'حداکثر 4 کاراکتر',
|
||||
max8: 'حداکثر 8 کاراکتر',
|
||||
max10: 'حداکثر 10 کاراکتر',
|
||||
max15: 'حداکثر 15 کاراکتر',
|
||||
max20: 'حداکثر 20 کاراکتر',
|
||||
max30: 'حداکثر 30 کاراکتر',
|
||||
max40: 'حداکثر 40 کاراکتر',
|
||||
max50: 'حداکثر 50 کاراکتر',
|
||||
max60: 'حداکثر 60 کاراکتر',
|
||||
max100: 'حداکثر 100 کاراکتر',
|
||||
max120: 'حداکثر 120 کاراکتر',
|
||||
max150: 'حداکثر 150 کاراکتر',
|
||||
max200: 'حداکثر 200 کاراکتر',
|
||||
data_size: 'حجم قابل قبول حداکثر: ',
|
||||
image_width_size: 'عرض حداکثر: ',
|
||||
image_height_size: 'ارتفاع حداکثر: ',
|
||||
},
|
||||
not_found: {
|
||||
user_id: 'کاربری با این مشخصات وجود ندارد',
|
||||
admin_id: 'ادمینی با این مشخصات وجود ندارد',
|
||||
order_id: 'سفارشی با این مشخصات وجود ندارد',
|
||||
item_id: 'موردی با این مشخصات وجود ندارد',
|
||||
password: 'رمز عبور یا آیدی درست نیست'
|
||||
},
|
||||
duplicated: {
|
||||
username: 'این نام کاربری از قبل وجود دارد',
|
||||
email: 'این ایمیل از قبل وجود دارد',
|
||||
name: 'نام تکراری است',
|
||||
title: 'عنوان تکراری است',
|
||||
phone_number: 'این شماره تماس از قبل وجود دارد'
|
||||
},
|
||||
response: {
|
||||
logged_in: 'شما وارد سیستم شدید',
|
||||
not_logged_in: 'شما وارد سیستم نشدید',
|
||||
logged_out: 'شما از سیستم خارج شدید',
|
||||
unauthenticated: 'غیرمجاز',
|
||||
recovery_link: 'لینک بازیابی فرستاده شد',
|
||||
success_save: 'با موفقیت ثبت شد',
|
||||
success_remove: 'با موفقیت حذف شد',
|
||||
cart_empty: 'سبد خرید خالی است',
|
||||
already_has_address: 'آدرس قبلا اضافه شده',
|
||||
activation_code: 'کد فعالسازی برای شما ارسال شد',
|
||||
activation_email: 'ایمیل فعال سازی برای شما ارسال شد',
|
||||
expired_reset_link: 'این لینک بازیابی منقضی شده است',
|
||||
email_not_confirmed: 'ابتدا ایمیل خود را تایید کنید،لینک فعال سازی قبلا برای شما فرستاده شده است.',
|
||||
expired_activation_link: 'این لینک فعال سازی منقضی شده است',
|
||||
success_activation: 'اکانت شما با موفقیت فعال شد',
|
||||
passwords_not_match: 'پسورد ها یکی نیست',
|
||||
problem: 'مشکلی پیش آمده، لطفا دوباره تلاش کنید.',
|
||||
latinChar: 'لطفا با حروف لاتین بنویسید',
|
||||
persianChar: 'لطفا با حروف فارسی بنویسید',
|
||||
whiteSpace: 'بین حروف و کلمات نباید فاصله باشد'
|
||||
},
|
||||
file_types: {
|
||||
jpg: 'فقط فرمت jpg قابل قبول است',
|
||||
png: 'فقط فرمت png قابل قبول است',
|
||||
gif: 'فقط فرمت gif قابل قبول است',
|
||||
pdf: 'فقط فرمت pdf قابل قبول است',
|
||||
txt: 'فقط فرمت txt قابل قبول است',
|
||||
log: 'فقط فرمت log قابل قبول است',
|
||||
mp3: 'فقط فرمت mp3 قابل قبول است',
|
||||
ogg: 'فقط فرمت ogg قابل قبول است',
|
||||
wmv: 'فقط فرمت wmv قابل قبول است',
|
||||
mp4: 'فقط فرمت mp4 قابل قبول است',
|
||||
mov: 'فقط فرمت mov قابل قبول است',
|
||||
mkv: 'فقط فرمت mkv قابل قبول است',
|
||||
flv: 'فقط فرمت flv قابل قبول است'
|
||||
}
|
||||
},
|
||||
en: {
|
||||
required: {
|
||||
token: 'Token is required',
|
||||
field: 'This field is required',
|
||||
// developer validations
|
||||
remember_me: 'Remember_me parameter required',
|
||||
// registration validations
|
||||
name: 'Enter name',
|
||||
first_name: 'Enter first name',
|
||||
last_name: 'Enter last name',
|
||||
national_code: 'National code is required',
|
||||
email: 'Enter email',
|
||||
email_personal: 'Personal email is required',
|
||||
email_company: 'Company email is required for legal entities',
|
||||
company_name: 'Enter company name if you are a legal entity',
|
||||
username: 'Enter username',
|
||||
phone_number: 'Enter phone number',
|
||||
password: 'Enter password',
|
||||
birthdate: 'Enter birthdate',
|
||||
// addressing validations
|
||||
country: 'Enter country',
|
||||
province: 'Enter province',
|
||||
city: 'Enter city',
|
||||
address: 'Enter address',
|
||||
postal_code: 'Enter postal code',
|
||||
plaque: 'Enter plaque',
|
||||
receiver_first_name: 'Enter recipient name',
|
||||
receiver_last_name: 'Enter recipient surname',
|
||||
receiver_mobile: 'Enter recipient\'s mobile number',
|
||||
// global (post - gallery - ...)
|
||||
title: 'Enter title',
|
||||
caption: 'Enter caption',
|
||||
description: 'Enter description',
|
||||
category: 'Select category',
|
||||
image: 'Image is required',
|
||||
cover: 'Cover is required',
|
||||
file: 'File is required',
|
||||
message: 'Write message',
|
||||
quantity: 'Enter quantity',
|
||||
date: 'Enter date',
|
||||
reason: 'Select reason',
|
||||
question: 'Write the question',
|
||||
answer: 'Write the answer',
|
||||
price: 'Enter Price',
|
||||
type: 'Select type',
|
||||
discount_code: 'Enter discount code',
|
||||
discount_amount: 'Enter discount amount',
|
||||
discount_expire_date: 'Specify discount code expiration date',
|
||||
user_id: 'Select user',
|
||||
video: 'Video is required',
|
||||
subject: 'Enter subject'
|
||||
},
|
||||
format: {
|
||||
phone_number: 'Phone number format in incorrect',
|
||||
email: 'Email format is not correct',
|
||||
number: 'Value must be number',
|
||||
boolean: 'Value must be Boolean',
|
||||
image: 'Photo format is not acceptable',
|
||||
video: 'Video format is not acceptable',
|
||||
national_code: 'National code format is not correct'
|
||||
},
|
||||
min_char: {
|
||||
min2: 'At least 2 characters',
|
||||
min4: 'At least 4 characters',
|
||||
min8: 'At least 8 characters',
|
||||
min10: 'At least 10 characters',
|
||||
min20: 'At least 20 characters',
|
||||
min30: 'At least 30 characters',
|
||||
min40: 'At least 40 characters',
|
||||
min50: 'At least 50 characters',
|
||||
min60: 'At least 60 characters',
|
||||
min100: 'At least 100 characters',
|
||||
min120: 'At least 120 characters',
|
||||
min150: 'At least 150 characters',
|
||||
min200: 'At least 200 characters',
|
||||
data_size: 'Acceptable minimum size: ',
|
||||
image_width_size: 'Minimum width: ',
|
||||
image_height_size: 'Minimum height: ',
|
||||
},
|
||||
max_char: {
|
||||
max4: 'Maximum 4 characters',
|
||||
max8: 'Maximum 8 characters',
|
||||
max10: 'Maximum 10 characters',
|
||||
max15: 'Maximum 15 characters',
|
||||
max20: 'Maximum 20 characters',
|
||||
max30: 'Maximum 30 characters',
|
||||
max40: 'Maximum 40 characters',
|
||||
max50: 'Maximum 50 characters',
|
||||
max60: 'Maximum 60 characters',
|
||||
max100: 'Maximum 100 characters',
|
||||
max120: 'Maximum 120 characters',
|
||||
max150: 'Maximum 150 characters',
|
||||
max200: 'Maximum 200 characters',
|
||||
data_size: 'Maximum acceptable size: ',
|
||||
image_width_size: 'Maximum width: ',
|
||||
image_height_size: 'Maximum height: ',
|
||||
},
|
||||
not_found: {
|
||||
user_id: 'There is no user with this profile',
|
||||
admin_id: 'There is no admin with this profile',
|
||||
order_id: 'There is no order with this profile',
|
||||
item_id: 'There is no item with this specification',
|
||||
password: 'Password or ID is incorrect'
|
||||
},
|
||||
duplicated: {
|
||||
username: 'This username already exists',
|
||||
email: 'This email already exists',
|
||||
name: 'Name already exists',
|
||||
title: 'Title already exists',
|
||||
phone_number: 'Phone number already exists'
|
||||
},
|
||||
response: {
|
||||
logged_in: 'You are logged in',
|
||||
not_logged_in: 'You are not logged in',
|
||||
logged_out: 'You are logged out',
|
||||
unauthenticated: 'unauthenticated',
|
||||
recovery_link: 'Recovery link sent',
|
||||
success_save: 'Successfully saved',
|
||||
success_remove: 'Successfully removed',
|
||||
cart_empty: 'Cart is empty',
|
||||
already_has_address: 'Already has address',
|
||||
activation_code: 'Activation code sent to you',
|
||||
activation_email: 'Activation email sent to you',
|
||||
expired_reset_link: 'The current reset pass link has been expired',
|
||||
email_not_confirmed: 'Confirm your email first, the activation link has already been sent to you.',
|
||||
expired_activation_link: 'This activation link has expired',
|
||||
success_activation: 'Your account has been successfully activated',
|
||||
passwords_not_match: 'Passwords are not the same',
|
||||
problem: 'There is a problem, please try again.',
|
||||
latinChar: 'Please write in Latin letters',
|
||||
persianChar: 'Please write in Persian letters',
|
||||
whiteSpace: 'There should be no space between letters and words'
|
||||
},
|
||||
file_types: {
|
||||
jpg: 'Only jpg format is acceptable',
|
||||
png: 'Only png format is acceptable',
|
||||
gif: 'Only gif format is acceptable',
|
||||
pdf: 'Only pdf format is acceptable',
|
||||
txt: 'Only txt format is acceptable',
|
||||
log: 'Only log format is acceptable',
|
||||
mp3: 'Only mp3 format is acceptable',
|
||||
ogg: 'Only ogg format is acceptable',
|
||||
wmv: 'Only wmv format is acceptable',
|
||||
mp4: 'Only mp4 format is acceptable',
|
||||
mov: 'Only mov format is acceptable',
|
||||
mkv: 'Only mkv format is acceptable',
|
||||
flv: 'Only flv format is acceptable'
|
||||
}
|
||||
},
|
||||
de: {
|
||||
required: {
|
||||
token: 'Token is required',
|
||||
field: 'This field is required',
|
||||
// developer validations
|
||||
remember_me: 'Remember_me-Parameter erforderlich',
|
||||
// registration validations
|
||||
name: 'Name eingeben',
|
||||
first_name: 'Name eingeben',
|
||||
last_name: 'Nachnamen eingeben',
|
||||
national_code: "Nationaler Code ist erforderlich",
|
||||
email: 'Email eingeben',
|
||||
email_personal: 'Persönliche E-Mail ist erforderlich',
|
||||
email_company: 'Für juristische Personen ist eine Unternehmens-E-Mail erforderlich',
|
||||
company_name: 'Geben Sie den Firmennamen ein, wenn Sie eine juristische Person sind',
|
||||
username: 'Geben Sie den Benutzernamen ein',
|
||||
phone_number: 'Telefonnummer eingeben',
|
||||
password: 'Passwort eingeben',
|
||||
birthdate: 'Enter birthdate',
|
||||
// addressing validations
|
||||
country: 'Land eingeben',
|
||||
province: 'Stadt betreten',
|
||||
city: 'Stadt betreten',
|
||||
address: 'Adresse eingeben',
|
||||
postal_code: 'Postleitzahl eingeben',
|
||||
plaque: 'Plakette eingeben',
|
||||
receiver_first_name: 'Empfängername eingeben',
|
||||
receiver_last_name: 'Nachname des Empfängers eingeben',
|
||||
receiver_mobile: 'Handynummer des Empfängers eingebenr',
|
||||
// global (post - gallery - ...)
|
||||
title: 'Titel eingeben',
|
||||
caption: 'Beschriftung eingeben',
|
||||
description: 'Beschreibung eingeben',
|
||||
category: 'Kategorie wählen',
|
||||
image: 'Bild ist erforderlich',
|
||||
cover: 'Bild ist erforderlich Abdeckung ist erforderlich',
|
||||
file: 'Datei ist erforderlich',
|
||||
message: 'Nachricht schreiben',
|
||||
quantity: 'Menge eingeben',
|
||||
date: 'Enter date',
|
||||
reason: 'Grund auswählen',
|
||||
question: 'Schreibe die Frage',
|
||||
answer: 'Schreibe die Antwort',
|
||||
price: 'Enter Price',
|
||||
type: 'Select type',
|
||||
discount_code: 'Enter discount code',
|
||||
discount_amount: 'Enter discount amount',
|
||||
discount_expire_date: 'Specify discount code expiration date',
|
||||
user_id: 'Select user',
|
||||
video: 'Video is required',
|
||||
subject: 'Enter subject'
|
||||
},
|
||||
format: {
|
||||
phone_number: 'Telefonnummernformat falsch',
|
||||
email: 'E-Mail-Format nicht korrekt',
|
||||
number: 'Wert muss Nummer sein',
|
||||
boolean: 'Wert muss Boolescher Wert sein',
|
||||
image: 'Photo format is not acceptable',
|
||||
video: 'Video format is not acceptable',
|
||||
national_code: "Nationales Codeformat ist nicht korrekt"
|
||||
},
|
||||
min_char: {
|
||||
min2: 'Mindestens 2 Zeichen',
|
||||
min4: 'Mindestens 4 Zeichen',
|
||||
min8: 'Mindestens 8 Zeichen',
|
||||
min10: 'Mindestens 10 Zeichen',
|
||||
min20: 'Mindestens 20 Zeichen',
|
||||
min30: 'Mindestens 30 Zeichen',
|
||||
min40: 'Mindestens 40 Zeichen',
|
||||
min50: 'Mindestens 50 Zeichen',
|
||||
min60: 'Mindestens 60 Zeichen',
|
||||
min100: 'Mindestens 100 Zeichen',
|
||||
min120: 'Mindestens 120 Zeichen',
|
||||
min150: 'Mindestens 150 Zeichen',
|
||||
min200: 'Mindestens 200 Zeichen',
|
||||
data_size: 'Akzeptable Mindestgröße: ',
|
||||
image_width_size: 'Mindestbreite: ',
|
||||
image_height_size: 'Mindesthöhe: ',
|
||||
},
|
||||
max_char: {
|
||||
max4: 'Maximal 4 Zeichen',
|
||||
max8: 'Maximal 8 Zeichen',
|
||||
max10: 'Maximal 10 Zeichen',
|
||||
max15: 'Maximal 15 Zeichen',
|
||||
max20: 'Maximal 20 Zeichen',
|
||||
max30: 'Maximal 30 Zeichen',
|
||||
max40: 'Maximal 40 Zeichen',
|
||||
max50: 'Maximal 50 Zeichen',
|
||||
max60: 'Maximal 60 Zeichen',
|
||||
max100: 'Maximal 100 Zeichen',
|
||||
max120: 'Maximal 120 Zeichen',
|
||||
max150: 'Maximal 150 Zeichen',
|
||||
max200: 'Maximal 200 Zeichen',
|
||||
data_size: 'Maximal zulässige Größe: ',
|
||||
image_width_size: 'Maximale Breite: ',
|
||||
image_height_size: 'Maximale Höhe: ',
|
||||
},
|
||||
not_found: {
|
||||
user_id: 'Es gibt keinen Benutzer mit diesem Profil',
|
||||
admin_id: 'Es gibt keinen Administrator mit diesem Profil',
|
||||
order_id: 'Es gibt keine Bestellung mit diesem Profil',
|
||||
item_id: 'Es gibt keinen Artikel mit dieser Spezifikation',
|
||||
password: 'Passwort oder ID ist falsch'
|
||||
},
|
||||
duplicated: {
|
||||
username: 'Dieser Benutzername existiert bereits',
|
||||
email: 'Diese E-Mail existiert bereits',
|
||||
name: 'Name ist doppelt',
|
||||
title: 'Titel ist doppelt',
|
||||
phone_number: 'Phone number already exists'
|
||||
},
|
||||
response: {
|
||||
logged_in: 'Sie sind angemeldet',
|
||||
not_logged_in: 'Sie sind nicht angemeldet',
|
||||
logged_out: 'Sie sind abgemeldet',
|
||||
unauthenticated: 'nicht authentifiziert',
|
||||
recovery_link: 'Wiederherstellungslink gesendet',
|
||||
success_save: 'Erfolgreich gespeichert',
|
||||
success_remove: 'Erfolgreich entfernt',
|
||||
cart_empty: 'Warenkorb ist leer',
|
||||
ready_has_address: 'Hat bereits Adresse',
|
||||
activation_code: 'Activation code sent to you',
|
||||
activation_email: 'Activation email sent to you',
|
||||
expired_reset_link: 'Der aktuelle Reset-Pass-Link ist abgelaufen',
|
||||
email_not_confirmed: "Bestätigen Sie zuerst Ihre E-Mail, der Aktivierungslink wurde bereits an Sie gesendet.",
|
||||
expired_activation_link: 'Dieser Aktivierungslink ist abgelaufen',
|
||||
success_activation: 'Ihr Konto wurde erfolgreich aktiviert',
|
||||
passwords_not_match: 'Passwörter sind nicht dasselbe',
|
||||
problem: "Es gibt ein Problem, bitte versuchen Sie es erneut.",
|
||||
latinChar: 'Please write in Latin letters',
|
||||
persianChar: 'Please write in Persian letters',
|
||||
whiteSpace: 'There should be no space between letters and words'
|
||||
},
|
||||
file_types: {
|
||||
jpg: 'Nur das jpg-Format ist akzeptabel',
|
||||
png: 'Nur das png-Format ist akzeptabel',
|
||||
gif: 'Nur das gif-Format ist akzeptabel',
|
||||
pdf: 'Nur das PDF-Format ist akzeptabel',
|
||||
txt: 'Nur das txt-Format ist akzeptabel',
|
||||
log: 'Nur das log-Format ist akzeptabel',
|
||||
mp3: 'Nur das mp3-Format ist akzeptabel',
|
||||
ogg: 'Nur das ogg-Format ist akzeptabel',
|
||||
wmv: 'Nur das wmv-Format ist akzeptabel',
|
||||
mp4: 'Nur das mp4-Format ist akzeptabel',
|
||||
mov: 'Nur das mov-Format ist akzeptabel',
|
||||
mkv: 'Nur das mkv-Format ist akzeptabel',
|
||||
flv: 'Nur das flv-Format ist akzeptabel'
|
||||
}
|
||||
},
|
||||
tr: {
|
||||
required: {
|
||||
token: 'Token is required',
|
||||
field: 'This field is required',
|
||||
// geliştirici doğrulamaları
|
||||
Remember_me: 'Remember_me parametresi gerekli',
|
||||
// kayıt doğrulamaları
|
||||
name: 'Adı girin',
|
||||
first_name: 'Adı girin',
|
||||
last_name: 'Soyadı girin',
|
||||
national_code: "Nationaler Kodu erforderlich",
|
||||
email: 'E-posta girin',
|
||||
email_personal: 'Kişisel e-posta gereklidir',
|
||||
email_company: 'Tüzel kişiler için şirket e-postası gereklidir',
|
||||
company_name: 'Tüzel kişiyseniz şirket adını girin',
|
||||
username: 'Kullanıcı adını girin',
|
||||
phone_number: 'Telefon numarasını girin',
|
||||
password: 'Şifre girin',
|
||||
birthdate: 'Enter birthdate',
|
||||
// doğrulamaları adresleme
|
||||
country: 'Ülke girin',
|
||||
province: 'İl girin',
|
||||
city: 'Şehir girin',
|
||||
address: 'Adres girin',
|
||||
postal_code: 'Posta kodunu girin',
|
||||
plaque: 'Plak girin',
|
||||
receiver_first_name: 'Alıcı adını girin',
|
||||
receiver_last_name: 'Alıcının soyadını girin',
|
||||
receiver_mobile: 'Alıcının cep telefonu numarasını girin',
|
||||
// global (post - galeri - ...)
|
||||
title: 'Başlığı girin',
|
||||
caption: 'Başlık girin',
|
||||
description: 'Açıklama girin',
|
||||
category: 'Kategori seçin',
|
||||
image: 'Resim gerekli',
|
||||
cover: 'Kapak gereklidir',
|
||||
file: 'Dosya gerekli',
|
||||
message: 'Mesaj yaz',
|
||||
quantity: 'Miktar girin',
|
||||
date: 'Enter date',
|
||||
reason: 'Nedeni seçin',
|
||||
question: 'Soruyu yazın',
|
||||
answer: 'Cevabı yaz',
|
||||
price: 'Enter Price',
|
||||
type: 'Select type',
|
||||
discount_code: 'Enter discount code',
|
||||
discount_amount: 'Enter discount amount',
|
||||
discount_expire_date: 'Specify discount code expiration date',
|
||||
user_id: 'Select user',
|
||||
video: 'Video is required',
|
||||
subject: 'Enter subject'
|
||||
},
|
||||
format: {
|
||||
phone_number: 'Telefon numarası biçimi yanlış',
|
||||
email: 'E-posta formatı doğru değil',
|
||||
number: 'Değer sayı olmalıdır',
|
||||
boolean: 'Değer Boole olmalıdır',
|
||||
image: 'Photo format is not acceptable',
|
||||
video: 'Video format is not acceptable',
|
||||
national_code: 'Ulusal kod formatı doğru değil'
|
||||
},
|
||||
min_char: {
|
||||
min2: 'En az 2 karakter',
|
||||
min4: 'En az 4 karakter',
|
||||
min8: 'En az 8 karakter',
|
||||
min10: 'En az 10 karakter',
|
||||
min20: 'En az 20 karakter',
|
||||
min30: 'En az 30 karakter',
|
||||
min40: 'En az 40 karakter',
|
||||
min50: 'En az 50 karakter',
|
||||
min60: 'En az 60 karakter',
|
||||
min100: 'En az 100 karakter',
|
||||
min120: 'En az 120 karakter',
|
||||
min150: 'En az 150 karakter',
|
||||
min200: 'En az 200 karakter',
|
||||
data_size: 'Kabul edilebilir minimum boyut: ',
|
||||
image_width_size: 'Minimum genişlik: ',
|
||||
image_height_size: 'Minimum yükseklik: ',
|
||||
},
|
||||
max_char: {
|
||||
max4: 'Maksimum 4 karakter',
|
||||
max8: 'Maksimum 8 karakter',
|
||||
max10: 'Maksimum 10 karakter',
|
||||
max15: 'Maksimum 15 karakter',
|
||||
max20: 'Maksimum 20 karakter',
|
||||
max30: 'Maksimum 30 karakter',
|
||||
max40: 'Maksimum 40 karakter',
|
||||
max50: 'Maksimum 50 karakter',
|
||||
max60: 'Maksimum 60 karakter',
|
||||
max100: 'Maksimum 100 karakter',
|
||||
max120: 'Maksimum 120 karakter',
|
||||
max150: 'Maksimum 150 karakter',
|
||||
max200: 'Maksimum 200 karakter',
|
||||
data_size: 'Kabul edilebilir maksimum boyut: ',
|
||||
image_width_size: 'Maksimum genişlik: ',
|
||||
image_height_size: 'Maksimum yükseklik: ',
|
||||
},
|
||||
not_found: {
|
||||
user_id: 'Bu profile sahip kullanıcı yok',
|
||||
admin_id: 'Bu profile sahip yönetici yok',
|
||||
order_id: 'Bu profilde sipariş yok',
|
||||
item_id: 'Bu spesifikasyona sahip hiçbir öğe yok',
|
||||
password: 'Şifre veya kimlik yanlış'
|
||||
},
|
||||
duplicated: {
|
||||
username: 'Bu kullanıcı adı zaten mevcut',
|
||||
email: 'Bu email zaten var',
|
||||
name: 'Ad çift',
|
||||
title: 'Başlık yineleniyor',
|
||||
phone_number: 'Phone number already exists'
|
||||
},
|
||||
response: {
|
||||
logged_in: 'Giriş yaptınız',
|
||||
not_logged_in: 'Giriş yapmadınız',
|
||||
logged_out: 'Çıkış yaptınız',
|
||||
unauthenticated: 'unauthenticated',
|
||||
recovery_link: 'Kurtarma bağlantısı gönderildi',
|
||||
success_save: 'Başarıyla kaydedildi',
|
||||
success_remove: 'Başarıyla kaldırıldı',
|
||||
cart_empty: 'Sepet boş',
|
||||
already_has_address: 'Zaten adresi var',
|
||||
activation_code: 'Activation code sent to you',
|
||||
activation_email: 'Activation email sent to you',
|
||||
expired_reset_link: 'Mevcut sıfırlama geçiş bağlantısının süresi doldu',
|
||||
email_not_confirmed: 'Önce e-postanızı onaylayın, aktivasyon bağlantısı size zaten gönderildi.',
|
||||
expired_activation_link: "Bu aktivasyon bağlantısının süresi doldu",
|
||||
success_activation: 'Hesabınız başarıyla etkinleştirildi',
|
||||
passwords_not_match: 'Şifreler aynı değil',
|
||||
problem: 'Bir sorun var, lütfen tekrar deneyin.',
|
||||
latinChar: 'Please write in Latin letters',
|
||||
persianChar: 'Please write in Persian letters',
|
||||
whiteSpace: 'There should be no space between letters and words'
|
||||
},
|
||||
file_types: {
|
||||
jpg: 'Yalnızca jpg formatı kabul edilebilir',
|
||||
png: 'Sadece png formatı kabul edilebilir',
|
||||
gif: 'Yalnızca gif formatı kabul edilebilir',
|
||||
pdf: 'Yalnızca pdf formatı kabul edilebilir',
|
||||
txt: 'Yalnızca txt formatı kabul edilebilir',
|
||||
log: 'Yalnızca log formatı kabul edilebilir',
|
||||
mp3: 'Yalnızca mp3 formatı kabul edilebilir',
|
||||
ogg: 'Yalnızca ogg formatı kabul edilebilir',
|
||||
wmv: 'Yalnızca wmv formatı kabul edilebilir',
|
||||
mp4: 'Yalnızca mp4 formatı kabul edilebilir',
|
||||
mov: 'Yalnızca mov formatı kabul edilebilir',
|
||||
mkv: 'Yalnızca mkv formatı kabul edilebilir',
|
||||
flv: 'Yalnızca flv biçimi kabul edilebilir'
|
||||
}
|
||||
},
|
||||
it: {
|
||||
required: {
|
||||
token: 'Token is required',
|
||||
field: 'This field is required',
|
||||
// convalide dello sviluppatore
|
||||
Remember_me: "Remember_me parameter required",
|
||||
// convalide della registrazione
|
||||
name: "Inserisci nome",
|
||||
first_name: "Inserisci nome",
|
||||
last_name: "Inserisci il cognome",
|
||||
national_code: "Il codice Nationaler è comune",
|
||||
email: "Enter email",
|
||||
email_personal: "L'email personale è obbligatoria",
|
||||
email_company: "L'email aziendale è obbligatoria per le persone giuridiche",
|
||||
company_name: "Inserisci il nome dell'azienda se sei una persona giuridica",
|
||||
username: "Inserisci nome utente",
|
||||
phone_number: "Inserisci numero di telefono",
|
||||
password: "Inserisci password",
|
||||
birthdate: 'Enter birthdate',
|
||||
// indirizzamento delle convalide
|
||||
country: "Inserisci paese",
|
||||
province: "Inserisci provincia",
|
||||
city: "Inserisci città",
|
||||
address: "Inserisci indirizzo",
|
||||
postal_code: "Inserisci codice postale",
|
||||
plaque: "Inserisci targa",
|
||||
receiver_first_name: "Inserisci il nome del destinatario",
|
||||
receiver_last_name: "Inserisci il cognome del destinatario",
|
||||
receiver_mobile: "Inserisci il numero di cellulare del destinatario",
|
||||
// globale (post - gallery - ...)
|
||||
title: "Inserisci titolo",
|
||||
caption: "Inserisci didascalia",
|
||||
description: "Inserisci descrizione",
|
||||
category: "Seleziona categoria",
|
||||
image: "L'immagine è obbligatoria",
|
||||
cover: "Cover is required",
|
||||
file: "Il file è obbligatorio",
|
||||
message: "Scrivi messaggio",
|
||||
quantity: "Inserisci quantità",
|
||||
date: 'Enter date',
|
||||
reason: 'Seleziona motivo',
|
||||
question: 'Scrivi la domanda',
|
||||
answer: 'Scrivi la risposta',
|
||||
price: 'Enter Price',
|
||||
type: 'Select type',
|
||||
discount_code: 'Enter discount code',
|
||||
discount_amount: 'Enter discount amount',
|
||||
discount_expire_date: 'Specify discount code expiration date',
|
||||
user_id: 'Select user',
|
||||
video: 'Video is required',
|
||||
subject: 'Enter subject'
|
||||
},
|
||||
format: {
|
||||
phone_number: "Formato del numero di telefono non corretto",
|
||||
email: "Formato email non corretto",
|
||||
number: "Il valore deve essere un numero",
|
||||
boolean: "Il valore deve essere booleano",
|
||||
image: 'Photo format is not acceptable',
|
||||
video: 'Video format is not acceptable',
|
||||
national_code: "Il formato del codice nazionale non è corretto"
|
||||
},
|
||||
min_char: {
|
||||
min2: "Almeno 2 caratteri",
|
||||
min4: "Almeno 4 caratteri",
|
||||
min8: "Almeno 8 caratteri",
|
||||
min10: "Almeno 10 caratteri",
|
||||
min20: "Almeno 20 caratteri",
|
||||
min30: "Almeno 30 caratteri",
|
||||
min40: "Almeno 40 caratteri",
|
||||
min50: "Almeno 50 caratteri",
|
||||
min60: "Almeno 60 caratteri",
|
||||
min100: "Almeno 100 caratteri",
|
||||
min120: "Almeno 120 caratteri",
|
||||
min150: "Almeno 150 caratteri",
|
||||
min200: "Almeno 200 caratteri",
|
||||
data_size: "Dimensione minima accettabile: ",
|
||||
image_width_size: "Larghezza minima: ",
|
||||
image_height_size: "Altezza minima: ",
|
||||
},
|
||||
max_char: {
|
||||
max4: "Massimo 4 caratteri",
|
||||
max8: "Massimo 8 caratteri",
|
||||
max10: "Massimo 10 caratteri",
|
||||
max15: "Massimo 15 caratteri",
|
||||
max20: "Massimo 20 caratteri",
|
||||
max30: "Massimo 30 caratteri",
|
||||
max40: "Massimo 40 caratteri",
|
||||
max50: "Massimo 50 caratteri",
|
||||
max60: "Massimo 60 caratteri",
|
||||
max100: "Massimo 100 caratteri",
|
||||
max120: "Massimo 120 caratteri",
|
||||
max150: "Massimo 150 caratteri",
|
||||
max200: "Massimo 200 caratteri",
|
||||
data_size: "Dimensione massima accettabile: ",
|
||||
image_width_size: "Larghezza massima: ",
|
||||
image_height_size: "Altezza massima: ",
|
||||
},
|
||||
not_found: {
|
||||
user_id: "Nessun utente con questo profilo",
|
||||
admin_id: "Nessun amministratore con questo profilo",
|
||||
order_id: "Nessun ordine con questo profilo",
|
||||
item_id: "Nessun articolo con questa specifica",
|
||||
password: "La password o l'ID non sono corretti"
|
||||
},
|
||||
duplicated: {
|
||||
username: "Questo nome utente esiste già",
|
||||
email: "Questa email esiste già",
|
||||
name: "Il nome è duplicato",
|
||||
title: "Il titolo è duplicato",
|
||||
phone_number: 'Phone number already exists'
|
||||
},
|
||||
response: {
|
||||
logged_in: "Hai effettuato l'accesso",
|
||||
not_logged_in: "Non sei loggato",
|
||||
logged_out: "Sei disconnesso",
|
||||
unauthenticated: "unauthenticated",
|
||||
recovery_link: "Link di ripristino inviato",
|
||||
success_save: "Salvataggio riuscito",
|
||||
success_remove: "Rimosso con successo",
|
||||
cart_empty: "Il carrello è vuoto",
|
||||
already_has_address: "Ha già indirizzo",
|
||||
activation_code: 'Activation code sent to you',
|
||||
activation_email: 'Activation email sent to you',
|
||||
expired_reset_link: "L'attuale link del passaggio di reimpostazione è scaduto",
|
||||
email_not_confirmed: "Conferma prima la tua email, il link di attivazione ti è già stato inviato.",
|
||||
expired_activation_link: "Questo link di attivazione è scaduto",
|
||||
success_activation: "Il tuo account è stato attivato con successo",
|
||||
passwords_not_match: "Le password non sono le stesse",
|
||||
problem: "Si è verificato un problema, riprova.",
|
||||
latinChar: 'Please write in Latin letters',
|
||||
persianChar: 'Please write in Persian letters',
|
||||
whiteSpace: 'There should be no space between letters and words'
|
||||
},
|
||||
file_types: {
|
||||
jpg: "È accettabile solo il formato jpg",
|
||||
png: "È accettabile solo il formato png",
|
||||
gif: "È accettabile solo il formato GIF",
|
||||
pdf: "È accettabile solo il formato pdf",
|
||||
txt: "È accettabile solo il formato txt",
|
||||
log: "È accettabile solo il formato log",
|
||||
mp3: "È accettabile solo il formato mp3",
|
||||
ogg: "È accettabile solo il formato ogg",
|
||||
wmv: "È accettabile solo il formato wmv",
|
||||
mp4: "È accettabile solo il formato mp4",
|
||||
mov: "È accettabile solo il formato mov",
|
||||
mkv: "È accettabile solo il formato mkv",
|
||||
flv: "È accettabile solo il formato flv"
|
||||
}
|
||||
},
|
||||
supportedImageFormats: ['jpg', 'jpeg', 'png', 'svg', 'svg+xml', 'webp'],
|
||||
supportedVideoFormats: ['mp4', 'wmv']
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
const {Router} = require('express')
|
||||
const router = Router()
|
||||
/////////////////////////////////////////////////////////// controllers
|
||||
const contactUsController = require('../controllers/contactUsController')
|
||||
const blogCategoryController = require('../controllers/blogCategoryController')
|
||||
const blogPostController = require('../controllers/blogPostController')
|
||||
const userController = require('../controllers/userController')
|
||||
const projectController = require('../controllers/projectController')
|
||||
const projectCategoryController = require('../controllers/projectCategoryController')
|
||||
const teamController = require('../controllers/teamController')
|
||||
const galleryController = require('../controllers/galleryController')
|
||||
const galleryCategoryController = require('../controllers/galleryCategoryController')
|
||||
const catalogController = require('../controllers/catalogController')
|
||||
const customerCommentController = require('../controllers/customerCommentController')
|
||||
const sliderController = require('../controllers/sliderController')
|
||||
const siteSettingController = require('../controllers/siteSettingController')
|
||||
|
||||
|
||||
//////////////// blog category
|
||||
router.post('/blogCategory', blogCategoryController.create)
|
||||
router.put('/blogCategory/:id', blogCategoryController.update)
|
||||
router.get('/blogCategory/:id', blogCategoryController.getOne)
|
||||
router.delete('/blogCategory/:id', blogCategoryController.delete)
|
||||
|
||||
|
||||
//////////////// blog post
|
||||
router.post('/blogPost', blogPostController.create)
|
||||
router.put('/blogPost/:id', blogPostController.update)
|
||||
router.delete('/blogPost/:id', blogPostController.delete)
|
||||
|
||||
|
||||
//////////////// contact us
|
||||
router.get('/contactUsMessages', contactUsController.getAll)
|
||||
router.get('/contactUsMessages/:id', contactUsController.getOne)
|
||||
|
||||
|
||||
//////////////// gallery category
|
||||
router.post('/galleryCategory', galleryCategoryController.create)
|
||||
router.put('/galleryCategory/:id', galleryCategoryController.update)
|
||||
router.get('/galleryCategory/:id', galleryCategoryController.getOne)
|
||||
router.delete('/galleryCategory/:id', galleryCategoryController.delete)
|
||||
|
||||
|
||||
//////////////// gallery
|
||||
router.post('/gallery', galleryController.create)
|
||||
router.put('/gallery/:id', galleryController.update)
|
||||
router.delete('/gallery/:id', galleryController.delete)
|
||||
|
||||
//////////////// catalog
|
||||
router.post('/catalog', catalogController.create)
|
||||
router.put('/catalog/:id', catalogController.update)
|
||||
router.delete('/catalog/:id', catalogController.delete)
|
||||
|
||||
|
||||
//////////////// project category
|
||||
router.post('/projectCategory', projectCategoryController.create)
|
||||
router.put('/projectCategory/:id', projectCategoryController.update)
|
||||
router.get('/projectCategory/:id', projectCategoryController.getOne)
|
||||
router.delete('/projectCategory/:id', projectCategoryController.delete)
|
||||
// tags
|
||||
router.post('/categoryTag/:categoryId', projectCategoryController.addTagToCategory)
|
||||
router.delete('/categoryTag/:tagId', projectCategoryController.removeTagFromCategory)
|
||||
|
||||
|
||||
//////////////// projects
|
||||
router.post('/project', projectController.create)
|
||||
router.put('/project/:id', projectController.update)
|
||||
router.delete('/project/:id', projectController.delete)
|
||||
router.post('/projectImage/:project_id', projectController.addImageToProjectGallery)
|
||||
router.delete('/projectImage/:image_id', projectController.removeImageFromProject)
|
||||
|
||||
//////////////// team mates
|
||||
router.post('/team', teamController.create)
|
||||
router.put('/team/:id', teamController.update)
|
||||
router.delete('/team/:id', teamController.delete)
|
||||
|
||||
//////////////// customer comments
|
||||
router.post('/comment', customerCommentController.create)
|
||||
router.put('/comment/:id', customerCommentController.update)
|
||||
router.delete('/comment/:id', customerCommentController.delete)
|
||||
router.get('/comment/:id', customerCommentController.getOne)
|
||||
|
||||
//////////////// slider
|
||||
router.post('/slide', sliderController.create)
|
||||
router.delete('/slide/:id', sliderController.delete)
|
||||
|
||||
//////////////// site setting
|
||||
router.post('/setting/:id', siteSettingController.uploadCover)
|
||||
router.get('/setting', siteSettingController.getAllByAdmin)
|
||||
|
||||
|
||||
module.exports = router
|
||||
@@ -0,0 +1,9 @@
|
||||
const {Router} = require('express')
|
||||
const router = Router()
|
||||
const userController = require('../controllers/userController')
|
||||
|
||||
router.post('/login', userController.login)
|
||||
router.delete('/logout', userController.logout)
|
||||
router.get('/user', userController.getUser)
|
||||
|
||||
module.exports = router
|
||||
@@ -0,0 +1,73 @@
|
||||
const {Router} = require('express')
|
||||
const router = Router()
|
||||
|
||||
/////////////////////////////////////////////////////////// controllers
|
||||
const contactUsController = require('../controllers/contactUsController')
|
||||
const blogCategoryController = require('../controllers/blogCategoryController')
|
||||
const blogPostController = require('../controllers/blogPostController')
|
||||
const projectCategoryController = require('../controllers/projectCategoryController')
|
||||
const projectController = require('../controllers/projectController')
|
||||
const teamController = require('../controllers/teamController')
|
||||
const galleryController = require('../controllers/galleryController')
|
||||
const galleryCategoryController = require('../controllers/galleryCategoryController')
|
||||
const catalogController = require('../controllers/catalogController')
|
||||
const customerCommentController = require('../controllers/customerCommentController')
|
||||
const sliderController = require('../controllers/sliderController')
|
||||
const siteSettingController = require('../controllers/siteSettingController')
|
||||
|
||||
/////////////////////////////////////////////////////////// routes
|
||||
|
||||
|
||||
//////////////// blog categories
|
||||
router.get('/blogCategories', blogCategoryController.getAll)
|
||||
|
||||
//////////////// blog post
|
||||
router.get('/blogPosts', blogPostController.getAll)
|
||||
router.get('/blogPost/:id', blogPostController.getOne)
|
||||
|
||||
//////////////// contact us
|
||||
router.post('/contact', contactUsController.create)
|
||||
|
||||
|
||||
//////////////// gallery categories
|
||||
router.get('/galleryCategories', galleryCategoryController.getAll)
|
||||
|
||||
//////////////// gallery
|
||||
router.get('/gallery', galleryController.getAll)
|
||||
router.get('/gallery/:id', galleryController.getByCategoryId)
|
||||
router.get('/galleryImage/:id', galleryController.getOne)
|
||||
|
||||
//////////////// catalog
|
||||
router.get('/catalogs', catalogController.getAll)
|
||||
router.get('/catalog/:id', catalogController.getOne)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////// project category
|
||||
router.get('/projectCategories', projectCategoryController.getAll)
|
||||
|
||||
//////////////// project
|
||||
router.get('/projects', projectController.getAll)
|
||||
router.get('/project/:id', projectController.getOne)
|
||||
|
||||
//////////////// team
|
||||
router.get('/teams', teamController.getAll)
|
||||
router.get('/team/:id', teamController.getOne)
|
||||
|
||||
//////////////// customer comment
|
||||
router.get('/comments', customerCommentController.getAll)
|
||||
|
||||
//////////////// slider
|
||||
router.get('/slides', sliderController.getAll)
|
||||
router.get('/slide/:id', sliderController.getOne)
|
||||
|
||||
// router.get('/addExel' , projectController.addExel)
|
||||
|
||||
//////////////// search
|
||||
router.post('/search' , siteSettingController.search)
|
||||
|
||||
////////////// site setting
|
||||
router.get('/cover' , siteSettingController.getAllByUser)
|
||||
|
||||
module.exports = router
|
||||
@@ -0,0 +1,37 @@
|
||||
[{
|
||||
"_id": {
|
||||
"$oid": "60b3afe00462d2f8938d1077"
|
||||
},
|
||||
"scope": [
|
||||
"admin"
|
||||
],
|
||||
"username": "negareh_support",
|
||||
"password": "$2a$10$Oz6i2zBMsY/cq.c7Uh6G3e8Vu3.sJ3zx8QKhZSdO8hlDi6rmaB1S.",
|
||||
"created_at": {
|
||||
"$date": "2021-05-30T15:31:44.592Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2024-06-30T06:01:04.161Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MGIzYWZlMDA0NjJkMmY4OTM4ZDEwNzciLCJpYXQiOjE3MTk3MjcyNjQsImV4cCI6MTcyMDMzMjA2NH0.eLhlyzTz_VuJRlJzJH3WwXPcnp5vZ93pKLxFtfoKYaw",
|
||||
"first_name": "negar"
|
||||
},
|
||||
{
|
||||
"_id": {
|
||||
"$oid": "60b3afe00462d2f8938d1078"
|
||||
},
|
||||
"scope": [
|
||||
"admin"
|
||||
],
|
||||
"username": "orisoxin_admin",
|
||||
"password": "$2a$10$og3eV.bfirfzGv.pc/.tvOZ7cKvD3JRmAYHyy8vM0dCt/vkIdh3GW",
|
||||
"created_at": {
|
||||
"$date": "2021-05-30T15:31:44.786Z"
|
||||
},
|
||||
"updated_at": {
|
||||
"$date": "2023-04-24T10:21:20.573Z"
|
||||
},
|
||||
"__v": 0,
|
||||
"token": null
|
||||
}]
|
||||
Reference in New Issue
Block a user