コード例 #1
0
func (u *RequestHandler) RemoveBloodRequest(c web.C, w http.ResponseWriter, r *http.Request) *app.Err {
	bloodReq := models.BloodRequest{}
	bloodReq.ReqId = r.FormValue("req_id")
	bloodReq.UserId = r.FormValue("user_id")
	_, _, err := models.DeleteBloodRequest(&bloodReq, u.MS)
	if err != nil {
		return app.InternalServerError.SetErr(err.Error())
	}
	return nil //TODO  success
}
コード例 #2
0
func (u *RequestHandler) GetRequestDetails(c web.C, w http.ResponseWriter, r *http.Request) *app.Err {
	bloodReq := models.BloodRequest{}
	bloodReq.ReqId = r.FormValue("req_id")
	status, bloodRes, err := models.GetBloodRequest(&bloodReq, u.MS)
	if err != nil {
		return app.InternalServerError.SetErr(err.Error())
	}
	if status != false {
		u.Respond(w, 200, bloodRes)
	}
	u.NotFound(c, w, r)
	return nil
}