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.
26 lines
524 B
26 lines
524 B
package api
|
|
|
|
import (
|
|
"yunyan/comm"
|
|
"yunyan/pb"
|
|
)
|
|
|
|
// 获取单个授权码
|
|
func (this *apiComp) GetAuthCode(session comm.IUserSession, req *pb.ApiGetAuthCodeReq) (resp *pb.ApiGetAuthCodeResp, errdata *pb.ErrorData) {
|
|
var (
|
|
model *pb.DBAuthCode
|
|
err error
|
|
)
|
|
|
|
if model, err = this.module.model.factoryDevic(req.Productid, req.Devicemac); err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
resp = &pb.ApiGetAuthCodeResp{
|
|
Device: model,
|
|
}
|
|
return
|
|
}
|
|
|