MM-25478: Migrate compliancestore to plain error (#15074)
* ComplianceStore migration * Fix imports * Added one string * fix go.tools.mod Co-authored-by: Rodrigo Villablanca <villa061004@gmail.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e5edf2683d
Коммит
29c8b58fc7
@@ -2632,7 +2632,7 @@ func (s *OpenTracingLayerCommandWebhookStore) TryUse(id string, limit int) error
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError) {
|
||||
func (s *OpenTracingLayerComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ComplianceStore.ComplianceExport")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2650,7 +2650,7 @@ func (s *OpenTracingLayerComplianceStore) ComplianceExport(compliance *model.Com
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerComplianceStore) Get(id string) (*model.Compliance, *model.AppError) {
|
||||
func (s *OpenTracingLayerComplianceStore) Get(id string) (*model.Compliance, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ComplianceStore.Get")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2668,7 +2668,7 @@ func (s *OpenTracingLayerComplianceStore) Get(id string) (*model.Compliance, *mo
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerComplianceStore) GetAll(offset int, limit int) (model.Compliances, *model.AppError) {
|
||||
func (s *OpenTracingLayerComplianceStore) GetAll(offset int, limit int) (model.Compliances, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ComplianceStore.GetAll")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2686,7 +2686,7 @@ func (s *OpenTracingLayerComplianceStore) GetAll(offset int, limit int) (model.C
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError) {
|
||||
func (s *OpenTracingLayerComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ComplianceStore.MessageExport")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2704,7 +2704,7 @@ func (s *OpenTracingLayerComplianceStore) MessageExport(after int64, limit int)
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (s *OpenTracingLayerComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ComplianceStore.Save")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2722,7 +2722,7 @@ func (s *OpenTracingLayerComplianceStore) Save(compliance *model.Compliance) (*m
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (s *OpenTracingLayerComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ComplianceStore.Update")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
package sqlstore
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type SqlComplianceStore struct {
|
||||
@@ -36,51 +37,51 @@ func newSqlComplianceStore(sqlStore SqlStore) store.ComplianceStore {
|
||||
func (s SqlComplianceStore) createIndexesIfNotExists() {
|
||||
}
|
||||
|
||||
func (s SqlComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (s SqlComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
compliance.PreSave()
|
||||
if err := compliance.IsValid(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := s.GetMaster().Insert(compliance); err != nil {
|
||||
return nil, model.NewAppError("SqlComplianceStore.Save", "store.sql_compliance.save.saving.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to save Compliance")
|
||||
}
|
||||
return compliance, nil
|
||||
}
|
||||
|
||||
func (s SqlComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (s SqlComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
if err := compliance.IsValid(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := s.GetMaster().Update(compliance); err != nil {
|
||||
return nil, model.NewAppError("SqlComplianceStore.Update", "store.sql_compliance.save.saving.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to update Compliance")
|
||||
}
|
||||
return compliance, nil
|
||||
}
|
||||
|
||||
func (s SqlComplianceStore) GetAll(offset, limit int) (model.Compliances, *model.AppError) {
|
||||
func (s SqlComplianceStore) GetAll(offset, limit int) (model.Compliances, error) {
|
||||
query := "SELECT * FROM Compliances ORDER BY CreateAt DESC LIMIT :Limit OFFSET :Offset"
|
||||
|
||||
var compliances model.Compliances
|
||||
if _, err := s.GetReplica().Select(&compliances, query, map[string]interface{}{"Offset": offset, "Limit": limit}); err != nil {
|
||||
return nil, model.NewAppError("SqlComplianceStore.Get", "store.sql_compliance.get.finding.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to find all Compliances")
|
||||
}
|
||||
return compliances, nil
|
||||
}
|
||||
|
||||
func (s SqlComplianceStore) Get(id string) (*model.Compliance, *model.AppError) {
|
||||
func (s SqlComplianceStore) Get(id string) (*model.Compliance, error) {
|
||||
obj, err := s.GetReplica().Get(model.Compliance{}, id)
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlComplianceStore.Get", "store.sql_compliance.get.finding.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to get Compliance with id=%s", id)
|
||||
}
|
||||
if obj == nil {
|
||||
return nil, model.NewAppError("SqlComplianceStore.Get", "store.sql_compliance.get.finding.app_error", nil, "", http.StatusNotFound)
|
||||
return nil, store.NewErrNotFound("Compliance", id)
|
||||
}
|
||||
return obj.(*model.Compliance), nil
|
||||
}
|
||||
|
||||
func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) ([]*model.CompliancePost, *model.AppError) {
|
||||
func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) ([]*model.CompliancePost, error) {
|
||||
props := map[string]interface{}{"StartTime": job.StartAt, "EndTime": job.EndAt}
|
||||
|
||||
keywordQuery := ""
|
||||
@@ -201,12 +202,12 @@ func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) ([]*model.Co
|
||||
var cposts []*model.CompliancePost
|
||||
|
||||
if _, err := s.GetReplica().Select(&cposts, query, props); err != nil {
|
||||
return nil, model.NewAppError("SqlPostStore.ComplianceExport", "store.sql_post.compliance_export.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "unable to export compliance")
|
||||
}
|
||||
return cposts, nil
|
||||
}
|
||||
|
||||
func (s SqlComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError) {
|
||||
func (s SqlComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, error) {
|
||||
props := map[string]interface{}{"StartTime": after, "Limit": limit}
|
||||
query :=
|
||||
`SELECT
|
||||
@@ -250,7 +251,7 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) ([]*model.Mess
|
||||
|
||||
var cposts []*model.MessageExport
|
||||
if _, err := s.GetReplica().Select(&cposts, query, props); err != nil {
|
||||
return nil, model.NewAppError("SqlComplianceStore.MessageExport", "store.sql_compliance.message_export.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "unable to export messages")
|
||||
}
|
||||
return cposts, nil
|
||||
}
|
||||
|
||||
@@ -402,12 +402,12 @@ type ClusterDiscoveryStore interface {
|
||||
}
|
||||
|
||||
type ComplianceStore interface {
|
||||
Save(compliance *model.Compliance) (*model.Compliance, *model.AppError)
|
||||
Update(compliance *model.Compliance) (*model.Compliance, *model.AppError)
|
||||
Get(id string) (*model.Compliance, *model.AppError)
|
||||
GetAll(offset, limit int) (model.Compliances, *model.AppError)
|
||||
ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError)
|
||||
MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError)
|
||||
Save(compliance *model.Compliance) (*model.Compliance, error)
|
||||
Update(compliance *model.Compliance) (*model.Compliance, error)
|
||||
Get(id string) (*model.Compliance, error)
|
||||
GetAll(offset, limit int) (model.Compliances, error)
|
||||
ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, error)
|
||||
MessageExport(after int64, limit int) ([]*model.MessageExport, error)
|
||||
}
|
||||
|
||||
type OAuthStore interface {
|
||||
|
||||
@@ -165,40 +165,40 @@ func testComplianceExport(t *testing.T, ss store.Store) {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
cr1 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1}
|
||||
cposts, err := ss.Compliance().ComplianceExport(cr1)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr := ss.Compliance().ComplianceExport(cr1)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 4)
|
||||
assert.Equal(t, cposts[0].PostId, o1.Id)
|
||||
assert.Equal(t, cposts[3].PostId, o2a.Id)
|
||||
|
||||
cr2 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1, Emails: u2.Email}
|
||||
cposts, err = ss.Compliance().ComplianceExport(cr2)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr = ss.Compliance().ComplianceExport(cr2)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 1)
|
||||
assert.Equal(t, cposts[0].PostId, o2a.Id)
|
||||
|
||||
cr3 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1, Emails: u2.Email + ", " + u1.Email}
|
||||
cposts, err = ss.Compliance().ComplianceExport(cr3)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr = ss.Compliance().ComplianceExport(cr3)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 4)
|
||||
assert.Equal(t, cposts[0].PostId, o1.Id)
|
||||
assert.Equal(t, cposts[3].PostId, o2a.Id)
|
||||
|
||||
cr4 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1, Keywords: o2a.Message}
|
||||
cposts, err = ss.Compliance().ComplianceExport(cr4)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr = ss.Compliance().ComplianceExport(cr4)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 1)
|
||||
assert.Equal(t, cposts[0].PostId, o2a.Id)
|
||||
|
||||
cr5 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1, Keywords: o2a.Message + " " + o1.Message}
|
||||
cposts, err = ss.Compliance().ComplianceExport(cr5)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr = ss.Compliance().ComplianceExport(cr5)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 2)
|
||||
assert.Equal(t, cposts[0].PostId, o1.Id)
|
||||
|
||||
cr6 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1, Emails: u2.Email + ", " + u1.Email, Keywords: o2a.Message + " " + o1.Message}
|
||||
cposts, err = ss.Compliance().ComplianceExport(cr6)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr = ss.Compliance().ComplianceExport(cr6)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 2)
|
||||
assert.Equal(t, cposts[0].PostId, o1.Id)
|
||||
assert.Equal(t, cposts[1].PostId, o2a.Id)
|
||||
@@ -284,8 +284,8 @@ func testComplianceExportDirectMessages(t *testing.T, ss store.Store) {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
cr1 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o3.CreateAt + 1, Emails: u1.Email}
|
||||
cposts, err := ss.Compliance().ComplianceExport(cr1)
|
||||
require.Nil(t, err)
|
||||
cposts, nErr := ss.Compliance().ComplianceExport(cr1)
|
||||
require.Nil(t, nErr)
|
||||
assert.Len(t, cposts, 4)
|
||||
assert.Equal(t, cposts[0].PostId, o1.Id)
|
||||
assert.Equal(t, cposts[len(cposts)-1].PostId, o3.Id)
|
||||
|
||||
@@ -15,7 +15,7 @@ type ComplianceStore struct {
|
||||
}
|
||||
|
||||
// ComplianceExport provides a mock function with given fields: compliance
|
||||
func (_m *ComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError) {
|
||||
func (_m *ComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, error) {
|
||||
ret := _m.Called(compliance)
|
||||
|
||||
var r0 []*model.CompliancePost
|
||||
@@ -27,20 +27,18 @@ func (_m *ComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*mo
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok {
|
||||
r1 = rf(compliance)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *ComplianceStore) Get(id string) (*model.Compliance, *model.AppError) {
|
||||
func (_m *ComplianceStore) Get(id string) (*model.Compliance, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
var r0 *model.Compliance
|
||||
@@ -52,20 +50,18 @@ func (_m *ComplianceStore) Get(id string) (*model.Compliance, *model.AppError) {
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAll provides a mock function with given fields: offset, limit
|
||||
func (_m *ComplianceStore) GetAll(offset int, limit int) (model.Compliances, *model.AppError) {
|
||||
func (_m *ComplianceStore) GetAll(offset int, limit int) (model.Compliances, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
var r0 model.Compliances
|
||||
@@ -77,20 +73,18 @@ func (_m *ComplianceStore) GetAll(offset int, limit int) (model.Compliances, *mo
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MessageExport provides a mock function with given fields: after, limit
|
||||
func (_m *ComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError) {
|
||||
func (_m *ComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, error) {
|
||||
ret := _m.Called(after, limit)
|
||||
|
||||
var r0 []*model.MessageExport
|
||||
@@ -102,20 +96,18 @@ func (_m *ComplianceStore) MessageExport(after int64, limit int) ([]*model.Messa
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int64, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int64, int) error); ok {
|
||||
r1 = rf(after, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: compliance
|
||||
func (_m *ComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (_m *ComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
ret := _m.Called(compliance)
|
||||
|
||||
var r0 *model.Compliance
|
||||
@@ -127,20 +119,18 @@ func (_m *ComplianceStore) Save(compliance *model.Compliance) (*model.Compliance
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok {
|
||||
r1 = rf(compliance)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: compliance
|
||||
func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
ret := _m.Called(compliance)
|
||||
|
||||
var r0 *model.Compliance
|
||||
@@ -152,13 +142,11 @@ func (_m *ComplianceStore) Update(compliance *model.Compliance) (*model.Complian
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.Compliance) error); ok {
|
||||
r1 = rf(compliance)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
|
||||
@@ -2416,7 +2416,7 @@ func (s *TimerLayerCommandWebhookStore) TryUse(id string, limit int) error {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError) {
|
||||
func (s *TimerLayerComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ComplianceStore.ComplianceExport(compliance)
|
||||
@@ -2432,7 +2432,7 @@ func (s *TimerLayerComplianceStore) ComplianceExport(compliance *model.Complianc
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) Get(id string) (*model.Compliance, *model.AppError) {
|
||||
func (s *TimerLayerComplianceStore) Get(id string) (*model.Compliance, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ComplianceStore.Get(id)
|
||||
@@ -2448,7 +2448,7 @@ func (s *TimerLayerComplianceStore) Get(id string) (*model.Compliance, *model.Ap
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) GetAll(offset int, limit int) (model.Compliances, *model.AppError) {
|
||||
func (s *TimerLayerComplianceStore) GetAll(offset int, limit int) (model.Compliances, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ComplianceStore.GetAll(offset, limit)
|
||||
@@ -2464,7 +2464,7 @@ func (s *TimerLayerComplianceStore) GetAll(offset int, limit int) (model.Complia
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError) {
|
||||
func (s *TimerLayerComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ComplianceStore.MessageExport(after, limit)
|
||||
@@ -2480,7 +2480,7 @@ func (s *TimerLayerComplianceStore) MessageExport(after int64, limit int) ([]*mo
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (s *TimerLayerComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ComplianceStore.Save(compliance)
|
||||
@@ -2496,7 +2496,7 @@ func (s *TimerLayerComplianceStore) Save(compliance *model.Compliance) (*model.C
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
|
||||
func (s *TimerLayerComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ComplianceStore.Update(compliance)
|
||||
|
||||
Ссылка в новой задаче
Block a user