feat/things-munaja: device and mcu order
This commit is contained in:
@@ -173,6 +173,7 @@ func SetRoutes() http.Handler {
|
||||
"POST /": mcuorder.O.Create,
|
||||
"PATCH /{id}": mcuorder.O.Update,
|
||||
"DELETE /{id}": mcuorder.O.Delete,
|
||||
"PATCH /{id}/submit": mcuorder.O.Submit,
|
||||
"PATCH /{id}/complete": mcuorder.O.Complete,
|
||||
"PATCH /{id}/set-schedule": mcuorder.O.SetSchedule,
|
||||
})
|
||||
|
||||
@@ -85,6 +85,18 @@ func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Submit(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.ReadDetailDto{}
|
||||
dto.Id = uint(id)
|
||||
res, err := u.Submit(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Complete(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
|
||||
Reference in New Issue
Block a user