add encounter-checkin
This commit is contained in:
@@ -102,6 +102,27 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) CheckIn(w http.ResponseWriter, r *http.Request) {
|
||||
dto := e.CheckinDto{}
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||
return
|
||||
}
|
||||
|
||||
// validate request body
|
||||
if valid := validateRequestCheckIn(w, dto); !valid {
|
||||
return
|
||||
}
|
||||
|
||||
dto.Id = uint(id)
|
||||
res, err := u.CheckIn(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
func (obj myBase) Process(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
|
||||
Reference in New Issue
Block a user