You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
830 B
33 lines
830 B
package user
|
|
|
|
import (
|
|
"yunyan/comm"
|
|
"yunyan/pb"
|
|
)
|
|
|
|
// @Summary 获取设备信息
|
|
// @Description 获取设备信息
|
|
// @Tags User
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Security BearerAuth
|
|
// @Param user body pb.UserGetDevicesReq true "获取设备信息"
|
|
// @Success 200 {object} comm.HttpResult{data=pb.UserGetDevicesResp} "成功返回"
|
|
// @Router /api/home/user_getdevices [post]
|
|
func (this *apiComp) GetDevices(session comm.IUserSession, req *pb.UserGetDevicesReq) (resp *pb.UserGetDevicesResp, errdata *pb.ErrorData) {
|
|
var (
|
|
models []*pb.DBUserDivice
|
|
err error
|
|
)
|
|
if models, err = this.module.model.getDevices(session.GetUserId()); err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
resp = &pb.UserGetDevicesResp{
|
|
Devices: models,
|
|
}
|
|
return
|
|
}
|
|
|