Add route with functionality for building out the true up review profile.
Этот коммит содержится в:
@@ -400,3 +400,39 @@ func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingTotal() (int64, error) {
|
||||
queryBuilder :=
|
||||
s.getQueryBuilder().
|
||||
Select("COUNT(*)").
|
||||
From("IncomingWebhooks")
|
||||
|
||||
queryString, args, err := queryBuilder.ToSql()
|
||||
if err != nil {
|
||||
return 0, errors.Wrap(err, "incoming_webhook_tosql")
|
||||
}
|
||||
|
||||
var count int64
|
||||
if err := s.GetReplicaX().Get(&count, queryString, args...); err != nil {
|
||||
return 0, errors.Wrap(err, "failed to count total IncomingWebooks")
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingTotal() (int64, error) {
|
||||
queryBuilder :=
|
||||
s.getQueryBuilder().
|
||||
Select("COUNT(*)").
|
||||
From("OutgoingWebhooks")
|
||||
|
||||
queryString, args, err := queryBuilder.ToSql()
|
||||
if err != nil {
|
||||
return 0, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||
}
|
||||
|
||||
var count int64
|
||||
if err := s.GetReplicaX().Get(&count, queryString, args...); err != nil {
|
||||
return 0, errors.Wrap(err, "failed to count total OutgoingWebhooks")
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
@@ -615,6 +615,9 @@ type WebhookStore interface {
|
||||
AnalyticsOutgoingCount(teamID string) (int64, error)
|
||||
InvalidateWebhookCache(webhook string)
|
||||
ClearCaches()
|
||||
|
||||
GetOutgoingTotal() (int64, error)
|
||||
GetIncomingTotal() (int64, error)
|
||||
}
|
||||
|
||||
type CommandStore interface {
|
||||
|
||||
@@ -227,6 +227,27 @@ func (_m *WebhookStore) GetIncomingListByUser(userID string, offset int, limit i
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingTotal provides a mock function with given fields:
|
||||
func (_m *WebhookStore) GetIncomingTotal() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 int64
|
||||
if rf, ok := ret.Get(0).(func() int64); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoing provides a mock function with given fields: id
|
||||
func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(id)
|
||||
@@ -388,6 +409,27 @@ func (_m *WebhookStore) GetOutgoingListByUser(userID string, offset int, limit i
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingTotal provides a mock function with given fields:
|
||||
func (_m *WebhookStore) GetOutgoingTotal() (int64, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 int64
|
||||
if rf, ok := ret.Get(0).(func() int64); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// InvalidateWebhookCache provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) InvalidateWebhookCache(webhook string) {
|
||||
_m.Called(webhook)
|
||||
|
||||
Ссылка в новой задаче
Block a user