50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
package buried
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.BuriedInfoReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
///查询任务进度接口
|
|
func (this *apiComp) Info(session comm.IUserSession, req *pb.BuriedInfoReq) (errdata *pb.ErrorData) {
|
|
var (
|
|
buried *pb.DBBuried
|
|
conditions []*pb.ConIProgress
|
|
err error
|
|
)
|
|
if errdata = this.InfoCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
|
|
if buried, err = this.module.modelBuried.getUserBurieds(session.GetUserId()); err != nil {
|
|
this.module.Error("查询埋点进度错误!", log.Field{Key: "err", Value: err.Error()})
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Title: pb.ErrorCode_DBError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
conditions = make([]*pb.ConIProgress, 0)
|
|
for _, items := range buried.Items {
|
|
for _, v := range items.Condi {
|
|
conditions = append(conditions, comm.GetBuriedConIProgress(items.Btype, v))
|
|
}
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "inquireprogress", &pb.BuriedInfoResp{Conitems: conditions})
|
|
|
|
//回收
|
|
for _, v := range conditions {
|
|
comm.PutburiedConIProgress(v)
|
|
}
|
|
|
|
return
|
|
}
|