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
808 B

package user
import (
"yunyan/comm"
"yunyan/pb"
)
// @Summary 获取设备信息
// @Description 获取设备信息
// @Tags User
// @Accept json
// @Produce json
// @Security BearerAuth
// @Param user body pb.UserGetProductReq true "获取设备信息"
// @Success 200 {object} comm.HttpResult{data=pb.UserGetProductResp} "成功返回"
// @Router /api/home/user_getproduct [post]
func (this *apiComp) GetProduct(session comm.IUserSession, req *pb.UserGetProductReq) (resp *pb.UserGetProductResp, errdata *pb.ErrorData) {
var (
model *pb.DBProduct
err error
)
if model, err = this.module.cache.GetProduct(req.Id); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),
}
return
}
resp = &pb.UserGetProductResp{
Product: model,
}
return
}