add delete and update internal reference
This commit is contained in:
@@ -32,39 +32,39 @@ func (obj myBase) GetList(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (obj myBase) GetDetail(w http.ResponseWriter, r *http.Request) {
|
||||
//id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
//if id <= 0 {
|
||||
// return
|
||||
//}
|
||||
//dto := e.ReadDetailDto{}
|
||||
//dto.Id = uint16(id)
|
||||
//res, err := u.ReadDetail(dto)
|
||||
//rw.DataResponse(w, res, err)
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
dto := eir.ReadDetailDto{}
|
||||
dto.Id = uint16(id)
|
||||
res, err := uir.ReadDetail(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
||||
//id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
//if id <= 0 {
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//dto := e.UpdateDto{}
|
||||
//if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
// return
|
||||
//}
|
||||
//dto.Id = uint16(id)
|
||||
//res, err := u.Update(dto)
|
||||
//rw.DataResponse(w, res, err)
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
dto := eir.UpdateDto{}
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
dto.Id = uint16(id)
|
||||
res, err := uir.Update(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
//id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
//if id <= 0 {
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//dto := e.DeleteDto{}
|
||||
//dto.Id = uint16(id)
|
||||
//res, err := u.Delete(dto)
|
||||
//rw.DataResponse(w, res, err)
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
dto := eir.DeleteDto{}
|
||||
dto.Id = uint16(id)
|
||||
res, err := uir.Delete(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
inpatient "simrs-vx/internal/domain/main-entities/inpatient"
|
||||
installation "simrs-vx/internal/domain/main-entities/installation"
|
||||
insurancecompany "simrs-vx/internal/domain/main-entities/insurance-company"
|
||||
checkoutpolies "simrs-vx/internal/domain/main-entities/internal-reference"
|
||||
internalreference "simrs-vx/internal/domain/main-entities/internal-reference"
|
||||
item "simrs-vx/internal/domain/main-entities/item"
|
||||
itemprice "simrs-vx/internal/domain/main-entities/item-price"
|
||||
laborant "simrs-vx/internal/domain/main-entities/laborant"
|
||||
@@ -152,6 +152,6 @@ func getMainEntities() []any {
|
||||
&chemo.Chemo{},
|
||||
&midwife.Midwife{},
|
||||
&postalregion.PostalRegion{},
|
||||
&checkoutpolies.CheckoutPolies{},
|
||||
&internalreference.InternalReference{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user