This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
... | |
type DB interface { | |
FindMatchedUsers(title string, regionIdsByRange [][]int64) ([][]model.Matched, error) | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model | |
type Matched struct { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
... | |
type Matched struct { | |
... | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
type mockRegionService struct{} | |
func (m *mockRegionService) GetRegionIdsByRange(_ int64, publishRange int) ([]int64, error) { | |
switch publishRange { | |
case 1: | |
return []int64{1234, 1235, 1236}, nil | |
case 2: | |
return []int64{1234, 1235, 1236, 1300, 1301, 1302}, nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
func TestWorker_listRegionIdsByPublishRange(t *testing.T) { | |
type fields struct { | |
RegionSvc RegionService | |
NotificationSvc NotificationService | |
UserSvc UserService | |
DB DB | |
} | |
type args struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
type NewArticleEvent struct { | |
RegionId int64 | |
PublishRange int | |
WriterId int64 | |
ArticleId int64 | |
Title string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
type NewArticleEvent struct { | |
RegionId int64 | |
PublishRange int | |
WriterId int64 | |
ArticleId int64 | |
Title string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker | |
type NewArticleEvent struct { | |
RegionId int64 | |
PublishRange int | |
WriterId int64 | |
ArticleId int64 | |
Title string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
type User struct { | |
id int64 | |
name string | |
} | |
type DB interface { | |
GetUser(id int64) (*User, error) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const querystring = require('querystring'); | |
const aws = require('aws-sdk'); | |
const s3 = new aws.S3({ | |
region: 'ap-northeast-2', | |
signatureVersion: 'v4' | |
}); | |
const sharp = require('sharp'); |