mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-20 15:01:36 +01:00
debug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Location from "App/Models/Location";
|
||||
import StoreValidator from "App/Validators/locations/StoreValidator";
|
||||
import LocationValidator from "App/Validators/location/LocationValidator";
|
||||
|
||||
export default class LocationsController {
|
||||
|
||||
@@ -20,8 +20,8 @@ export default class LocationsController {
|
||||
})
|
||||
}
|
||||
|
||||
public async set ({ request, response }: HttpContextContract) {
|
||||
const data = await request.validate(StoreValidator)
|
||||
public async add ({ request, response }: HttpContextContract) {
|
||||
const data = await request.validate(LocationValidator)
|
||||
await Location.create(data)
|
||||
return response.status(200).send({
|
||||
message: 'Location successfully added !'
|
||||
|
||||
47
app/Controllers/Http/MeController.ts
Normal file
47
app/Controllers/Http/MeController.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||
|
||||
export default class MeController {
|
||||
|
||||
public me ({ response }: HttpContextContract) {
|
||||
return response.status(200).send({
|
||||
pronouns: "Arthur",
|
||||
home: ["Paris", "France"],
|
||||
passions: [
|
||||
"Dev",
|
||||
"DevOps",
|
||||
"New technologies",
|
||||
"Gaming"
|
||||
],
|
||||
code: [
|
||||
"Javascript",
|
||||
"Typescript",
|
||||
"HTML",
|
||||
"CSS",
|
||||
"GoLang",
|
||||
"Python",
|
||||
"Java"
|
||||
],
|
||||
askMeAbout: [
|
||||
"Web dev",
|
||||
"Tech",
|
||||
"Consulting",
|
||||
"Cloud native",
|
||||
"Software dev"
|
||||
],
|
||||
technologies: {
|
||||
webApp: ["VueJs", "NuxtJs", "Sass", "Tailwind"],
|
||||
desktopApp: ["ElectronJs"],
|
||||
mobileApp: ["React Native"],
|
||||
backEnd: {
|
||||
typescript: ["AdonisJs"],
|
||||
java: ["Spring"]
|
||||
},
|
||||
databases: ["MongoDB", "MariaDB", "Redis"],
|
||||
messaging: ["RabbitMq"],
|
||||
other: ["Docker", "Git"],
|
||||
architecture: ["microservices", "event-driven", "design system pattern"],
|
||||
operating_systems: ['Windows', 'Linux']
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
22
app/Controllers/Http/ProjectsController.ts
Normal file
22
app/Controllers/Http/ProjectsController.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Project from "App/Models/Project";
|
||||
import ProjectValidator from "App/Validators/project/ProjectValidator";
|
||||
|
||||
export default class ProjectsController {
|
||||
|
||||
public async get ({ response }: HttpContextContract) {
|
||||
const projects = await Project.query().orderBy('progress', 'desc')
|
||||
return response.status(200).send({
|
||||
projects
|
||||
})
|
||||
}
|
||||
|
||||
public async add ({ request, response}: HttpContextContract) {
|
||||
const data = await request.validate(ProjectValidator)
|
||||
await Project.create(data)
|
||||
return response.status(200).send({
|
||||
message: 'Project successfully created'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import {getTotalStats, getWeeklyStats, getMonthlyStats, getOtherStats, getDailyStats} from 'App/Helpers/StatsHelper'
|
||||
import {getTotalStats, getWeeklyStats, getMonthlyStats, getDailyStats} from 'App/Helpers/StatsHelper'
|
||||
import DockerBuild from "App/Models/DockerBuild"
|
||||
import DockerCommand from "App/Models/DockerCommand"
|
||||
|
||||
@@ -10,13 +10,11 @@ export default class StatsController {
|
||||
const weekly = await getWeeklyStats()
|
||||
const monthly = await getMonthlyStats()
|
||||
const total = await getTotalStats()
|
||||
const other = await getOtherStats()
|
||||
return response.status(200).send({
|
||||
daily: daily,
|
||||
weekly: weekly,
|
||||
monthly: monthly,
|
||||
total: total,
|
||||
other : other
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user