接口参数校验

This commit is contained in:
meixiongfeng 2022-06-15 14:46:59 +08:00
parent c16a4648fe
commit 7bed325224
4 changed files with 22 additions and 8 deletions

View File

@ -1,14 +1,18 @@
package mail
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
)
//参数校验
func (this *Api_Comp) DelUserMailReq_Check(session comm.IUserSession, req *pb.DelUserMailReq) (result map[string]interface{}, code pb.ErrorCode) {
return
}
// 删除邮件
func (this *Api_Comp) DelUserMailReq(ctx context.Context, session comm.IUserSession, req *pb.DelUserMailReq) (err error) {
func (this *Api_Comp) DelUserMailReq(session comm.IUserSession, agrs map[string]interface{}, req *pb.DelUserMailReq) (err error) {
code := pb.ErrorCode_Success
mailinfo := make([]*pb.DB_MailData, 0)
@ -24,6 +28,7 @@ func (this *Api_Comp) DelUserMailReq(ctx context.Context, session comm.IUserSess
code = pb.ErrorCode_DBError
return
}
if mailinfo, err = this.module.db_comp.Mail_QueryUserMail(session.GetUserId()); err != nil {
log.Errorf("QueryUserMailResp err:%v", err)
code = pb.ErrorCode_CacheReadError

View File

@ -1,13 +1,16 @@
package mail
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
func (this *Api_Comp) GetUserMailAttachmentReq_Check(session comm.IUserSession, req *pb.DelUserMailReq) (result map[string]interface{}, code pb.ErrorCode) {
return
}
// 领取附件
func (this *Api_Comp) GetUserMailAttachmentReq(ctx context.Context, session comm.IUserSession, req *pb.GetUserMailAttachmentReq) (err error) {
func (this *Api_Comp) GetUserMailAttachmentReq(session comm.IUserSession, agrs map[string]interface{}, req *pb.GetUserMailAttachmentReq) (err error) {
var (
code pb.ErrorCode

View File

@ -1,14 +1,17 @@
package mail
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
)
func (this *Api_Comp) QueryUserMailReq_Check(session comm.IUserSession, req *pb.DelUserMailReq) (result map[string]interface{}, code pb.ErrorCode) {
return
}
// 查看所有邮件信息
func (this *Api_Comp) QueryUserMailReq(ctx context.Context, session comm.IUserSession, req *pb.QueryUserMailReq) (err error) {
func (this *Api_Comp) QueryUserMailReq(session comm.IUserSession, agrs map[string]interface{}, req *pb.QueryUserMailReq) (err error) {
code := pb.ErrorCode_Success
mailinfo := make([]*pb.DB_MailData, 0)

View File

@ -1,13 +1,16 @@
package mail
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
func (this *Api_Comp) ReadUserMailReq_Check(session comm.IUserSession, req *pb.DelUserMailReq) (result map[string]interface{}, code pb.ErrorCode) {
return
}
// 查看某一封邮件
func (this *Api_Comp) ReadUserMailReq(ctx context.Context, session comm.IUserSession, req *pb.ReadUserMailReq) (err error) {
func (this *Api_Comp) ReadUserMailReq(session comm.IUserSession, agrs map[string]interface{}, req *pb.ReadUserMailReq) (err error) {
var (
code pb.ErrorCode
mail *pb.DB_MailData