errorcode
This commit is contained in:
parent
a5c6d42af7
commit
9dd133e6ce
@ -44,9 +44,13 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq)
|
|||||||
// 弹劾
|
// 弹劾
|
||||||
if err := this.module.modelSociaty.accuse(sociaty); err != nil {
|
if err := this.module.modelSociaty.accuse(sociaty); err != nil {
|
||||||
var customErr = new(comm.CustomError)
|
var customErr = new(comm.CustomError)
|
||||||
var code pb.ErrorCode
|
|
||||||
if errors.As(err, &customErr) {
|
if errors.As(err, &customErr) {
|
||||||
code = customErr.Code
|
code := customErr.Code
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: code,
|
||||||
|
Title: code.ToString(),
|
||||||
|
Datastring: sociaty.Id,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
@ -55,11 +59,6 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: code,
|
|
||||||
Title: code.ToString(),
|
|
||||||
Datastring: sociaty.Id,
|
|
||||||
}
|
|
||||||
this.module.Error("弹劾",
|
this.module.Error("弹劾",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "sociatyId", Value: sociaty.Id},
|
log.Field{Key: "sociatyId", Value: sociaty.Id},
|
||||||
|
@ -49,9 +49,13 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
|
|||||||
|
|
||||||
if err := this.module.modelSociaty.agree(req.Uid, sociaty); err != nil {
|
if err := this.module.modelSociaty.agree(req.Uid, sociaty); err != nil {
|
||||||
var customError = new(comm.CustomError)
|
var customError = new(comm.CustomError)
|
||||||
var code pb.ErrorCode
|
|
||||||
if errors.As(err, &customError) {
|
if errors.As(err, &customError) {
|
||||||
code = customError.Code
|
code := customError.Code
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: code,
|
||||||
|
Title: code.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
@ -59,11 +63,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
|
|||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: code,
|
|
||||||
Title: code.ToString(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
this.module.Error("公会审核-同意",
|
this.module.Error("公会审核-同意",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "申请人", Value: req.Uid},
|
log.Field{Key: "申请人", Value: req.Uid},
|
||||||
|
@ -112,9 +112,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
|
|||||||
isCheck, err := this.module.modelSociaty.apply(uid, sociaty)
|
isCheck, err := this.module.modelSociaty.apply(uid, sociaty)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var customError = new(comm.CustomError)
|
var customError = new(comm.CustomError)
|
||||||
var code pb.ErrorCode
|
|
||||||
if errors.As(err, &customError) {
|
if errors.As(err, &customError) {
|
||||||
code = customError.Code
|
code := customError.Code
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: code,
|
||||||
|
Title: code.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
@ -122,11 +126,7 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
|
|||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: code,
|
|
||||||
Title: code.ToString(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
this.module.Error("公会申请",
|
this.module.Error("公会申请",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "sociatyId", Value: req.SociatyId},
|
log.Field{Key: "sociatyId", Value: req.SociatyId},
|
||||||
|
@ -81,9 +81,14 @@ func (this *apiComp) Assign(session comm.IUserSession, req *pb.SociatyAssignReq)
|
|||||||
if err := this.module.modelSociatyLog.addLog(Log_Job, sociaty.Id,
|
if err := this.module.modelSociatyLog.addLog(Log_Job, sociaty.Id,
|
||||||
uid, req.TargetId, pb.SociatyJob_PRESIDENT.String()); err != nil {
|
uid, req.TargetId, pb.SociatyJob_PRESIDENT.String()); err != nil {
|
||||||
var customErr = new(comm.CustomError)
|
var customErr = new(comm.CustomError)
|
||||||
var code pb.ErrorCode
|
|
||||||
if errors.As(err, &customErr) {
|
if errors.As(err, &customErr) {
|
||||||
code = customErr.Code
|
code := customErr.Code
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: code,
|
||||||
|
Title: code.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
@ -91,11 +96,7 @@ func (this *apiComp) Assign(session comm.IUserSession, req *pb.SociatyAssignReq)
|
|||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: code,
|
|
||||||
Title: code.ToString(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
this.module.Error("公会转让日志",
|
this.module.Error("公会转让日志",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "sociatyId", Value: sociaty.Id},
|
log.Field{Key: "sociatyId", Value: sociaty.Id},
|
||||||
|
@ -81,13 +81,14 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
|
|||||||
Title: code.ToString(),
|
Title: code.ToString(),
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
} else {
|
||||||
}
|
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,9 +50,13 @@ func (this *apiComp) Discharge(session comm.IUserSession, req *pb.SociatyDischar
|
|||||||
// 踢人
|
// 踢人
|
||||||
if err := this.module.modelSociaty.discharge(req.TargetId, sociaty); err != nil {
|
if err := this.module.modelSociaty.discharge(req.TargetId, sociaty); err != nil {
|
||||||
var customError = new(comm.CustomError)
|
var customError = new(comm.CustomError)
|
||||||
var code pb.ErrorCode
|
|
||||||
if errors.As(err, &customError) {
|
if errors.As(err, &customError) {
|
||||||
code = customError.Code
|
code := customError.Code
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: code,
|
||||||
|
Title: code.ToString(),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
@ -60,10 +64,7 @@ func (this *apiComp) Discharge(session comm.IUserSession, req *pb.SociatyDischar
|
|||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: code,
|
|
||||||
Title: code.ToString(),
|
|
||||||
}
|
|
||||||
this.module.Error("踢出公会",
|
this.module.Error("踢出公会",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "sociatyId", Value: sociaty.Id},
|
log.Field{Key: "sociatyId", Value: sociaty.Id},
|
||||||
|
@ -32,7 +32,6 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (er
|
|||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_SociatyNoAdded,
|
Code: pb.ErrorCode_SociatyNoAdded,
|
||||||
Title: pb.ErrorCode_SociatyNoAdded.ToString(),
|
Title: pb.ErrorCode_SociatyNoAdded.ToString(),
|
||||||
Message: err.Error(),
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user