Use request.CTX instead of *request.Context (#24877)
* Use request.CTX instead of *request.Context * Fix tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
37dc35c1a1
Коммит
c7461751f2
@@ -47,11 +47,11 @@ func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channe
|
||||
}
|
||||
|
||||
// AddUserToTeamByTeamId provides a mock function with given fields: c, teamId, user
|
||||
func (_m *MockAppIface) AddUserToTeamByTeamId(c *request.Context, teamId string, user *model.User) *model.AppError {
|
||||
func (_m *MockAppIface) AddUserToTeamByTeamId(c request.CTX, teamId string, user *model.User) *model.AppError {
|
||||
ret := _m.Called(c, teamId, user)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, *model.User) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.User) *model.AppError); ok {
|
||||
r0 = rf(c, teamId, user)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -175,11 +175,11 @@ func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID stri
|
||||
}
|
||||
|
||||
// DeleteReactionForPost provides a mock function with given fields: c, reaction
|
||||
func (_m *MockAppIface) DeleteReactionForPost(c *request.Context, reaction *model.Reaction) *model.AppError {
|
||||
func (_m *MockAppIface) DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError {
|
||||
ret := _m.Called(c, reaction)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) *model.AppError); ok {
|
||||
r0 = rf(c, reaction)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -359,15 +359,15 @@ func (_m *MockAppIface) PermanentDeleteChannel(c request.CTX, channel *model.Cha
|
||||
}
|
||||
|
||||
// SaveReactionForPost provides a mock function with given fields: c, reaction
|
||||
func (_m *MockAppIface) SaveReactionForPost(c *request.Context, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
||||
func (_m *MockAppIface) SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
||||
ret := _m.Called(c, reaction)
|
||||
|
||||
var r0 *model.Reaction
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) (*model.Reaction, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) (*model.Reaction, *model.AppError)); ok {
|
||||
return rf(c, reaction)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) *model.Reaction); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Reaction) *model.Reaction); ok {
|
||||
r0 = rf(c, reaction)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -375,7 +375,7 @@ func (_m *MockAppIface) SaveReactionForPost(c *request.Context, reaction *model.
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.Reaction) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Reaction) *model.AppError); ok {
|
||||
r1 = rf(c, reaction)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -403,15 +403,15 @@ func (_m *MockAppIface) SendEphemeralPost(c request.CTX, userId string, post *mo
|
||||
}
|
||||
|
||||
// UpdatePost provides a mock function with given fields: c, post, safeUpdate
|
||||
func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
func (_m *MockAppIface) UpdatePost(c request.CTX, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) {
|
||||
ret := _m.Called(c, post, safeUpdate)
|
||||
|
||||
var r0 *model.Post
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Post, bool) (*model.Post, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, bool) (*model.Post, *model.AppError)); ok {
|
||||
return rf(c, post, safeUpdate)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Post, bool) *model.Post); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, bool) *model.Post); ok {
|
||||
r0 = rf(c, post, safeUpdate)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -419,7 +419,7 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.Post, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, bool) *model.AppError); ok {
|
||||
r1 = rf(c, post, safeUpdate)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -49,13 +49,13 @@ type AppIface interface {
|
||||
CreateChannelWithUser(c request.CTX, channel *model.Channel, userId string) (*model.Channel, *model.AppError)
|
||||
GetOrCreateDirectChannel(c request.CTX, userId, otherUserId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError)
|
||||
AddUserToChannel(c request.CTX, user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError)
|
||||
AddUserToTeamByTeamId(c *request.Context, teamId string, user *model.User) *model.AppError
|
||||
AddUserToTeamByTeamId(c request.CTX, teamId string, user *model.User) *model.AppError
|
||||
PermanentDeleteChannel(c request.CTX, channel *model.Channel) *model.AppError
|
||||
CreatePost(c request.CTX, post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (savedPost *model.Post, err *model.AppError)
|
||||
UpdatePost(c *request.Context, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
|
||||
UpdatePost(c request.CTX, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
|
||||
DeletePost(c request.CTX, postID, deleteByID string) (*model.Post, *model.AppError)
|
||||
SaveReactionForPost(c *request.Context, reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
||||
DeleteReactionForPost(c *request.Context, reaction *model.Reaction) *model.AppError
|
||||
SaveReactionForPost(c request.CTX, reaction *model.Reaction) (*model.Reaction, *model.AppError)
|
||||
DeleteReactionForPost(c request.CTX, reaction *model.Reaction) *model.AppError
|
||||
PatchChannelModerationsForChannel(c request.CTX, channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError)
|
||||
CreateUploadSession(c request.CTX, us *model.UploadSession) (*model.UploadSession, *model.AppError)
|
||||
FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError)
|
||||
|
||||
Ссылка в новой задаче
Block a user