| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /**
- * @ File:
- * @ Date: 2021/1/25 16:15
- * @ Author: JYQ
- * @ Description:
- */
- package controller
- import (
- "net/http"
- "video_course/service"
- )
- type HrSensors struct {
- BaseController
- }
- type UpdateHrSensorsInfo struct {
- ResponseBase
- HrId int
- }
- // HrSensorsUpdate godoc
- // @Summary 心率带信息查询和更新
- // @tags HrSensors
- // @Description 心率带信息查询和更新
- // @Accept x-www-form-urlencoded
- // @Produce json
- // @Param token formData string true "Token"
- // @Param sn formData string true "心率带编号"
- // @Success 200 {object} controller.ResponseBase
- // @Router /HrSensors/HrSensorsUpdate [post]
- func (h *HrSensors) HrSensorsUpdate() (err error) {
- token := h.Ctx().PostForm("token")
- sn := h.Ctx().PostForm("sn")
- hrId, err := service.HrSensors{}.HrSensorsUpdate(token, sn)
- if err != nil {
- return
- }
- r := UpdateHrSensorsInfo{
- newResponseBase(),
- hrId,
- }
- h.Ctx().JSON(http.StatusOK, r)
- return
- }
|