TODO: render/ 相关模块
This commit is contained in:
@@ -37,13 +37,14 @@ func (l *UserContactServiceLogic) UserContactService(req *types.RequestContactSe
|
||||
return resp.SetStatus(basic.CodeUnAuth)
|
||||
}
|
||||
|
||||
cs := gmodel.FsContactService{}
|
||||
|
||||
collect.LoadJsonTag(cs, req)
|
||||
cs := gmodel.FsContactService{
|
||||
UserId: &userinfo.UserId,
|
||||
}
|
||||
collect.LoadJsonTag(&cs, &req)
|
||||
|
||||
switch req.Type {
|
||||
case "order":
|
||||
_, err := l.svcCtx.AllModels.FsOrder.FindOneAndCreateServiceContact(l.ctx, userinfo.UserId, req.RelationID)
|
||||
_, err := l.svcCtx.AllModels.FsOrder.FindOneAndCreateServiceContact(l.ctx, userinfo.UserId, req.RelationID, &cs)
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return resp.SetStatus(basic.CodeOrderNotFoundErr)
|
||||
@@ -51,16 +52,17 @@ func (l *UserContactServiceLogic) UserContactService(req *types.RequestContactSe
|
||||
return resp.SetStatus(basic.CodeDbSqlErr)
|
||||
}
|
||||
case "cloud":
|
||||
_, err := l.svcCtx.AllModels.FsCloudPickUp.GetCloudPickUpByIDAndUserID(l.ctx, userinfo.UserId, req.RelationID)
|
||||
_, err := l.svcCtx.AllModels.FsCloudPickUp.GetCloudPickUpByIDAndUserID(l.ctx, userinfo.UserId, req.RelationID, &cs)
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return resp.SetStatus(basic.CodeCloudOrderNotFoundErr)
|
||||
}
|
||||
return resp.SetStatus(basic.CodeDbSqlErr)
|
||||
}
|
||||
return
|
||||
default:
|
||||
return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "type is unknown")
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
return resp.SetStatus(basic.CodeOK, cs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user