{ "openapi": "3.0.0", "info": { "title": "API Documentation Siketan", "version": "1.0.0", "description": "API Documentation Siketan" }, "host": "localhost:3000", "basePath": "/", "servers": [ { "url": "http://localhost:3000", "description": "Development Server" } ], "paths": { "/auth/login": { "post": { "summary": "Login", "tags": ["Auth Admin"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "example": "user@example.com" }, "password": { "type": "string", "format": "password", "example": "password123" } }, "required": ["email", "password"] } } } }, "responses": { "200": { "description": "Login Berhasil", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Login Berhasil" }, "token": { "type": "string", "example": "sldnwijhdsnduisfh8734283298" } } } } } }, "400": { "description": "Email Tidak Terdaftar", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Email Tidak Terdaftar" } } } } } } } } }, "/auth/register": { "post": { "summary": "Register", "tags": ["Auth Admin"], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "example": "user@example.com" }, "no_wa": { "type": "string", "example": "08123456789" }, "nama": { "type": "string", "example": "John Doe" }, "password": { "type": "string", "format": "password", "example": "password123" }, "pekerjaan": { "type": "string", "example": "Pegawai" }, "peran": { "type": "string", "example": "User" }, "foto": { "type": "string", "format": "binary" } }, "required": ["email", "no_wa", "nama", "password"] } } } }, "responses": { "200": { "description": "Register Berhasil", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Register Berhasil" }, "token": { "type": "string", "example": "sldnwijhdsnduisfh8734283298" } } } } } }, "400": { "description": "Email Telah Terdaftar", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Email Telah Terdaftar" } } } } } } } } }, "/auth/petani-login": { "post": { "summary": "Login Android", "tags": ["Auth"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "NIK": { "type": "string", "example": "2978237293729379273" }, "NIP": { "type": "string", "example": "2978237293729379273" }, "password": { "type": "string", "format": "password", "example": "password123" } }, "required": ["password"] } } } }, "responses": { "200": { "description": "Login Berhasil", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Login Berhasil" }, "token": { "type": "string", "example": "sldnwijhdsnduisfh8734283298" } } } } } }, "400": { "description": "Email Tidak Terdaftar", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Email Tidak Terdaftar" } } } } } } } } }, "/auth/petani-register": { "post": { "summary": "Register Android", "tags": ["Auth"], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIK": { "type": "string", "example": "2978237293729379273" }, "NoWa": { "type": "string", "example": "08123456789" }, "nama": { "type": "string", "example": "John Doe" }, "alamat": { "type": "string", "example": "John Doe" }, "desa": { "type": "string", "example": "John Doe" }, "kecamatan": { "type": "string", "example": "John Doe" }, "password": { "type": "string", "format": "password", "example": "password123" }, "foto": { "type": "string", "format": "binary" } }, "required": ["NIK", "NoWa", "nama", "password"] } } } }, "responses": { "200": { "description": "Register Berhasil", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Register Berhasil" }, "token": { "type": "string", "example": "sldnwijhdsnduisfh8734283298" } } } } } }, "400": { "description": "Email Telah Terdaftar", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Email Telah Terdaftar" } } } } } } } } }, "/cek-nik": { "post": { "tags": ["Cek NIK"], "summary": "Memeriksa data berdasarkan NIK", "security": [ { "bearerToken": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "nik": { "type": "string", "example": "301292810919" } } } } } }, "responses": { "200": { "description": "Data ditemukan", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Data dengan NIK {nik} ditemukan" }, "user": { "$ref": "#/components/schemas/User" } } } }, "400": { "description": "Data Tidak Ditemukan", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Data dengan nik {nik} Tidak Ditemukan" } } } } } } } } }, "/daftar-tani/add": { "post": { "tags": ["Data Tani"], "summary": "Menambahkan data daftar tani", "consumes": ["multipart/form-data"], "parameters": [], "security": [ { "bearerToken": [] } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIK": { "type": "string" }, "NoWa": { "type": "string" }, "alamat": { "type": "string" }, "desa": { "type": "string" }, "nama": { "type": "string" }, "kecamatan": { "type": "string" }, "password": { "type": "string", "format": "password" }, "gapoktan": { "type": "string" }, "penyuluh": { "type": "string" }, "namaKelompok": { "type": "string" }, "statusLahan": { "type": "string" }, "luasLahan": { "type": "number" }, "kategori": { "type": "string" }, "jenis": { "type": "string" }, "komoditas": { "type": "string" }, "musimTanam": { "type": "integer" }, "tanggalTanam": { "type": "string", "format": "date" }, "perkiraanPanen": { "type": "string", "format": "date" }, "foto": { "type": "file" } }, "required": ["NIK", "nama"] } } } }, "responses": { "200": { "description": "Berhasil menambahkan daftar tani", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Menambahkan Daftar Tani" }, "daftarTani": { "$ref": "#/components/schemas/DaftarTani" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "NIK tidak boleh kosong" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } }, "/laporan-tani/add": { "post": { "tags": ["Data Tani"], "summary": "Menambahkan laporan tani", "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIK": { "type": "string" }, "tanggalLaporan": { "type": "string", "format": "date-time" }, "kondisiTanaman": { "type": "string" }, "deskripsi": { "type": "string" }, "fotoTanaman": { "type": "string", "format": "binary" } }, "required": [ "NIK", "tanggalLaporan", "kondisiTanaman", "deskripsi" ] } } } }, "responses": { "200": { "description": "Berhasil menambahkan laporan", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Menambahkan Laporan" }, "dataLaporanTanam": { "$ref": "#/components/schemas/LaporanTanam" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "NIK tidak boleh kosong" } } } } } }, "500": { "description": "Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } } } }, "/daftar-tani": { "get": { "tags": ["Data Tani"], "summary": "Mendapatkan Daftar petani", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Data laporan Tani berhasil diperoleh", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Data laporan Tani Berhasil Diperoleh" }, "tani": { "type": "array", "items": { "$ref": "#/components/schemas/DaftarTani" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/laporan-petani": { "get": { "tags": ["Data Tani"], "summary": "Mendapatkan laporan petani", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Data laporan Tani berhasil diperoleh", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Data laporan Tani Berhasil Diperoleh" }, "tani": { "type": "array", "items": { "$ref": "#/components/schemas/DaftarTani" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/laporan-penyuluh": { "get": { "tags": ["Data Tani"], "summary": "Mendapatkan laporan penyuluh", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Data laporan Penyuluh berhasil diperoleh", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Data laporan Penyuluh Berhasil Diperoleh" }, "penyuluh": { "type": "array", "items": { "$ref": "#/components/schemas/DaftarTani" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/event-tani/add": { "post": { "tags": ["Info Tani"], "summary": "Menambahkan event tani", "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "namaKegiatan": { "type": "string" }, "tanggalAcara": { "type": "string", "format": "date" }, "waktuAcara": { "type": "string" }, "tempat": { "type": "string" }, "peserta": { "type": "string" }, "isi": { "type": "string" }, "fotoKegiatan": { "type": "string", "format": "binary" } }, "required": ["namaKegiatan", "tanggalAcara"] } } } }, "responses": { "200": { "description": "Berhasil menambahkan event", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Event Berhasil Dibuat" }, "eventTani": { "$ref": "#/components/schemas/EventTani" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Wrong Image Format" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/info-tani/add": { "post": { "tags": ["Info Tani"], "summary": "Menambahkan info tani", "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "judul": { "type": "string" }, "tanggal": { "type": "string", "format": "date" }, "status": { "type": "string" }, "kategori": { "type": "string" }, "isi": { "type": "string" }, "fotoBerita": { "type": "string", "format": "binary" } }, "required": ["judul", "tanggal", "status", "kategori"] } } } }, "responses": { "200": { "description": "Info Tani Berhasil Dibuat", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Info Tani Berhasil Dibuat" }, "infoTani": { "$ref": "#/components/schemas/InfoTani" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Wrong Image Format" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/info-tani": { "get": { "tags": ["Info Tani"], "summary": "Mendapatkan data info tani", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Berhasil mendapatkan data info tani", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan Data Info Tani" }, "infotani": { "type": "array", "items": { "$ref": "#/components/schemas/InfoTani" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/event-tani": { "get": { "tags": ["Info Tani"], "summary": "Mendapatkan data event tani", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Berhasil mendapatkan data event tani", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan Data Event Tani" }, "eventTani": { "type": "array", "items": { "$ref": "#/components/schemas/EventTani" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/daftar-penjual": { "post": { "tags": ["Toko Tani"], "summary": "Menambahkan daftar penjual", "consumes": ["multipart/form-data"], "parameters": [], "security": [ { "bearerToken": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIK": { "type": "string", "example": "30198210" }, "NIP": { "type": "string", "example": "30198210" }, "profesiPenjual": { "type": "string", "enum": ["petani", "penyuluh"] }, "namaProducts": { "type": "string", "example": "bawang merah" }, "stok": { "type": "integer", "example": 2 }, "satuan": { "type": "string", "example": "kg" }, "harga": { "type": "string", "example": "Rp. 2000000" }, "deskripsi": { "type": "string", "example": "semua bawang segar" }, "status": { "type": "string", "example": "ready" }, "fotoTanaman": { "type": "file" } }, "allOf": [ { "if": { "properties": { "profesiPenjual": { "const": "petani" } } }, "then": { "properties": { "NIK": { "type": "string", "minLength": 1 } }, "required": ["NIK"] } }, { "if": { "properties": { "profesiPenjual": { "const": "penyuluh" } } }, "then": { "properties": { "NIP": { "type": "string", "minLength": 1 } }, "required": ["NIP"] } } ], "required": [ "profesiPenjual", "namaProducts", "stok", "satuan", "harga", "status" ] }, "encoding": { "fotoTanaman": { "contentType": "multipart/form-data" } } } } }, "responses": { "200": { "description": "Berhasil Membuat Data Penjual", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Membuat Data Penjual" }, "dataPenjual": { "$ref": "#/components/schemas/Penjual" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Wrong Image Format" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/product-penyuluh": { "get": { "tags": ["Toko Tani"], "summary": "Mendapatkan data product penyuluh", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Berhasil Mendapatkan Product Penyuluh", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan Product Penyuluh" }, "productPenyuluh": { "type": "array", "items": { "$ref": "#/components/schemas/Penjual" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/product-petani": { "get": { "tags": ["Toko Tani"], "summary": "Mendapatkan data product petani", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Berhasil Mendapatkan Product Petani", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan Product Petani" }, "productPetani": { "type": "array", "items": { "$ref": "#/components/schemas/Penjual" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/product-petani-no-auth": { "get": { "tags": ["Toko Tani"], "summary": "Mendapatkan data product petani", "responses": { "200": { "description": "Berhasil Mendapatkan Product Petani", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan Product Petani" }, "productPetani": { "type": "array", "items": { "$ref": "#/components/schemas/Penjual" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/penyuluh/add": { "post": { "tags": ["Data Penyuluh"], "summary": "Tambah Data Penyuluh", "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "parameters": [], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIP": { "type": "string" }, "NoWa": { "type": "string" }, "alamat": { "type": "string" }, "desa": { "type": "string" }, "nama": { "type": "string" }, "kecamatan": { "type": "string" }, "password": { "type": "string" }, "namaProduct": { "type": "string" }, "desaBinaan": { "type": "string" }, "foto": { "type": "file" } } }, "encoding": { "foto": { "contentType": "multipart/form-data" } } } } }, "responses": { "200": { "description": "Berhasil menambahkan data Penyuluh", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "newDataPenyuluh": { "type": "object" } } } }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error" } } } }, "/presensi-kehadiran/add": { "post": { "tags": ["Data Penyuluh"], "summary": "Tambah Presensi Kehadiran", "security": [ { "bearerToken": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIP": { "type": "string", "example": "3514112401950003" }, "tanggalPresensi": { "type": "string", "format": "date", "example": "2023-07-18" }, "judulKegiatan": { "type": "string", "example": "penyuluhan membantai hama" }, "deskripsiKegiatan": { "type": "string", "example": "memberikan edukasi bagaimana cara pengguanaan product pembantai hama" }, "FotoKegiatan": { "type": "file" } } } } } }, "responses": { "200": { "description": "Berhasil menambahkan data Presensi Kehadiran", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "newData": { "type": "object" } } } }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error" } } } }, "/daftar-penyuluh": { "get": { "tags": ["Data Penyuluh"], "summary": "daftar penyuluh", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Data laporan Tani berhasil diperoleh", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Data laporan Tani Berhasil Diperoleh" }, "tani": { "type": "array", "items": { "$ref": "#/components/schemas/DaftarTani" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/jurnal-kegiatan/add": { "post": { "tags": ["Data Penyuluh"], "summary": "Tambah Jurnal Kegiatan", "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "parameters": [], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIP": { "type": "string" }, "judul": { "type": "string" }, "tanggalDibuat": { "type": "string", "format": "date" }, "uraian": { "type": "string" }, "statusJurnal": { "type": "string" }, "gambar": { "type": "file" } } }, "encoding": { "gambar": { "contentType": "multipart/form-data" } } } } }, "responses": { "200": { "description": "Berhasil menambahkan data Jurnal", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "newData": { "type": "object" } } } }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error" } } } }, "/presensi-kehadiran": { "get": { "tags": ["Data Penyuluh"], "summary": "Semua Data Presensi Kehadiran", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "DataPresesiKehadiran": { "type": "object" } } } }, "500": { "description": "Internal Server Error" } } } }, "/presensi-kehadiran/web": { "get": { "tags": ["Data Penyuluh"], "summary": "Semua Data Presensi Kehadiran", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "DataPresesiKehadiran": { "type": "object" } } } }, "500": { "description": "Internal Server Error" } } } }, "/jurnal-kegiatan": { "get": { "tags": ["Data Penyuluh"], "summary": "Semua Data Jurnal Kegiatan", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "DataJurnalKegiatan": { "type": "object" } } } }, "500": { "description": "Internal Server Error" } } } }, "/riwayat-chat": { "get": { "tags": ["Data Penyuluh"], "summary": "Semua Data Riwayat Chat", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "DataRiwayatChat": { "type": "object" } } } }, "500": { "description": "Internal Server Error" } } } }, "/chat/add": { "post": { "tags": ["Live Chat"], "summary": "Menambahkan pesan chat", "security": [ { "bearerToken": [] } ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "dari": { "type": "string" }, "tujuan": { "type": "string" }, "aksi": { "type": "string" }, "status": { "type": "string" } } } } } }, "responses": { "200": { "description": "Berhasil Menambahkan Chatt", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Menambahkan Chatt" }, "datachatt": { "$ref": "#/components/schemas/Chat" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/rating/add": { "post": { "tags": ["Live Chat"], "summary": "Menambahkan rating", "security": [ { "bearerToken": [] } ], "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "NIP": { "type": "string" }, "response": { "type": "string" } } } } } }, "responses": { "200": { "description": "Berhasil membuat Rating", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil membuat Rating" }, "rating": { "$ref": "#/components/schemas/Rating" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/chats": { "get": { "tags": ["Live Chat"], "summary": "Mendapatkan data chat", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Berhasil Mendapatkan data Chatt", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan data Chatt" }, "chatts": { "type": "array", "items": { "$ref": "#/components/schemas/Chat" } }, "chattReply": { "type": "array", "items": { "$ref": "#/components/schemas/Chat" } } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/rating": { "get": { "tags": ["Live Chat"], "summary": "Mendapatkan data rating", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "Berhasil Mendapatkan data rating", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mendapatkan data rating" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/users": { "get": { "tags": ["users"], "summary": "Semua Data User", "security": [ { "bearerToken": [] } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "message": { "type": "string" }, "users": { "type": "object" } } } }, "500": { "description": "Internal Server Error" } } } }, "/info-tani/{id}": { "get": { "summary": "Menghapus data berita tani berdasarkan ID", "tags": ["Info Tani"], "security": [ { "bearerToken": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID yang akan di cari" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data berhasil dihapus" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "delete": { "summary": "Menghapus data berita tani berdasarkan ID", "tags": ["Info Tani"], "security": [ { "bearerToken": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data yang akan dihapus" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data berhasil dihapus" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "put": { "summary": "Merubah data berita tani berdasarkan ID", "tags": ["Info Tani"], "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "judul": { "type": "string" }, "tanggal": { "type": "string", "format": "date" }, "status": { "type": "string" }, "kategori": { "type": "string" }, "isi": { "type": "string" }, "fotoBerita": { "type": "string", "format": "binary" } }, "required": ["judul", "tanggal", "status", "kategori"] } } } }, "responses": { "200": { "description": "Info Tani Berhasil Dibuat", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Info Tani Berhasil Dibuat" }, "infoTani": { "$ref": "#/components/schemas/InfoTani" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Wrong Image Format" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/event-tani/{id}": { "get": { "summary": "Menghapus event tani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Info Tani"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data yang akan dihapus" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data berhasil ditemukan" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "delete": { "summary": "Menghapus event tani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Info Tani"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data yang akan dicari" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data berhasil ditemukan" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "put": { "summary": "Merubah data event tani berdasarkan ID", "tags": ["Info Tani"], "security": [ { "bearerToken": [] } ], "consumes": ["multipart/form-data"], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "namaKegiatan": { "type": "string" }, "tanggalAcara": { "type": "string", "format": "date" }, "waktuAcara": { "type": "string" }, "tempat": { "type": "string" }, "peserta": { "type": "string" }, "isi": { "type": "string" }, "fotoKegiatan": { "type": "string", "format": "binary" } }, "required": ["namaKegiatan", "tanggalAcara"] } } } }, "responses": { "200": { "description": "Berhasil Merubah event", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Event Berhasil di Ubah" }, "eventTani": { "$ref": "#/components/schemas/EventTani" } } } }, "400": { "description": "Bad Request", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Wrong Image Format" } } } }, "500": { "description": "Server Error", "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } }, "/daftar-tani/{id}": { "delete": { "summary": "Menghapus event tani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Data Tani"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data yang akan dicari" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data petani berhasil dihapus" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "get": { "summary": "Mendapatkan detail petani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Data Tani"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data petani yang akan dicari" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Detail petani berhasil ditemukan" }, "detailTani": { "type": "object", "properties": { "id": { "type": "integer", "example": 2 }, "NIK": { "type": "string", "example": "3514112401950003" }, "NoWa": { "type": "string", "example": "085795343099" }, "alamat": { "type": "string", "example": "Link Kuti 02 RT 01 RW 04 Pandaan" }, "desa": { "type": "string", "example": "Kutorejo" }, "nama": { "type": "string", "example": "MUHAMMAD NURIL YAQIN" }, "kecamatan": { "type": "string", "example": "Pandaan" }, "password": { "type": "string", "example": "123456789" }, "fotoBaru": { "type": "string", "example": null } } } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "put": { "summary": "Memperbarui detail petani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Data Tani"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data petani yang akan diperbarui" } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "NIK": { "type": "string", "example": "3514112401950003" }, "NoWa": { "type": "string", "example": "085795343099" }, "alamat": { "type": "string", "example": "Link Kuti 02 RT 01 RW 04 Pandaan" }, "desa": { "type": "string", "example": "Kutorejo" }, "nama": { "type": "string", "example": "MUHAMMAD NURIL YAQIN" }, "kecamatan": { "type": "string", "example": "Pandaan" }, "password": { "type": "string", "example": "123456789" }, "fotoBaru": { "type": "string", "format": "binary" } } } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Detail petani berhasil diperbarui" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/daftar-penyuluh/{id}": { "delete": { "summary": "Menghapus event tani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Data Penyuluh"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID data yang akan dicari" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data petani berhasil dihapus" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/select-tani/{kecamatan}": { "get": { "summary": "Menacari Penyuluh berdasarkan Kecamantan Yang Dikirim", "security": [ { "bearerToken": [] } ], "tags": ["Select"], "parameters": [ { "in": "path", "name": "kecamatan", "required": true, "schema": { "type": "string" }, "description": "kecamatan penyuluh yang akan dicari" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data penyuluh berhasil ditemukan" }, "penyuluh": { "type": "object", "properties": { "nama": { "type": "string", "example": "mario fian" }, "kecamatan": { "type": "string", "example": "muara lama banget" }, "role": { "type": "string", "example": "penyuluh" } } } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/tanaman-petani": { "post": { "tags": ["Data Tani"], "summary": "Menambahkan Tanaman tani", "security": [ { "bearerToken": [] } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "dataPersonId": { "type": "number", "example": "2" }, "statusLahan": { "type": "string", "example": "milik sendiri" }, "luasLahan": { "type": "string", "example": "200 M2" }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Contoh Jenis" }, "jenisPanen": { "type": "string", "example": "Contoh Jenis Panen" }, "komoditas": { "type": "string", "example": "Contoh Komoditas" }, "musimTanam": { "type": "integer", "example": 1 }, "tanggalTanam": { "type": "string", "example": "2023-07-18" }, "perkiraanPanen": { "type": "string", "example": "2023-12-31" }, "perkiraanHasilPanen": { "type": "integer", "example": 100 }, "realisasiHasilPanen": { "type": "integer", "example": 80 } }, "required": [ "dataPersonId", "statusLahan", "luasLahan", "kategori", "jenis", "jenisPanen", "komoditas", "musimTanam", "tanggalTanam", "perkiraanPanen", "perkiraanHasilPanen", "realisasiHasilPanen" ] } } } }, "responses": { "200": { "description": "Berhasil menambahkan Tanaman Petani", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Menambahkan Tanaman Petani" }, "dataTanamanPetani": { "type": "object", "properties": { "dataPersonId": { "type": "number", "example": "2" }, "statusLahan": { "type": "string", "example": "milik sendiri" }, "luasLahan": { "type": "string", "example": "200 M2" }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Contoh Jenis" }, "jenisPanen": { "type": "string", "example": "Contoh Jenis Panen" }, "komoditas": { "type": "string", "example": "Contoh Komoditas" }, "musimTanam": { "type": "integer", "example": 2023 }, "tanggalTanam": { "type": "string", "example": "2023-07-18" }, "perkiraanPanen": { "type": "string", "example": "2023-12-31" }, "perkiraanHasilPanen": { "type": "integer", "example": 100 }, "realisasiHasilPanen": { "type": "integer", "example": 80 } } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "NIK tidak boleh kosong" } } } } } }, "500": { "description": "Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } } } }, "/tanaman-petani/{id}": { "get": { "tags": ["Data Tani"], "summary": "Mencari Tanaman Petani Berdasarkan Id Petani", "security": [ { "bearerToken": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID Petani yang akan dicari tanaman Petaninya" } ], "responses": { "200": { "description": "Berhasil mendapatkan Tanaman Petani", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil mendapatkan Tanaman Petani" }, "dataTanamanPetani": { "type": "object", "properties": { "dataPersonId": { "type": "number", "example": "2" }, "statusLahan": { "type": "string", "example": "milik sendiri" }, "luasLahan": { "type": "string", "example": "200 M2" }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Contoh Jenis" }, "jenisPanen": { "type": "string", "example": "Contoh Jenis Panen" }, "komoditas": { "type": "string", "example": "Contoh Komoditas" }, "musimTanam": { "type": "integer", "example": 2023 }, "tanggalTanam": { "type": "string", "example": "2023-07-18" }, "perkiraanPanen": { "type": "string", "example": "2023-12-31" }, "perkiraanHasilPanen": { "type": "integer", "example": 100 }, "realisasiHasilPanen": { "type": "integer", "example": 80 } } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "field tidak boleh kosong" } } } } } }, "500": { "description": "Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } } }, "put": { "tags": ["Data Tani"], "summary": "Merubah Tanaman petani berdasarkan id", "security": [ { "bearerToken": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID tanaman yang akan di ubah" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "dataPersonId": { "type": "number", "example": "2" }, "statusLahan": { "type": "string", "example": "milik sendiri" }, "luasLahan": { "type": "string", "example": "200 M2" }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Contoh Jenis" }, "jenisPanen": { "type": "string", "example": "Contoh Jenis Panen" }, "komoditas": { "type": "string", "example": "Contoh Komoditas" }, "musimTanam": { "type": "integer", "example": 1 }, "tanggalTanam": { "type": "string", "example": "2023-07-18" }, "perkiraanPanen": { "type": "string", "example": "2023-12-31" }, "perkiraanHasilPanen": { "type": "integer", "example": 100 }, "realisasiHasilPanen": { "type": "integer", "example": 80 } }, "required": [ "dataPersonId", "statusLahan", "luasLahan", "kategori", "jenis", "jenisPanen", "komoditas", "musimTanam", "tanggalTanam", "perkiraanPanen", "perkiraanHasilPanen", "realisasiHasilPanen" ] } } } }, "responses": { "200": { "description": "Berhasil Mengubah Tanaman Petani", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil Mengubah Tanaman Petani" }, "dataTanamanPetani": { "type": "object", "properties": { "dataPersonId": { "type": "number", "example": "2" }, "statusLahan": { "type": "string", "example": "milik sendiri" }, "luasLahan": { "type": "string", "example": "200 M2" }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Contoh Jenis" }, "jenisPanen": { "type": "string", "example": "Contoh Jenis Panen" }, "komoditas": { "type": "string", "example": "Contoh Komoditas" }, "musimTanam": { "type": "integer", "example": 2023 }, "tanggalTanam": { "type": "string", "example": "2023-07-18" }, "perkiraanPanen": { "type": "string", "example": "2023-12-31" }, "perkiraanHasilPanen": { "type": "integer", "example": 100 }, "realisasiHasilPanen": { "type": "integer", "example": 80 } } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "field tidak boleh kosong" } } } } } }, "500": { "description": "Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } } }, "delete": { "summary": "Menghapus tanaman petani berdasarkan ID", "security": [ { "bearerToken": [] } ], "tags": ["Data Tani"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID tanaman petani yang akan hapus" } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "data tanaman petani berhasil dihapus" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/tanaman-petani/detail/{id}": { "get": { "tags": ["Data Tani"], "summary": "Mencari Tanaman Petani Berdasarkan Id", "security": [ { "bearerToken": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID tanaman yang akan dicari" } ], "responses": { "200": { "description": "Berhasil mendapatkan Tanaman Petani", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Berhasil mendapatkan Tanaman Petani" }, "dataTanamanPetani": { "type": "object", "properties": { "dataPersonId": { "type": "number", "example": "2" }, "statusLahan": { "type": "string", "example": "milik sendiri" }, "luasLahan": { "type": "string", "example": "200 M2" }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Contoh Jenis" }, "jenisPanen": { "type": "string", "example": "Contoh Jenis Panen" }, "komoditas": { "type": "string", "example": "Contoh Komoditas" }, "musimTanam": { "type": "integer", "example": 2023 }, "tanggalTanam": { "type": "string", "example": "2023-07-18" }, "perkiraanPanen": { "type": "string", "example": "2023-12-31" }, "perkiraanHasilPanen": { "type": "integer", "example": 100 }, "realisasiHasilPanen": { "type": "integer", "example": 80 } } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "field tidak boleh kosong" } } } } } }, "500": { "description": "Server Error", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Internal Server Error" } } } } } } } } }, "/tanaman-petani/statistik": { "get": { "summary": "Mendapatkan Statistik Tanaman Petani", "tags": ["Tanaman Petani"], "parameters": [ { "in": "query", "name": "month", "required": true, "schema": { "type": "integer" }, "description": "Bulan yang akan dicari" }, { "in": "query", "name": "year", "required": true, "schema": { "type": "integer" }, "description": "Tahun yang akan dicari" }, { "in": "query", "name": "lineType", "required": false, "schema": { "type": "string", "enum": ["komoditas", "kategori"] }, "description": "Grouping yang akan digunakan untuk line chart" }, { "in": "query", "name": "pieType", "required": false, "schema": { "type": "string", "enum": ["komoditas", "kategori"] }, "description": "Grouping yang akan digunakan untuk pie chart" } ], "responses": { "200": { "description": "Berhasil mendapatkan Statistik Tanaman Petani", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "example": "Data berhasil didapatkan", "type": "string" }, "data": { "type": "object", "properties": { "statistik": { "type": "array", "items": { "$ref": "#/components/schemas/Statistik Tanaman Petani" } }, "summary": { "type": "array", "items": { "$ref": "#/components/schemas/Summary Tanaman Petani" } }, "latest": { "type": "array", "items": { "$ref": "#/components/schemas/Tanaman Petani" } } } } } } } } } } } }, "/chart": { "post": { "summary": "Menambahkan Data Chart", "tags": ["Chart"], "security": [ { "bearerToken": [] } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "label": { "type": "string", "example": "Mangga" }, "total": { "type": "integer", "example": 100 }, "tanggalPanen": { "type": "string", "format": "date", "example": "2023-07-26" }, "jenis": { "type": "string", "enum": ["Buah-Buahan", "Sayuran"], "example": "Buah-Buahan" }, "jenisPanen": { "type": "string", "enum": ["Tahunan", "Bulanan"], "example": "Tahunan" } }, "required": [ "label", "total", "tanggalPanen", "jenis", "jenisPanen" ] } } } }, "responses": { "201": { "description": "Data chart berhasil ditambahkan", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Data Berhasil Ditambahkan" }, "dataChart": { "type": "object", "properties": { "label": { "type": "string", "example": "Padi" }, "total": { "type": "integer", "example": 100 }, "tanggalPanen": { "type": "string", "format": "date", "example": "2023-07-26" }, "jenis": { "type": "string", "enum": ["Buah-Buahan", "Sayuran"], "example": "Buah-Buahan" }, "jenisPanen": { "type": "string", "enum": ["Tahunan", "Bulanan"], "example": "Tahunan" } } } } } } } }, "400": { "description": "Permintaan tidak valid", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Jenis Panen Tidak Boleh Kosong" } } } } } }, "500": { "description": "Error server", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "get": { "summary": "Mendapatkan Data Chart", "tags": ["Chart"], "parameters": [ { "in": "query", "name": "jenisPanen", "required": true, "schema": { "type": "string", "enum": ["Tahunan", "Bulanan"] }, "description": "Jenis panen (Tahunan atau Bulanan)" }, { "in": "query", "name": "jenis", "required": true, "schema": { "type": "string", "enum": ["Buah-Buahan", "Sayuran"] }, "description": "Jenis komoditas panen (Buah-Buahan atau Sayuran)" } ], "responses": { "200": { "description": "Respon sukses dengan data chart", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string", "example": "Padi" }, "total": { "type": "integer", "example": 100 }, "count": { "type": "integer", "example": 5 }, "tanggalPanen": { "type": "string", "format": "date", "example": "2023-07-26" } } } } } } }, "500": { "description": "Error server", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/laporan-tanam": { "post": { "summary": "Menambahkan Data Laporan Tanam", "tags": ["Laporan Tanam"], "security": [ { "bearerToken": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "tanamanPetaniId": { "type": "integer", "example": 100 }, "tanggalLaporan": { "type": "string", "format": "date", "example": "2023-07-26" }, "komdisiTanaman": { "type": "string", "example": "Baik Dan Segar" }, "deskripsi": { "type": "string", "example": "Tanaman Ini Berasal Dari Arab saurdi Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil nostrum incidunt suscipit distinctio nobis architecto tempore quaerat dolores nulla itaque!" }, "fotoTanaman": { "type": "string", "format": "binary" } }, "required": [ "tanamanPetaniId", "tanggalLaporan", "komdisiTanaman", "deskripsi" ] } } } }, "responses": { "201": { "description": "Data laporan tanam berhasil ditambahkan", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Data Berhasil Ditambahkan" }, "newLaporanTanam": { "type": "object", "properties": { "tanamanPetaniId": { "type": "integer", "example": 100 }, "tanggalLaporan": { "type": "string", "format": "date", "example": "2023-07-26" }, "komdisiTanaman": { "type": "string", "example": "Baik Dan Segar" }, "deskripsi": { "type": "string", "example": "Tanaman Ini Berasal Dari Arab saurdi Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil nostrum incidunt suscipit distinctio nobis architecto tempore quaerat dolores nulla itaque!" }, "fotoTanaman": { "type": "string", "eample": "http://omagekit" } } } } } } } } }, "400": { "description": "Permintaan tidak valid", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Jenis Panen Tidak Boleh Kosong" } } } } } }, "500": { "description": "Error server", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "/laporan-tanam/{id}": { "put": { "summary": "Merubah laporan chart berdasarkan id", "tags": ["Laporan Tanam"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID laporan yang akan di ubah" } ], "security": [ { "bearerToken": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "tanggalLaporan": { "type": "string", "format": "date", "example": "2023-07-26" }, "komdisiTanaman": { "type": "string", "example": "Baik Dan Segar" }, "deskripsi": { "type": "string", "example": "Tanaman Ini Berasal Dari Arab saurdi Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil nostrum incidunt suscipit distinctio nobis architecto tempore quaerat dolores nulla itaque!" }, "fotoTanaman": { "type": "string", "format": "binary" } }, "required": ["tanggalLaporan", "komdisiTanaman", "deskripsi"] } } } }, "responses": { "201": { "description": "Data laporan Tanam berhasil ditambahkan", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Data laporan Tanam berhasil ditambahkan" }, "newLaporanTanam": { "type": "object", "properties": { "tanamanPetaniId": { "type": "integer", "example": 100 }, "tanggalLaporan": { "type": "string", "format": "date", "example": "2023-07-26" }, "komdisiTanaman": { "type": "string", "example": "Baik Dan Segar" }, "deskripsi": { "type": "string", "example": "Tanaman Ini Berasal Dari Arab saurdi Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil nostrum incidunt suscipit distinctio nobis architecto tempore quaerat dolores nulla itaque!" }, "fotoTanaman": { "type": "string", "eample": "http://omagekit" } } } } } } } }, "400": { "description": "Permintaan tidak valid", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Jenis Panen Tidak Boleh Kosong" } } } } } }, "500": { "description": "Error server", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "get": { "summary": "Mendapatkan semua laporan berdasarkan id tanaman", "security": [ { "bearerToken": [] } ], "tags": ["Laporan Tanam"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID tanaman yang akan di cari laporanya" } ], "responses": { "200": { "description": "Data laporan Tanam berhasil didapatkan", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Data laporan Tanam berhasil didapatkan" }, "newLaporanTanam": { "type": "object", "properties": { "tanamanPetaniId": { "type": "integer", "example": 100 }, "tanggalLaporan": { "type": "string", "format": "date", "example": "2023-07-26" }, "komdisiTanaman": { "type": "string", "example": "Baik Dan Segar" }, "deskripsi": { "type": "string", "example": "Tanaman Ini Berasal Dari Arab saurdi Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil nostrum incidunt suscipit distinctio nobis architecto tempore quaerat dolores nulla itaque!" }, "fotoTanaman": { "type": "string", "eample": "http://omagekit" } } } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } }, "delete": { "summary": "menghapus laporan Tanaman berdasarkan id", "security": [ { "bearerToken": [] } ], "tags": ["Laporan Tanam"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID tanaman yang akan di hapus laporanya" } ], "responses": { "200": { "description": "Data laporan Tanam berhasil dihapus", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Data laporan Tanam berhasil dihapus" } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/laporan-tanam/detail/{id}": { "get": { "summary": "Mendapatkan laporan tanam berdasarkan id", "security": [ { "bearerToken": [] } ], "tags": ["Laporan Tanam"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "description": "ID laporan tanam" } ], "responses": { "200": { "description": "Data laporan Tanam berhasil didapatkan", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Data laporan Tanam berhasil didapatkan" }, "newLaporanTanam": { "type": "object", "properties": { "tanamanPetaniId": { "type": "integer", "example": 100 }, "tanggalLaporan": { "type": "string", "format": "date", "example": "2023-07-26" }, "komdisiTanaman": { "type": "string", "example": "Baik Dan Segar" }, "deskripsi": { "type": "string", "example": "Tanaman Ini Berasal Dari Arab saurdi Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nihil nostrum incidunt suscipit distinctio nobis architecto tempore quaerat dolores nulla itaque!" }, "fotoTanaman": { "type": "string", "eample": "http://omagekit" } } } } } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/chat/messages/penyuluh": { "get": { "summary": "ini untuk user petani yang mencari chatt dengan penyuluh", "security": [ { "bearerToken": [] } ], "tags": ["Chatt"], "parameters": [ { "in": "query", "name": "desa", "required": true, "schema": { "type": "string" }, "example": "Dero", "description": "kirimin desa user yang sedang login untuk mendapatkan desa binaan penyuluh" }, { "in": "query", "name": "userId", "required": true, "schema": { "type": "integer" }, "example": 132, "description": "kirimin desa user yang sedang login untuk mendapatkan desa binaan penyuluh" } ], "responses": { "200": { "description": "chhat id dan message akan di kirimkan", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/chat/petani/{id}": { "get": { "summary": "mencari semua petani yang masuk ke wilayah binaannya", "security": [ { "bearerToken": [] } ], "tags": ["Chatt"], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "integer" }, "example": 130, "description": "kirimin id penyuluh yang sedang ligin" } ], "responses": { "200": { "description": "list petani yang masuk ke wilayah binaannya", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } }, "/chat/msesages/petani": { "get": { "summary": "penyuluh ketika mengclick salah satu daftar petani", "security": [ { "bearerToken": [] } ], "tags": ["Chatt"], "parameters": [ { "in": "query", "name": "userId", "required": true, "schema": { "type": "integer" }, "example": 130, "description": "kirimin Id penyuluh yang sedang login" }, { "in": "query", "name": "partnerId", "required": true, "schema": { "type": "integer" }, "example": 132, "description": "kirimin Id petani yang di klik list petaninya" } ], "responses": { "200": { "description": "chhat id dan message akan di kirimkan", "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "ID tidak valid atau data tidak ditemukan" } } } } } }, "500": { "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan pada server" } } } } } } } } } }, "components": { "schemas": { "Statistik Tanaman Petani": { "type": "object", "properties": { "date": { "type": "string", "format": "date-time", "example": "2023-31-01" }, "komoditas": { "type": "string", "example": "UBI JALAR" }, "kategori": { "type": "string", "example": "HORTIKULTURA" }, "count": { "type": "integer", "example": 1 } } }, "Summary Tanaman Petani": { "type": "object", "properties": { "komoditas": { "type": "string", "example": "UBI JALAR" }, "kategori": { "type": "string", "example": "HORTIKULTURA" }, "count": { "type": "integer", "example": 1 } } }, "Tanaman Petani": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "statusKepemilikanLahan": { "type": "string", "enum": ["MILIK SENDIRI", "SEWA", "PINJAM"], "example": "MILIK SENDIRI" }, "luasLahan": { "type": "integer", "example": 200 }, "kategori": { "type": "string", "example": "Tanaman Pangan" }, "jenis": { "type": "string", "example": "Padi" }, "komoditas": { "type": "string", "example": "Padi" }, "periodeMusimTanam": { "type": "string", "enum": ["KEMARAU", "HUJAN"], "example": "KEMARAU" }, "periodeBulanTanam": { "type": "string", "enum": [ "JANUARI", "FEBRUARI", "MARET", "APRIL", "MEI", "JUNI", "JULI", "AGUSTUS", "SEPTEMBER", "OKTOBER", "NOVEMBER", "DESEMBER" ], "example": "JANUARI" }, "prakiraanLuasPanen": { "type": "integer", "example": 100 }, "prakiraanProduksiPanen": { "type": "integer", "example": 100 }, "prakiraanBulanPanen": { "type": "string", "enum": [ "JANUARI", "FEBRUARI", "MARET", "APRIL", "MEI", "JUNI", "JULI", "AGUSTUS", "SEPTEMBER", "OKTOBER", "NOVEMBER", "DESEMBER" ], "example": "JANUARI" }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-07-26T07:26:58.000Z" }, "updatedAt": { "type": "string", "format": "date-time", "example": "2021-07-26T07:26:58.000Z" }, "fk_petaniId": { "type": "integer", "example": 1 } } }, "User": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32", "example": 1 }, "NIK": { "type": "string", "example": "123456789" }, "NIP": { "type": "string", "example": "123456789" }, "NoWa": { "type": "string", "example": "0878702545145" }, "alamat": { "type": "string", "example": "taktakan serang banten" }, "desa": { "type": "string", "example": "taktakan" }, "nama": { "type": "string", "example": "fian" }, "kecamatan": { "type": "string", "example": "taktakan" }, "password": { "type": "string", "example": "yskdjdyuuu" }, "createdAt": { "type": "string", "format": "date-time", "example": "2023-06-07T03:54:47.000Z" }, "updatedAt": { "type": "string", "format": "date-time", "example": "2023-06-07T03:54:47.000Z" } } }, "DaftarTani": { "type": "object", "properties": { "NIK": { "type": "string" }, "NoWa": { "type": "string" }, "alamat": { "type": "string" }, "desa": { "type": "string" }, "nama": { "type": "string" }, "kecamatan": { "type": "string" }, "password": { "type": "string" }, "tanamanPetaniId": { "type": "integer" }, "kelompokId": { "type": "integer" }, "laporanTanamId": { "type": "integer" }, "gapoktan": { "type": "string" }, "penyuluh": { "type": "string" }, "namaKelompok": { "type": "string" }, "foto": { "type": "string" }, "statusLahan": { "type": "string" }, "luasLahan": { "type": "string" }, "kategori": { "type": "string" }, "jenis": { "type": "string" }, "komoditas": { "type": "string" }, "musimTanam": { "type": "integer" }, "tanggalTanam": { "type": "string", "format": "date-time" }, "perkiraanPanen": { "type": "string", "format": "date-time" } } }, "LaporanTanam": { "type": "object", "properties": { "tanggalLaporan": { "type": "string", "format": "date-time" }, "komdisiTanaman": { "type": "string" }, "deskripsi": { "type": "string" }, "fotoTanaman": { "type": "string" } } }, "EventTani": { "type": "object", "properties": { "namaKegiatan": { "type": "string" }, "tanggalAcara": { "type": "string", "format": "date" }, "waktuAcara": { "type": "string" }, "tempat": { "type": "string" }, "peserta": { "type": "string" }, "isi": { "type": "string" }, "fotoKegiatan": { "type": "string", "format": "binary" } } }, "InfoTani": { "type": "object", "properties": { "judul": { "type": "string" }, "tanggal": { "type": "string", "format": "date" }, "status": { "type": "string" }, "kategori": { "type": "string" }, "isi": { "type": "string" }, "fotoBerita": { "type": "string", "format": "binary" } } }, "Penjual": { "type": "object", "properties": { "profesiPenjual": { "type": "string" }, "namaProducts": { "type": "string" }, "stok": { "type": "integer" }, "satuan": { "type": "string" }, "harga": { "type": "string" }, "deskripsi": { "type": "string" }, "fotoTanaman": { "type": "string", "format": "binary" }, "status": { "type": "string" } } } }, "securitySchemes": { "bearerToken": { "type": "apiKey", "in": "header", "name": "Authorization" } } } }