lhs před 4 roky
rodič
revize
ed3a48de84

+ 22 - 24
controller/auth.go

@@ -4,8 +4,6 @@ import (
 	"net/http"
 	"video_course/service"
 
-	"github.com/sirupsen/logrus"
-
 	"github.com/mojocn/base64Captcha"
 )
 
@@ -13,28 +11,28 @@ type Auth struct {
 	BaseController
 }
 
-// SignUp godoc
-// @Summary 用户添加
-// @tags Auth
-// @Description 用户添加
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param userCode formData string true "用户名"
-// @Param password formData string true "密码"
-// @Param email formData string false "邮箱"
-// @Param phone formData string false "手机号"
-// @Param name formData string false "姓名"
-// @Success 200 {object} controller.ResponseBase
-// @Router /Auth/SignUp [post]
-func (a *Auth) HttpPostSignUp() (err error) {
-	userCode := a.Ctx().PostForm("userCode")
-	test := a.PostFromInt("test")
-	test2 := a.PostFromIntPtr("test2")
-	logrus.Info(userCode, test, test2)
-
-	a.Ctx().JSON(http.StatusOK, newResponseBase())
-	return
-}
+//// SignUp godoc
+//// @Summary 用户添加
+//// @tags Auth
+//// @Description 用户添加
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param userCode formData string true "用户名"
+//// @Param password formData string true "密码"
+//// @Param email formData string false "邮箱"
+//// @Param phone formData string false "手机号"
+//// @Param name formData string false "姓名"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /Auth/SignUp [post]
+//func (a *Auth) HttpPostSignUp() (err error) {
+//	userCode := a.Ctx().PostForm("userCode")
+//	test := a.PostFromInt("test")
+//	test2 := a.PostFromIntPtr("test2")
+//	logrus.Info(userCode, test, test2)
+//
+//	a.Ctx().JSON(http.StatusOK, newResponseBase())
+//	return
+//}
 
 type ResponseVerifyPic struct {
 	Id  string

+ 331 - 330
controller/hrSensors.go

@@ -10,333 +10,334 @@ type HrSensors struct {
 	BaseController
 }
 
-// AddHrSensors godoc
-// @Summary 添加商家公共心率设备
-// @tags HrSensors
-// @Description 添加商家公共心率设备
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param shopId formData int true "商家ID"
-// @Param sn formData int true "心率带Sn"
-// @Param venueNo formData string false "场馆内编号  01 02"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/AddHrSensors [post]
-func (h *HrSensors) AddHrSensors() (err error) {
-	//sess := h.Ctx().PostForm("Token")
-	//sn := h.postString("sn", true)
-	//venueNo := h.Ctx().PostForm("venueNo")
-	//shopId := h.postIntNecessary("shopId")
-	//
-	//logInfo, err := service.HrSensors{}.AddHrSensors(sess, sn, venueNo, shopId)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
-
-// AddPvtHrSensors godoc
-// @Summary 添加会员私有心率设备
-// @tags HrSensors
-// @Description 添加会员私有心率设备
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param shopId formData int true "商家ID"
-// @Param sn formData int true "心率带Sn"
-// @Param userId formData int true "用户ID"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/AddPvtHrSensors [post]
-func (h *HrSensors) AddPvtHrSensors() (err error) {
-	//sess := h.Ctx().PostForm("Token")
-	//sn := h.postString("sn", true)
-	//shopId := h.postIntNecessary("shopId")
-	//userId := h.postIntNecessary("userId")
-	//
-	//logInfo, err := service.HrSensors{}.AddPvtHrSensors(sess, sn, userId, shopId)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
-
-// EditHrSensors godoc
-// @Summary 修改商家心率设备信息
-// @tags HrSensors
-// @Description 修改商家心率设备信息
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param hrId formData int true "心率带ID"
-// @Param sn formData string true "心率带Sn"
-// @Param shopId formData string true "商家ID"
-// @Param venueNo formData string false "场馆内编号  01 02"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/EditHrSensors [post]
-func (h *HrSensors) EditHrSensors() (err error) {
-	//sess := h.getSession()
-	//sn := h.postString("sn", true)
-	//venueNo := h.Ctx().PostForm("venueNo")
-	//hrId := h.postIntNecessary("hrId")
-	//shopId := h.postIntNecessary("shopId")
-	//
-	//logInfo, err := service.HrSensors{}.EditHrSensors(sess, sn, venueNo, shopId, hrId)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
-
-// HrSensorsStatusEdit godoc
-// @Summary 修改商家心率设备状态
-// @tags HrSensors
-// @Description 修改商家心率设备状态
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param hrId formData int true "心率带ID"
-// @Param status formData int true "状态, 1:启用,8:暂停,9:删除"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/HrSensorsStatusEdit [post]
-func (h *HrSensors) HrSensorsStatusEdit() (err error) {
-	//sess := h.getSession()
-	//hrId := h.postIntNecessary("hrId")
-	//status := h.postIntNecessary("status")
-	//
-	//logInfo, err := service.HrSensors{}.HrSensorsStatusEdit(sess, hrId, status)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
-
-type QueryHrSensorsInfo struct {
-	ResponseBase
-	Rs string
-}
-
-// QueryHrSensors godoc
-// @Summary 查询商家公共心率设备
-// @tags HrSensors
-// @Description 查询商家公共心率设备
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param shopId formData int true "商家ID"
-// @Param status formData int false "设备状态"
-// @Param str formData string false "模糊查询sn与场内编号"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/QueryHrSensors [post]
-func (h *HrSensors) QueryHrSensors() (err error) {
-	//sess := h.getSession()
-	//str := h.Ctx().PostForm("str")
-	//shopId := h.postIntNecessary("shopId")
-	//status := h.postInt("status")
-	//hr, err := service.HrSensors{}.QueryHrSensors(sess, shopId, str, status)
-	//if err != nil {
-	//	return
-	//}
-	//h.json(QueryHrSensorsInfo{
-	//	ResponseBase: ResponseBase{},
-	//	Rs:           hr,
-	//})
-	return
-}
-
-// QueryPvtHrSensors godoc
-// @Summary 查询商家会员私有心率设备
-// @tags HrSensors
-// @Description 查询商家会员私有心率设备
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param shopId formData int true "商家ID"
-// @Param status formData int false "设备状态"
-// @Param userName formData string false "用户姓名"
-// @Param str formData string false "模糊查询sn与场内编号"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/QueryPvtHrSensors [post]
-func (h *HrSensors) QueryPvtHrSensors() (err error) {
-	//sess := h.getSession()
-	//str := h.Ctx().PostForm("str")
-	//userName := h.Ctx().PostForm("userName")
-	//shopId := h.postIntNecessary("shopId")
-	//status := h.postInt("status")
-	//hr, err := service.HrSensors{}.QueryPvtHrSensors(sess, shopId, str, userName, status)
-	//if err != nil {
-	//	return
-	//}
-	//h.json(QueryHrSensorsInfo{
-	//	ResponseBase: ResponseBase{},
-	//	Rs:           hr,
-	//})
-	return
-}
-
-// BindHrSensorsToUser godoc
-// @Summary 心率带绑定用户
-// @tags HrSensors
-// @Description 心率带绑定用户
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param sn formData string true "心率带Sn"
-// @Param cfId formData int true "课堂记录Id,必传字段"
-// @Param userId formData int true "用户Id"
-// @Param shopId formData int true "商家ID"
-// @Param hrId formData int true "心率带ID"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/BindHrSensorsToUser [post]
-func (h *HrSensors) BindHrSensorsToUser() (err error) {
-	//sess := h.getSession()
-	//sn := h.postString("sn", true)
-	//cfId := h.postIntNecessary("cfId")
-	//userId := h.postIntNecessary("userId")
-	//shopId := h.postIntNecessary("shopId")
-	//hrId := h.postIntNecessary("hrId")
-	////dpId := h.postInt("dpId")  // 用来判断是否上课的依据,目前不需要前台传递,根据cfId进行反查。且未确认上课时cf表中dpId=0
-	////oldSn := h.Ctx().PostForm("oldSn")
-	//
-	//logInfo, err := service.HrSensors{}.HrSensorsBindUser(sess, sn, cfId, userId, shopId, hrId)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
-
-// UnBindHrSensorsToUser godoc
-// @Summary 心率带解绑用户
-// @tags HrSensors
-// @Description 心率带解绑用户
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param cfId formData int true "课堂记录Id,必传字段"
-// @Param bindId formData int true "绑定ID"
-// @Param userId formData int true "用户ID"
-// @Param sn formData string true "心率带Sn"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/UnBindHrSensorsToUser [post]
-func (h *HrSensors) UnBindHrSensorsToUser() (err error) {
-	//sess := h.getSession()
-	//cfId := h.postIntNecessary("cfId")
-	//bindId := h.postIntNecessary("bindId")
-	//userId := h.postIntNecessary("userId")
-	//sn := h.postString("sn", true)
-	//
-	//logInfo, err := service.HrSensors{}.UnBindHrSensorsToUser(sess, sn, cfId, bindId, userId)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
-
-type SelectHrSensorsRs struct {
-	ResponseBase
-	Rs string
-	//Rs []*model.HrSensors
-}
-
-// SelectHrSensors godoc
-// @Summary 查询未绑定的心率带--下拉框用
-// @tags HrSensors
-// @Description 查询未绑定的心率带--下拉框用
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param userId formData int false "用户ID"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/SelectHrSensors [post]
-func (h *HrSensors) SelectHrSensors() (err error) {
-	//sess := h.getSession()
-	//userId := h.postInt("userId")
-	//rs, err := service.HrSensors{}.SelectHrSensors(sess, userId)
-	//if err != nil {
-	//	return
-	//}
-	//h.json(SelectHrSensorsRs{
-	//	ResponseBase: ResponseBase{},
-	//	Rs:           rs,
-	//})
-	return
-}
-
-type HrSensorsBindHistoryRs struct {
-	ResponseBase
-	Rs string
-}
-
-// HrSensorsBindHistory godoc
-// @Summary 查询心率带绑定历史记录
-// @tags HrSensors
-// @Description 查询心率带绑定历史记录
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param hrId formData int false "心率带ID"
-// @Param bt formData string true "开始时间  2020-10-10 00:00:01"
-// @Param et formData string true "结束时间  2020-10-10 23:59:59"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/HrSensorsBindHistory [post]
-func (h *HrSensors) HrSensorsBindHistory() (err error) {
-	//sess := h.getSession()
-	//bt, err := h.getPostFromTime("bt")
-	//if err != nil {
-	//	return
-	//}
-	//et, err := h.getPostFromTime("et")
-	//if err != nil {
-	//	return
-	//}
-	//hrId := h.postInt("hrId")
-	//
-	//rs, err := service.HrSensors{}.HrSensorsBindHistory(sess, hrId, bt, et)
-	//if err != nil {
-	//	return
-	//}
-	//h.json(HrSensorsBindHistoryRs{
-	//	ResponseBase: ResponseBase{},
-	//	Rs:           rs,
-	//})
-	return
-}
-
-// GetHrSensorsPowerPercent godoc
-// @Summary 获取心率带电量
-// @tags HrSensors
-// @Description 获取心率带电量
-// @Accept  x-www-form-urlencoded
-// @Produce  json
-// @Param token formData string true "Token"
-// @Param shopId formData int true "商家ID"
-// @Param hrId formData int false "心率带Id"
-// @Success 200 {object} controller.ResponseBase
-// @Router /HrSensors/GetHrSensorsPowerPercent [post]
-func (h *HrSensors) GetHrSensorsPowerPercent() (err error) {
-	//sess := h.getSession()
-	//shopId := h.postIntNecessary("shopId")
-	//hrId := h.postInt("hrId")
-	////jsonStr := h.postString("jsonStr", false)
-	////dpId := h.postInt("dpId")  // 用来判断是否上课的依据,目前不需要前台传递,根据cfId进行反查。且未确认上课时cf表中dpId=0
-	////oldSn := h.Ctx().PostForm("oldSn")
-	//
-	//logInfo, err := service.HrSensors{}.GetHrSensorsPowerPercent(sess, shopId, hrId)
-	//if err != nil {
-	//	return
-	//}
-	//h.saveOptLogInfo(logInfo)
-	//h.json(newResponseBase())
-	return
-}
+//
+//// AddHrSensors godoc
+//// @Summary 添加商家公共心率设备
+//// @tags HrSensors
+//// @Description 添加商家公共心率设备
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param shopId formData int true "商家ID"
+//// @Param sn formData int true "心率带Sn"
+//// @Param venueNo formData string false "场馆内编号  01 02"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/AddHrSensors [post]
+//func (h *HrSensors) AddHrSensors() (err error) {
+//	//sess := h.Ctx().PostForm("Token")
+//	//sn := h.postString("sn", true)
+//	//venueNo := h.Ctx().PostForm("venueNo")
+//	//shopId := h.postIntNecessary("shopId")
+//	//
+//	//logInfo, err := service.HrSensors{}.AddHrSensors(sess, sn, venueNo, shopId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}
+//
+//// AddPvtHrSensors godoc
+//// @Summary 添加会员私有心率设备
+//// @tags HrSensors
+//// @Description 添加会员私有心率设备
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param shopId formData int true "商家ID"
+//// @Param sn formData int true "心率带Sn"
+//// @Param userId formData int true "用户ID"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/AddPvtHrSensors [post]
+//func (h *HrSensors) AddPvtHrSensors() (err error) {
+//	//sess := h.Ctx().PostForm("Token")
+//	//sn := h.postString("sn", true)
+//	//shopId := h.postIntNecessary("shopId")
+//	//userId := h.postIntNecessary("userId")
+//	//
+//	//logInfo, err := service.HrSensors{}.AddPvtHrSensors(sess, sn, userId, shopId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}
+//
+//// EditHrSensors godoc
+//// @Summary 修改商家心率设备信息
+//// @tags HrSensors
+//// @Description 修改商家心率设备信息
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param hrId formData int true "心率带ID"
+//// @Param sn formData string true "心率带Sn"
+//// @Param shopId formData string true "商家ID"
+//// @Param venueNo formData string false "场馆内编号  01 02"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/EditHrSensors [post]
+//func (h *HrSensors) EditHrSensors() (err error) {
+//	//sess := h.getSession()
+//	//sn := h.postString("sn", true)
+//	//venueNo := h.Ctx().PostForm("venueNo")
+//	//hrId := h.postIntNecessary("hrId")
+//	//shopId := h.postIntNecessary("shopId")
+//	//
+//	//logInfo, err := service.HrSensors{}.EditHrSensors(sess, sn, venueNo, shopId, hrId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}
+//
+//// HrSensorsStatusEdit godoc
+//// @Summary 修改商家心率设备状态
+//// @tags HrSensors
+//// @Description 修改商家心率设备状态
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param hrId formData int true "心率带ID"
+//// @Param status formData int true "状态, 1:启用,8:暂停,9:删除"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/HrSensorsStatusEdit [post]
+//func (h *HrSensors) HrSensorsStatusEdit() (err error) {
+//	//sess := h.getSession()
+//	//hrId := h.postIntNecessary("hrId")
+//	//status := h.postIntNecessary("status")
+//	//
+//	//logInfo, err := service.HrSensors{}.HrSensorsStatusEdit(sess, hrId, status)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}
+//
+//type QueryHrSensorsInfo struct {
+//	ResponseBase
+//	Rs string
+//}
+//
+//// QueryHrSensors godoc
+//// @Summary 查询商家公共心率设备
+//// @tags HrSensors
+//// @Description 查询商家公共心率设备
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param shopId formData int true "商家ID"
+//// @Param status formData int false "设备状态"
+//// @Param str formData string false "模糊查询sn与场内编号"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/QueryHrSensors [post]
+//func (h *HrSensors) QueryHrSensors() (err error) {
+//	//sess := h.getSession()
+//	//str := h.Ctx().PostForm("str")
+//	//shopId := h.postIntNecessary("shopId")
+//	//status := h.postInt("status")
+//	//hr, err := service.HrSensors{}.QueryHrSensors(sess, shopId, str, status)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.json(QueryHrSensorsInfo{
+//	//	ResponseBase: ResponseBase{},
+//	//	Rs:           hr,
+//	//})
+//	return
+//}
+//
+//// QueryPvtHrSensors godoc
+//// @Summary 查询商家会员私有心率设备
+//// @tags HrSensors
+//// @Description 查询商家会员私有心率设备
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param shopId formData int true "商家ID"
+//// @Param status formData int false "设备状态"
+//// @Param userName formData string false "用户姓名"
+//// @Param str formData string false "模糊查询sn与场内编号"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/QueryPvtHrSensors [post]
+//func (h *HrSensors) QueryPvtHrSensors() (err error) {
+//	//sess := h.getSession()
+//	//str := h.Ctx().PostForm("str")
+//	//userName := h.Ctx().PostForm("userName")
+//	//shopId := h.postIntNecessary("shopId")
+//	//status := h.postInt("status")
+//	//hr, err := service.HrSensors{}.QueryPvtHrSensors(sess, shopId, str, userName, status)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.json(QueryHrSensorsInfo{
+//	//	ResponseBase: ResponseBase{},
+//	//	Rs:           hr,
+//	//})
+//	return
+//}
+//
+//// BindHrSensorsToUser godoc
+//// @Summary 心率带绑定用户
+//// @tags HrSensors
+//// @Description 心率带绑定用户
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param sn formData string true "心率带Sn"
+//// @Param cfId formData int true "课堂记录Id,必传字段"
+//// @Param userId formData int true "用户Id"
+//// @Param shopId formData int true "商家ID"
+//// @Param hrId formData int true "心率带ID"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/BindHrSensorsToUser [post]
+//func (h *HrSensors) BindHrSensorsToUser() (err error) {
+//	//sess := h.getSession()
+//	//sn := h.postString("sn", true)
+//	//cfId := h.postIntNecessary("cfId")
+//	//userId := h.postIntNecessary("userId")
+//	//shopId := h.postIntNecessary("shopId")
+//	//hrId := h.postIntNecessary("hrId")
+//	////dpId := h.postInt("dpId")  // 用来判断是否上课的依据,目前不需要前台传递,根据cfId进行反查。且未确认上课时cf表中dpId=0
+//	////oldSn := h.Ctx().PostForm("oldSn")
+//	//
+//	//logInfo, err := service.HrSensors{}.HrSensorsBindUser(sess, sn, cfId, userId, shopId, hrId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}
+//
+//// UnBindHrSensorsToUser godoc
+//// @Summary 心率带解绑用户
+//// @tags HrSensors
+//// @Description 心率带解绑用户
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param cfId formData int true "课堂记录Id,必传字段"
+//// @Param bindId formData int true "绑定ID"
+//// @Param userId formData int true "用户ID"
+//// @Param sn formData string true "心率带Sn"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/UnBindHrSensorsToUser [post]
+//func (h *HrSensors) UnBindHrSensorsToUser() (err error) {
+//	//sess := h.getSession()
+//	//cfId := h.postIntNecessary("cfId")
+//	//bindId := h.postIntNecessary("bindId")
+//	//userId := h.postIntNecessary("userId")
+//	//sn := h.postString("sn", true)
+//	//
+//	//logInfo, err := service.HrSensors{}.UnBindHrSensorsToUser(sess, sn, cfId, bindId, userId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}
+//
+//type SelectHrSensorsRs struct {
+//	ResponseBase
+//	Rs string
+//	//Rs []*model.HrSensors
+//}
+//
+//// SelectHrSensors godoc
+//// @Summary 查询未绑定的心率带--下拉框用
+//// @tags HrSensors
+//// @Description 查询未绑定的心率带--下拉框用
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param userId formData int false "用户ID"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/SelectHrSensors [post]
+//func (h *HrSensors) SelectHrSensors() (err error) {
+//	//sess := h.getSession()
+//	//userId := h.postInt("userId")
+//	//rs, err := service.HrSensors{}.SelectHrSensors(sess, userId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.json(SelectHrSensorsRs{
+//	//	ResponseBase: ResponseBase{},
+//	//	Rs:           rs,
+//	//})
+//	return
+//}
+//
+//type HrSensorsBindHistoryRs struct {
+//	ResponseBase
+//	Rs string
+//}
+//
+//// HrSensorsBindHistory godoc
+//// @Summary 查询心率带绑定历史记录
+//// @tags HrSensors
+//// @Description 查询心率带绑定历史记录
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param hrId formData int false "心率带ID"
+//// @Param bt formData string true "开始时间  2020-10-10 00:00:01"
+//// @Param et formData string true "结束时间  2020-10-10 23:59:59"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/HrSensorsBindHistory [post]
+//func (h *HrSensors) HrSensorsBindHistory() (err error) {
+//	//sess := h.getSession()
+//	//bt, err := h.getPostFromTime("bt")
+//	//if err != nil {
+//	//	return
+//	//}
+//	//et, err := h.getPostFromTime("et")
+//	//if err != nil {
+//	//	return
+//	//}
+//	//hrId := h.postInt("hrId")
+//	//
+//	//rs, err := service.HrSensors{}.HrSensorsBindHistory(sess, hrId, bt, et)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.json(HrSensorsBindHistoryRs{
+//	//	ResponseBase: ResponseBase{},
+//	//	Rs:           rs,
+//	//})
+//	return
+//}
+//
+//// GetHrSensorsPowerPercent godoc
+//// @Summary 获取心率带电量
+//// @tags HrSensors
+//// @Description 获取心率带电量
+//// @Accept  x-www-form-urlencoded
+//// @Produce  json
+//// @Param token formData string true "Token"
+//// @Param shopId formData int true "商家ID"
+//// @Param hrId formData int false "心率带Id"
+//// @Success 200 {object} controller.ResponseBase
+//// @Router /HrSensors/GetHrSensorsPowerPercent [post]
+//func (h *HrSensors) GetHrSensorsPowerPercent() (err error) {
+//	//sess := h.getSession()
+//	//shopId := h.postIntNecessary("shopId")
+//	//hrId := h.postInt("hrId")
+//	////jsonStr := h.postString("jsonStr", false)
+//	////dpId := h.postInt("dpId")  // 用来判断是否上课的依据,目前不需要前台传递,根据cfId进行反查。且未确认上课时cf表中dpId=0
+//	////oldSn := h.Ctx().PostForm("oldSn")
+//	//
+//	//logInfo, err := service.HrSensors{}.GetHrSensorsPowerPercent(sess, shopId, hrId)
+//	//if err != nil {
+//	//	return
+//	//}
+//	//h.saveOptLogInfo(logInfo)
+//	//h.json(newResponseBase())
+//	return
+//}

+ 6 - 6
controller/user.go

@@ -16,12 +16,12 @@ type User struct {
 	BaseController
 }
 
-type UserInfoResponse struct {
+type UserOneResponse struct {
 	ResponseBase
 	Rs *model.UserBodyInfo
 }
 
-// UserInfoQuery godoc
+// UserSelfQuery godoc
 // @Summary 会员信息查询
 // @tags User
 // @Description 会员信息查询
@@ -29,15 +29,15 @@ type UserInfoResponse struct {
 // @Produce  json
 // @Param token formData string true "Token"
 // @Success 200 {object} controller.ResponseBase
-// @Router /User/UserInfoQuery [post]
-func (u *User) UserInfoQuery() (err error) {
+// @Router /User/UserSelfQuery [post]
+func (u *User) UserSelfQuery() (err error) {
 	token := u.Ctx().PostForm("token")
 
-	rs, err := service.User{}.UserInfoQuery(token)
+	rs, err := service.User{}.UserSelfQuery(token)
 	if err != nil {
 		return
 	}
-	r := UserInfoResponse{
+	r := UserOneResponse{
 		ResponseBase: newResponseBase(),
 		Rs:           rs,
 	}

+ 1 - 638
docs/docs.go

@@ -185,643 +185,6 @@ var doc = `{
                 }
             }
         },
-        "/Auth/SignUp": {
-            "post": {
-                "description": "用户添加",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "Auth"
-                ],
-                "summary": "用户添加",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "用户名",
-                        "name": "userCode",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "密码",
-                        "name": "password",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "邮箱",
-                        "name": "email",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "手机号",
-                        "name": "phone",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "姓名",
-                        "name": "name",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/AddHrSensors": {
-            "post": {
-                "description": "添加商家公共心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "添加商家公共心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "场馆内编号  01 02",
-                        "name": "venueNo",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/AddPvtHrSensors": {
-            "post": {
-                "description": "添加会员私有心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "添加会员私有心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userId",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/BindHrSensorsToUser": {
-            "post": {
-                "description": "心率带绑定用户",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "心率带绑定用户",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "课堂记录Id,必传字段",
-                        "name": "cfId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户Id",
-                        "name": "userId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/EditHrSensors": {
-            "post": {
-                "description": "修改商家心率设备信息",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "修改商家心率设备信息",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "场馆内编号  01 02",
-                        "name": "venueNo",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/GetHrSensorsPowerPercent": {
-            "post": {
-                "description": "获取心率带电量",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "获取心率带电量",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带Id",
-                        "name": "hrId",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/HrSensorsBindHistory": {
-            "post": {
-                "description": "查询心率带绑定历史记录",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询心率带绑定历史记录",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "开始时间  2020-10-10 00:00:01",
-                        "name": "bt",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "结束时间  2020-10-10 23:59:59",
-                        "name": "et",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/HrSensorsStatusEdit": {
-            "post": {
-                "description": "修改商家心率设备状态",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "修改商家心率设备状态",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "状态, 1:启用,8:暂停,9:删除",
-                        "name": "status",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/QueryHrSensors": {
-            "post": {
-                "description": "查询商家公共心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询商家公共心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "设备状态",
-                        "name": "status",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "模糊查询sn与场内编号",
-                        "name": "str",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/QueryPvtHrSensors": {
-            "post": {
-                "description": "查询商家会员私有心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询商家会员私有心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "设备状态",
-                        "name": "status",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "用户姓名",
-                        "name": "userName",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "模糊查询sn与场内编号",
-                        "name": "str",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/SelectHrSensors": {
-            "post": {
-                "description": "查询未绑定的心率带--下拉框用",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询未绑定的心率带--下拉框用",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userId",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/UnBindHrSensorsToUser": {
-            "post": {
-                "description": "心率带解绑用户",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "心率带解绑用户",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "课堂记录Id,必传字段",
-                        "name": "cfId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "绑定ID",
-                        "name": "bindId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
         "/Test/UserAdd": {
             "post": {
                 "description": "会员用户添加",
@@ -877,7 +240,7 @@ var doc = `{
                 }
             }
         },
-        "/User/UserInfoQuery": {
+        "/User/UserSelfQuery": {
             "post": {
                 "description": "会员信息查询",
                 "consumes": [

+ 1 - 638
docs/swagger.json

@@ -169,643 +169,6 @@
                 }
             }
         },
-        "/Auth/SignUp": {
-            "post": {
-                "description": "用户添加",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "Auth"
-                ],
-                "summary": "用户添加",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "用户名",
-                        "name": "userCode",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "密码",
-                        "name": "password",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "邮箱",
-                        "name": "email",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "手机号",
-                        "name": "phone",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "姓名",
-                        "name": "name",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/AddHrSensors": {
-            "post": {
-                "description": "添加商家公共心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "添加商家公共心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "场馆内编号  01 02",
-                        "name": "venueNo",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/AddPvtHrSensors": {
-            "post": {
-                "description": "添加会员私有心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "添加会员私有心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userId",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/BindHrSensorsToUser": {
-            "post": {
-                "description": "心率带绑定用户",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "心率带绑定用户",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "课堂记录Id,必传字段",
-                        "name": "cfId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户Id",
-                        "name": "userId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/EditHrSensors": {
-            "post": {
-                "description": "修改商家心率设备信息",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "修改商家心率设备信息",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "场馆内编号  01 02",
-                        "name": "venueNo",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/GetHrSensorsPowerPercent": {
-            "post": {
-                "description": "获取心率带电量",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "获取心率带电量",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带Id",
-                        "name": "hrId",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/HrSensorsBindHistory": {
-            "post": {
-                "description": "查询心率带绑定历史记录",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询心率带绑定历史记录",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "开始时间  2020-10-10 00:00:01",
-                        "name": "bt",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "结束时间  2020-10-10 23:59:59",
-                        "name": "et",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/HrSensorsStatusEdit": {
-            "post": {
-                "description": "修改商家心率设备状态",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "修改商家心率设备状态",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "心率带ID",
-                        "name": "hrId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "状态, 1:启用,8:暂停,9:删除",
-                        "name": "status",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/QueryHrSensors": {
-            "post": {
-                "description": "查询商家公共心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询商家公共心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "设备状态",
-                        "name": "status",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "模糊查询sn与场内编号",
-                        "name": "str",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/QueryPvtHrSensors": {
-            "post": {
-                "description": "查询商家会员私有心率设备",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询商家会员私有心率设备",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "商家ID",
-                        "name": "shopId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "设备状态",
-                        "name": "status",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "用户姓名",
-                        "name": "userName",
-                        "in": "formData"
-                    },
-                    {
-                        "type": "string",
-                        "description": "模糊查询sn与场内编号",
-                        "name": "str",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/SelectHrSensors": {
-            "post": {
-                "description": "查询未绑定的心率带--下拉框用",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "查询未绑定的心率带--下拉框用",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userId",
-                        "in": "formData"
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
-        "/HrSensors/UnBindHrSensorsToUser": {
-            "post": {
-                "description": "心率带解绑用户",
-                "consumes": [
-                    "application/x-www-form-urlencoded"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "HrSensors"
-                ],
-                "summary": "心率带解绑用户",
-                "parameters": [
-                    {
-                        "type": "string",
-                        "description": "Token",
-                        "name": "token",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "课堂记录Id,必传字段",
-                        "name": "cfId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "绑定ID",
-                        "name": "bindId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "integer",
-                        "description": "用户ID",
-                        "name": "userId",
-                        "in": "formData",
-                        "required": true
-                    },
-                    {
-                        "type": "string",
-                        "description": "心率带Sn",
-                        "name": "sn",
-                        "in": "formData",
-                        "required": true
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/controller.ResponseBase"
-                        }
-                    }
-                }
-            }
-        },
         "/Test/UserAdd": {
             "post": {
                 "description": "会员用户添加",
@@ -861,7 +224,7 @@
                 }
             }
         },
-        "/User/UserInfoQuery": {
+        "/User/UserSelfQuery": {
             "post": {
                 "description": "会员信息查询",
                 "consumes": [

+ 1 - 430
docs/swagger.yaml

@@ -141,435 +141,6 @@ paths:
       summary: 手机验证码登录
       tags:
       - Auth
-  /Auth/SignUp:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 用户添加
-      parameters:
-      - description: 用户名
-        in: formData
-        name: userCode
-        required: true
-        type: string
-      - description: 密码
-        in: formData
-        name: password
-        required: true
-        type: string
-      - description: 邮箱
-        in: formData
-        name: email
-        type: string
-      - description: 手机号
-        in: formData
-        name: phone
-        type: string
-      - description: 姓名
-        in: formData
-        name: name
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 用户添加
-      tags:
-      - Auth
-  /HrSensors/AddHrSensors:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 添加商家公共心率设备
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: integer
-      - description: 心率带Sn
-        in: formData
-        name: sn
-        required: true
-        type: integer
-      - description: 场馆内编号  01 02
-        in: formData
-        name: venueNo
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 添加商家公共心率设备
-      tags:
-      - HrSensors
-  /HrSensors/AddPvtHrSensors:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 添加会员私有心率设备
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: integer
-      - description: 心率带Sn
-        in: formData
-        name: sn
-        required: true
-        type: integer
-      - description: 用户ID
-        in: formData
-        name: userId
-        required: true
-        type: integer
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 添加会员私有心率设备
-      tags:
-      - HrSensors
-  /HrSensors/BindHrSensorsToUser:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 心率带绑定用户
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 心率带Sn
-        in: formData
-        name: sn
-        required: true
-        type: string
-      - description: 课堂记录Id,必传字段
-        in: formData
-        name: cfId
-        required: true
-        type: integer
-      - description: 用户Id
-        in: formData
-        name: userId
-        required: true
-        type: integer
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: integer
-      - description: 心率带ID
-        in: formData
-        name: hrId
-        required: true
-        type: integer
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 心率带绑定用户
-      tags:
-      - HrSensors
-  /HrSensors/EditHrSensors:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 修改商家心率设备信息
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 心率带ID
-        in: formData
-        name: hrId
-        required: true
-        type: integer
-      - description: 心率带Sn
-        in: formData
-        name: sn
-        required: true
-        type: string
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: string
-      - description: 场馆内编号  01 02
-        in: formData
-        name: venueNo
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 修改商家心率设备信息
-      tags:
-      - HrSensors
-  /HrSensors/GetHrSensorsPowerPercent:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 获取心率带电量
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: integer
-      - description: 心率带Id
-        in: formData
-        name: hrId
-        type: integer
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 获取心率带电量
-      tags:
-      - HrSensors
-  /HrSensors/HrSensorsBindHistory:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 查询心率带绑定历史记录
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 心率带ID
-        in: formData
-        name: hrId
-        type: integer
-      - description: 开始时间  2020-10-10 00:00:01
-        in: formData
-        name: bt
-        required: true
-        type: string
-      - description: 结束时间  2020-10-10 23:59:59
-        in: formData
-        name: et
-        required: true
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 查询心率带绑定历史记录
-      tags:
-      - HrSensors
-  /HrSensors/HrSensorsStatusEdit:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 修改商家心率设备状态
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 心率带ID
-        in: formData
-        name: hrId
-        required: true
-        type: integer
-      - description: 状态, 1:启用,8:暂停,9:删除
-        in: formData
-        name: status
-        required: true
-        type: integer
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 修改商家心率设备状态
-      tags:
-      - HrSensors
-  /HrSensors/QueryHrSensors:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 查询商家公共心率设备
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: integer
-      - description: 设备状态
-        in: formData
-        name: status
-        type: integer
-      - description: 模糊查询sn与场内编号
-        in: formData
-        name: str
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 查询商家公共心率设备
-      tags:
-      - HrSensors
-  /HrSensors/QueryPvtHrSensors:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 查询商家会员私有心率设备
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 商家ID
-        in: formData
-        name: shopId
-        required: true
-        type: integer
-      - description: 设备状态
-        in: formData
-        name: status
-        type: integer
-      - description: 用户姓名
-        in: formData
-        name: userName
-        type: string
-      - description: 模糊查询sn与场内编号
-        in: formData
-        name: str
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 查询商家会员私有心率设备
-      tags:
-      - HrSensors
-  /HrSensors/SelectHrSensors:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 查询未绑定的心率带--下拉框用
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 用户ID
-        in: formData
-        name: userId
-        type: integer
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 查询未绑定的心率带--下拉框用
-      tags:
-      - HrSensors
-  /HrSensors/UnBindHrSensorsToUser:
-    post:
-      consumes:
-      - application/x-www-form-urlencoded
-      description: 心率带解绑用户
-      parameters:
-      - description: Token
-        in: formData
-        name: token
-        required: true
-        type: string
-      - description: 课堂记录Id,必传字段
-        in: formData
-        name: cfId
-        required: true
-        type: integer
-      - description: 绑定ID
-        in: formData
-        name: bindId
-        required: true
-        type: integer
-      - description: 用户ID
-        in: formData
-        name: userId
-        required: true
-        type: integer
-      - description: 心率带Sn
-        in: formData
-        name: sn
-        required: true
-        type: string
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/controller.ResponseBase'
-      summary: 心率带解绑用户
-      tags:
-      - HrSensors
   /Test/UserAdd:
     post:
       consumes:
@@ -606,7 +177,7 @@ paths:
       summary: 会员用户查询
       tags:
       - Test
-  /User/UserInfoQuery:
+  /User/UserSelfQuery:
     post:
       consumes:
       - application/x-www-form-urlencoded

+ 2 - 0
errors/error.go

@@ -33,6 +33,7 @@ const (
 	CodeDATABASE            ErrorCode = 9000
 	CodeREDIS               ErrorCode = 10000
 	HrSensorsTimeOutErr     ErrorCode = 30012
+	JsonToMaptErr           ErrorCode = 30013
 	CodeParam                         = ErrorCode(errors.CodeParam)
 )
 
@@ -42,6 +43,7 @@ var (
 	ErrPicVerifyCode    = NewServiceErr(PicVerifyCodeErr, "图形验证码错误")
 	ErrStaticHr         = NewServiceErr(StaticHrErr, "会员年龄太小,请重新输入用户生日。")
 	ErrBirthday         = NewServiceErr(BirthdayErr, "用户生日不得大于当前年份,请重新输入")
+	ErrJsonToMap        = NewServiceErr(JsonToMaptErr, "Json转换Map对象失败")
 	ErrHrSensorsTimeOut = NewServiceErr(HrSensorsTimeOutErr, "心率系统连接超时")
 )
 

+ 61 - 0
repository/http/heartrate_server.go

@@ -0,0 +1,61 @@
+package http
+
+import (
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"net/url"
+	"strings"
+	"video_course/global"
+	"video_course/model"
+	"video_course/utils"
+)
+
+type HeartRateServer struct {
+}
+
+//查询用户身体数据
+func (h HeartRateServer) VipUserQueryByUserMd5(userMd5 string) (rtnCode int, rtn *model.UserBodyInfo) {
+	api := strings.Join([]string{global.Project.HeartrateUrl, "v1/OutService/GetUserBodyInfoByUserMd5"}, "/")
+
+	resp, err := http.PostForm(api, url.Values{
+		"userMd5": {userMd5},
+	})
+	if err != nil {
+		panic(err)
+	}
+
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		err = fmt.Errorf("response:[%s], err:\n%w", string(body), err)
+		panic(err)
+	}
+
+	var responseBase struct {
+		Code int
+		Memo string
+		Rs   map[string]interface{}
+	}
+	err = json.Unmarshal(body, &responseBase)
+	if err != nil {
+		err = fmt.Errorf("response:[%s], err:\n%w", string(body), err)
+		panic(err)
+	}
+	rtnCode = responseBase.Code
+	if rtnCode == 0 {
+		rtn = &model.UserBodyInfo{
+			UserName: utils.MapToString(responseBase.Rs, "Name"),
+			Birthday: utils.MapToTime(responseBase.Rs, "Birthday"),
+			Height:   utils.MapToInt32(responseBase.Rs, "Height"),
+			Weight:   utils.MapToInt32(responseBase.Rs, "Weight"),
+			Sex:      utils.MapToInt32(responseBase.Rs, "Sex"),
+			StaticHr: utils.MapToInt32(responseBase.Rs, "StaticHr"),
+			UserMd5:  utils.MapToString(responseBase.Rs, "UserMd5"),
+			Head:     utils.MapToString(responseBase.Rs, "Head"),
+		}
+	}
+
+	return
+}

+ 58 - 0
repository/http/loallout_server.go

@@ -9,6 +9,8 @@ import (
 	"strings"
 	"video_course/errors"
 	"video_course/global"
+	"video_course/model"
+	"video_course/utils"
 )
 
 type LoalloutServer struct {
@@ -72,3 +74,59 @@ func (l LoalloutServer) CheckPhone(phone string) (userMd5 string) {
 
 	return
 }
+
+//查询用户身体数据
+func (l LoalloutServer) VipUserQueryByUserMd5(serviceKey string, userMd5 string) (rtnCode int, rtn *model.UserBodyInfo) {
+	api := strings.Join([]string{global.Project.LoalloutUrl, "v1/User/VipUserQueryByUserMd5"}, "/")
+
+	resp, err := http.PostForm(api, url.Values{
+		"serviceKey": {serviceKey},
+		"userMd5":    {userMd5},
+	})
+	if err != nil {
+		panic(err)
+	}
+
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		err = fmt.Errorf("response:[%s], err:\n%w", string(body), err)
+		panic(err)
+	}
+
+	var responseBase struct {
+		Code   int
+		Memo   string
+		Status int
+		Info   map[string]interface{}
+	}
+	err = json.Unmarshal(body, &responseBase)
+	if err != nil {
+		err = fmt.Errorf("response:[%s], err:\n%w", string(body), err)
+		panic(err)
+	}
+	rtnCode = responseBase.Code
+	if rtnCode == 0 {
+		rtn = &model.UserBodyInfo{
+			UserName: utils.MapToString(responseBase.Info, "UserName"),
+			Birthday: utils.MapToTime(responseBase.Info, "Birthday"),
+			Height:   utils.MapToInt32(responseBase.Info, "Height"),
+			Weight:   utils.MapToInt32(responseBase.Info, "Weight"),
+			Sex:      utils.MapToInt32(responseBase.Info, "Sex"),
+			StaticHr: utils.MapToInt32(responseBase.Info, "StaticHr"),
+			UserMd5:  utils.MapToString(responseBase.Info, "UserMd5"),
+			Head:     utils.MapToString(responseBase.Info, "Head"),
+		}
+	}
+
+	return
+}
+
+//func MapToString(v interface{}, key string) (str string) {
+//	f, ok := v.(map[string]interface{})[key].(string)
+//	if !ok {
+//		println(errors.ErrJsonToMap)
+//	}
+//	str = f
+//	return
+//}

+ 3 - 3
service/auth.go

@@ -82,9 +82,9 @@ func (a Auth) GenVFCode(codeTypeInt int, phone string, ip string,
 	picId string,
 	picCode string) (err error) {
 	//图形验证码验证
-	//if !store.Verify(picId, picCode, true) {
-	//	return errors.ErrPicVerifyCode
-	//}
+	if !store.Verify(picId, picCode, true) {
+		return errors.ErrPicVerifyCode
+	}
 	//手机号验证
 	userMd5 := h.LoalloutServer{}.CheckPhone(phone)
 	if userMd5 == "" {

+ 3 - 1
service/base.go

@@ -6,7 +6,9 @@
  */
 package service
 
-import "strings"
+import (
+	"strings"
+)
 
 type base struct {
 	restFulApiBase []string

+ 14 - 13
service/user.go

@@ -7,18 +7,19 @@
 package service
 
 import (
-	"fmt"
+	"video_course/errors"
 	"video_course/lib/session"
 	"video_course/model"
+	h "video_course/repository/http"
 )
 
 type User struct {
 	base
 }
 
-//会员用户列表查询带分页
-func (u User) UserInfoQuery(
-	token string) (rs *model.UserBodyInfo, err error) {
+//查询用户身体数据
+func (u User) UserSelfQuery(
+	token string) (userBodyInfo *model.UserBodyInfo, err error) {
 	sm := session.GetSessionManager()
 	sess, err_ := sm.FindByToken(token)
 	if err_ != nil {
@@ -26,15 +27,15 @@ func (u User) UserInfoQuery(
 		return
 	}
 	userMd5 := sess.UserId
-	fmt.Println(userMd5)
-	return
-}
+	var rtnCode int
+	//首先查询心率系统,如果查询失败查询小飞龙系统
+	rtnCode, userBodyInfo = h.HeartRateServer{}.VipUserQueryByUserMd5(userMd5)
+	if rtnCode != 0 {
+		rtnCode, userBodyInfo = h.LoalloutServer{}.VipUserQueryByUserMd5("73c845ca89d952074b36a5b18d961cac", userMd5)
+		if rtnCode != 0 {
+			err = errors.ErrUserNotExists
+		}
+	}
 
-//会员用户基本信息查询
-func (u User) ShopUserSimpleQuery(sess string, classId *int) (rs string, err error) {
-	// todo 做session校验
-	//user := u.getUser(sess)
-	//dao := u.getUserDao()
-	//rs, err = dao.ShopUserSimpleQuery(classId, user.ShopId)
 	return
 }

+ 66 - 0
utils/json.go

@@ -0,0 +1,66 @@
+package utils
+
+import (
+	"encoding/json"
+	"time"
+	"video_course/errors"
+)
+
+func JSONToMap(str string) (map[string]interface{}, error) {
+
+	var tempMap map[string]interface{}
+
+	err := json.Unmarshal([]byte(str), &tempMap)
+
+	if err != nil {
+		err = errors.ErrJsonToMap
+		return tempMap, err
+	}
+
+	return tempMap, nil
+}
+func MapToInt32(v interface{}, key string) (i int) {
+	f, ok := v.(map[string]interface{})[key].(float64)
+	if !ok {
+		println(errors.NewServiceErr(errors.JsonToMaptErr, "float64转int32失败,字段名:"+key))
+		//panic(errors.NewServiceErr(errors.FloatToInt16Err, "float64转int64失败,字段名:"+key))
+	}
+	i = int(f)
+	return
+}
+func MapToInt16(v interface{}, key string) (i int16) {
+	f, ok := v.(map[string]interface{})[key].(float64)
+	if !ok {
+		println(errors.NewServiceErr(errors.JsonToMaptErr, "float64转int16失败,字段名:"+key))
+		//panic(errors.NewServiceErr(errors.FloatToInt16Err, "float64转int64失败,字段名:"+key))
+	}
+	i = int16(f)
+	return
+}
+func MapToInt64(v interface{}, key string) (i int64) {
+	f, ok := v.(map[string]interface{})[key].(float64)
+	if !ok {
+		println(errors.NewServiceErr(errors.JsonToMaptErr, "无法转成int64,字段名"+key))
+	}
+	i = int64(f)
+	return
+}
+func MapToString(v interface{}, key string) (str string) {
+	f, ok := v.(map[string]interface{})[key].(string)
+	if !ok {
+		println(errors.NewServiceErr(errors.JsonToMaptErr, "无法找到这个key值"+key))
+	}
+	str = f
+	return
+}
+func MapToTime(v interface{}, key string) (t time.Time) {
+
+	f, ok := v.(map[string]interface{})[key].(string)
+	if !ok {
+		println(errors.NewServiceErr(errors.JsonToMaptErr, "无法找到这个key值"+key))
+	}
+
+	t, _ = time.Parse(time.RFC3339, f)
+
+	return
+}