|
@@ -36,7 +36,7 @@ func (s *StoreEntry) GetCurrentSystemUser(ctx context.Context) (*model.SystemUse
|
|
|
Where("is_show = ? and is_delete = ?", pasturePb.IsShow_Ok, pasturePb.IsShow_Ok).
|
|
|
First(systemUser).Error; err != nil {
|
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
- return nil, xerr.Custom("该用户数据不存在")
|
|
|
+ return nil, xerr.Custom("当前登录用户数据不存在")
|
|
|
}
|
|
|
return nil, xerr.WithStack(err)
|
|
|
}
|
|
@@ -49,7 +49,7 @@ func (s *StoreEntry) GetSystemUserInfo(ctx context.Context, userId int64) (*mode
|
|
|
}
|
|
|
if err := s.DB.First(systemUser).Error; err != nil {
|
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
- return nil, xerr.Custom("该数据不存在")
|
|
|
+ return nil, xerr.Customf("该系统用户数据不存在: %d", userId)
|
|
|
}
|
|
|
return nil, xerr.WithStack(err)
|
|
|
}
|
|
@@ -62,7 +62,7 @@ func (s *StoreEntry) GetPenInfo(ctx context.Context, penId int64) (*model.Pen, e
|
|
|
}
|
|
|
if err := s.DB.First(penData).Error; err != nil {
|
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
- return nil, xerr.Custom("该数据不存在")
|
|
|
+ return nil, xerr.Customf("该栏舍数据不存在: %d", penId)
|
|
|
}
|
|
|
return nil, xerr.WithStack(err)
|
|
|
}
|
|
@@ -73,7 +73,7 @@ func (s *StoreEntry) GetCowInfo(ctx context.Context, cowId int64) (*model.Cow, e
|
|
|
cowData := &model.Cow{Id: cowId}
|
|
|
if err := s.DB.First(cowData).Error; err != nil {
|
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
- return nil, xerr.Custom("该数据不存在")
|
|
|
+ return nil, xerr.Customf("该牛只数据不存在: %d", cowId)
|
|
|
}
|
|
|
return nil, xerr.WithStack(err)
|
|
|
}
|
|
@@ -86,7 +86,7 @@ func (s *StoreEntry) GetTransferReasonInfo(ctx context.Context, reasonId int64)
|
|
|
}
|
|
|
if err := s.DB.First(configTransferPenReasonData).Error; err != nil {
|
|
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
|
|
- return nil, xerr.Custom("该数据不存在")
|
|
|
+ return nil, xerr.Customf("该转群原因数据不存在: %d", reasonId)
|
|
|
}
|
|
|
return nil, xerr.WithStack(err)
|
|
|
}
|