31 lines
677 B
Go
31 lines
677 B
Go
package pack
|
|
|
|
import (
|
|
"context"
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *Api_Comp) SellItem_Check(ctx context.Context, session comm.IUserSession, req *pb.SellItemReq) (code pb.ErrorCode) {
|
|
if !session.IsLogin() {
|
|
code = pb.ErrorCode_NoLogin
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
//出售道具
|
|
func (this *Api_Comp) SellItem(ctx context.Context, session comm.IUserSession, req *pb.SellItemReq) (err error) {
|
|
var (
|
|
code pb.ErrorCode
|
|
)
|
|
defer func() {
|
|
session.SendMsg(string(this.module.GetType()), SellItemResp, code, &pb.SellItemResp{})
|
|
}()
|
|
if code = this.SellItem_Check(ctx, session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
return
|
|
}
|