Ver a proveniência

Added a bunch of controllers

main
rpm-mcarman há 2 anos
ascendente
cometimento
bfc019b75f
29 ficheiros alterados com 195 adições e 11 eliminações
  1. +0
    -0
      swift
  2. +11
    -11
      Sources/App/Controllers/BaseControllers/cntrlFuel.swift
  3. +0
    -0
      Sources/App/Controllers/BaseControllers/cntrlGate.swift
  4. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlIncompleteReason.swift
  5. +0
    -0
      Sources/App/Controllers/BaseControllers/cntrlInputType.swift
  6. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlJobSite.swift
  7. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlLevel.swift
  8. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlLocation.swift
  9. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlNoteType.swift
  10. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlPart.swift
  11. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlPriority.swift
  12. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlReason.swift
  13. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlRepairType.swift
  14. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlSMSCCode.swift
  15. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlSignatureType.swift
  16. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlState.swift
  17. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlStatus.swift
  18. +0
    -0
      Sources/App/Controllers/BaseControllers/cntrlValueType.swift
  19. +8
    -0
      Sources/App/Controllers/BaseControllers/cntrlViscosity.swift
  20. +8
    -0
      Sources/App/Controllers/CompartmentControllers/cntrlCompartment.swift
  21. +8
    -0
      Sources/App/Controllers/CompartmentControllers/cntrlCompartmentLocation.swift
  22. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlContact.swift
  23. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlContactInfo.swift
  24. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlCustomer.swift
  25. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlEquipment.swift
  26. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlMake.swift
  27. +0
    -0
      swift
  28. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlObjectProperty.swift
  29. +8
    -0
      Sources/App/Controllers/CustomerControllers/cntrlProduct.swift

Sources/App/Controllers/BaseControllers/File → swift Ver ficheiro


Sources/App/Controllers/cntrlLocation.swift → Sources/App/Controllers/BaseControllers/cntrlFuel.swift Ver ficheiro

@@ -1,5 +1,5 @@
//
// Location.swift
// cntrlFuel.swift
//
//
// Created by Michiel Carman on 4/1/24.
@@ -8,9 +8,9 @@
import Fluent
import Vapor

struct cntrlLocation: RouteCollection {
struct cntrlFuel: RouteCollection {
func boot(routes: RoutesBuilder) throws {
let rts = routes.grouped("locations")
let rts = routes.grouped("fuels")
rts.get(use: index)
rts.post(use: create)
rts.put(use: update)
@@ -19,18 +19,18 @@ struct cntrlLocation: RouteCollection {
}
}
func index(req: Request) async throws -> [mdlLocation] {
try await mdlLocation.query(on: req.db).all()
func index(req: Request) async throws -> [mdlFuel] {
try await mdlFuel.query(on: req.db).all()
}
func create(req: Request) async throws -> mdlLocation {
let obj = try req.content.decode(mdlLocation.self)
func create(req: Request) async throws -> mdlFuel {
let obj = try req.content.decode(mdlFuel.self)
try await obj.save(on: req.db)
return obj
}
func update(req: Request) async throws -> mdlLocation{
let obj = try req.content.decode(mdlLocation.self)
let dbobj = try await mdlLocation.query(on: req.db).filter(\.$id == obj.id!).first()!
func update(req: Request) async throws -> mdlFuel{
let obj = try req.content.decode(mdlFuel.self)
let dbobj = try await mdlFuel.query(on: req.db).filter(\.$id == obj.id!).first()!
dbobj.updatedate = Date()
dbobj.updateuserid = -1
@@ -40,7 +40,7 @@ struct cntrlLocation: RouteCollection {
}
func delete(req: Request) async throws -> HTTPStatus {
guard let obj = try await mdlLocation.find(req.parameters.get("id"), on: req.db) else {
guard let obj = try await mdlFuel.find(req.parameters.get("id"), on: req.db) else {
throw Abort(.notFound)
}
try await obj.delete(on: req.db)

Sources/App/Controllers/cntrlGate.swift → Sources/App/Controllers/BaseControllers/cntrlGate.swift Ver ficheiro


+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlIncompleteReason.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

Sources/App/Controllers/BaseControllers/File.swift → Sources/App/Controllers/BaseControllers/cntrlInputType.swift Ver ficheiro


+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlJobSite.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlLevel.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlLocation.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlNoteType.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlPart.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlPriority.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlReason.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlRepairType.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlSMSCCode.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlSignatureType.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlState.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlStatus.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

Sources/App/Controllers/cntrlValueType.swift → Sources/App/Controllers/BaseControllers/cntrlValueType.swift Ver ficheiro


+ 8
- 0
Sources/App/Controllers/BaseControllers/cntrlViscosity.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CompartmentControllers/cntrlCompartment.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CompartmentControllers/cntrlCompartmentLocation.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlContact.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlContactInfo.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 2.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlCustomer.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 3.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlEquipment.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 4.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlMake.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 5.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

Sources/App/Controllers/BaseControllers/File → swift Ver ficheiro


+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlObjectProperty.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File 7.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

+ 8
- 0
Sources/App/Controllers/CustomerControllers/cntrlProduct.swift Ver ficheiro

@@ -0,0 +1,8 @@
//
// File.swift
//
//
// Created by Michiel Carman on 4/2/24.
//

import Foundation

Carregando…
Cancelar
Guardar