go_dreamfactory/modules/library/api_getlist.go
2023-04-14 12:21:58 +08:00

27 lines
637 B
Go

package library
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.LibraryGetListReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.LibraryGetListReq) (code pb.ErrorCode, data *pb.ErrorData) {
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
rsp := &pb.LibraryGetListResp{}
rsp.Data = this.module.GetLibraryList(session.GetUserId())
session.SendMsg(string(this.module.GetType()), LibraryGetListResp, rsp)
return
}