Documentation ¶
Index ¶
- func CreateAvatarsAndBlankFile(request *http.Request, objectRequest infrastructure.StorageObjectRequest) (infrastructure.SignedURLs, error)
- func CreateBackgroundMusicAndBlankFile(request *http.Request, param *CreateBackgroundMusicParam) (infrastructure.SignedURL, error)
- func CreateGraphicsAndBlankFiles(request *http.Request, objectRequest infrastructure.StorageObjectRequest) (infrastructure.SignedURLs, error)
- func CreateIntroductionLesson(request *http.Request, needsRecording bool, lesson *domain.Lesson) error
- func CreateLesson(request *http.Request, newLesson *NewLessonParams, lesson *domain.Lesson) error
- func CreateLessonThumbnailBlankFile(request *http.Request, isPublic bool, id int64) (string, error)
- func CreateSynthesisVoice(request *http.Request, params *domain.CreateSynthesisVoiceParam) (domain.Voice, error)
- func CreateUser(request *http.Request, newUser *NewUserParams) error
- func CreateUserThumbnailBlankFile(request *http.Request) (string, error)
- func CreateVoiceAndBlankFile(request *http.Request, params *CreateVoiceParam) (domain.Voice, string, error)
- func DeleteGraphic(request *http.Request, id int64) error
- func DeleteLessonAndResources(id int64, request *http.Request) error
- func GetAllCategories(request *http.Request) ([]domain.ShortCategory, error)
- func GetAvailableAvatars(request *http.Request) ([]domain.Avatar, error)
- func GetBackgroundImages(request *http.Request) ([]domain.BackgroundImage, error)
- func GetBackgroundMusics(request *http.Request) ([]domain.BackgroundMusic, error)
- func GetCategories(request *http.Request, subjectID int64) ([]domain.ShortCategory, error)
- func GetCategory(request *http.Request, id int64, subjectID int64) (domain.Category, error)
- func GetCurrentUser(request *http.Request) (domain.User, error)
- func GetCurrentUserLessons(request *http.Request) ([]domain.Lesson, error)
- func GetGraphicByID(request *http.Request, id int64) (domain.Graphic, error)
- func GetGraphicsByLessonID(request *http.Request, lessonID int64) ([]*domain.Graphic, error)
- func GetGraphicsByLessonIDAndIDs(request *http.Request, lessonID int64, userID int64, ids []string) (map[int64]string, error)
- func GetLessonMaterial(request *http.Request, id int64, lessonID int64) (domain.LessonMaterial, error)
- func GetLessonsByCategoryID(request *http.Request, categoryID int64, cursorStr string) ([]domain.ShortLesson, string, error)
- func GetPrivateLesson(request *http.Request, id int64) (domain.Lesson, error)
- func GetPublicLesson(request *http.Request, id int64, viewKey string) (domain.Lesson, error)
- func GetPublicLessonsByUser(request *http.Request, userID int64) ([]domain.Lesson, error)
- func GetSubjects(request *http.Request) ([]domain.Subject, error)
- func GetUser(request *http.Request, id int64) (domain.User, error)
- func GetUsers(request *http.Request, cursorStr string) ([]domain.User, string, error)
- func GetVoices(request *http.Request, lessonID int64) ([]domain.Voice, error)
- func UnsubscribeCurrentUser(request *http.Request) error
- func UpdateLessonMaterial(request *http.Request, id int64, lessonID int64, ...) error
- func UpdateLessonViewCount(request *http.Request, lessonID int64) error
- func UpdateLessonWithMaterial(id int64, request *http.Request, needsCopyThumbnail bool, requestID string, ...) error
- func UpdateUser(request *http.Request, params *map[string]interface{}) (domain.User, error)
- type CreateBackgroundMusicParam
- type CreateVoiceParam
- type LessonErrorCode
- type LessonMaterialErrorCode
- type NewLessonMaterialParams
- type NewLessonParams
- type NewUserParams
- type UserErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAvatarsAndBlankFile ¶
func CreateAvatarsAndBlankFile(request *http.Request, objectRequest infrastructure.StorageObjectRequest) (infrastructure.SignedURLs, error)
func CreateBackgroundMusicAndBlankFile ¶
func CreateBackgroundMusicAndBlankFile(request *http.Request, param *CreateBackgroundMusicParam) (infrastructure.SignedURL, error)
func CreateGraphicsAndBlankFiles ¶
func CreateGraphicsAndBlankFiles(request *http.Request, objectRequest infrastructure.StorageObjectRequest) (infrastructure.SignedURLs, error)
func CreateIntroductionLesson ¶
func CreateIntroductionLesson(request *http.Request, needsRecording bool, lesson *domain.Lesson) error
CreateIntroductionLessonは、自己紹介用のLessonを作成します。自己紹介に必要なGraphicも、既存のPublicGraphicから作成します。 自己紹介授業を複数作成することはできないため、Lesson作成後にエラーが発生した場合はLessonの削除を試みます。 Graphicはユーザーによる削除が可能なので、重複制限を行わず、Graphic作成後にエラーが発生してもロールバックは試みません。 LessonMaterialも、Lessonの削除後に残り続けても実害はないのでロールバックは試みません。
func CreateLesson ¶
CreateLesson is create the new lesson belongs to subject and category.
func CreateLessonThumbnailBlankFile ¶
CreateLessonThumbnailBlankFile is create blank image file to public or private bucket.
func CreateSynthesisVoice ¶
func CreateSynthesisVoice(request *http.Request, params *domain.CreateSynthesisVoiceParam) (domain.Voice, error)
CreateSynthesisVoiceAndBlankFile creates Voice and blank files of mp3 and wav.
func CreateUser ¶
func CreateUser(request *http.Request, newUser *NewUserParams) error
CreateUserは新規ユーザーを作成します。
func CreateUserThumbnailBlankFile ¶
CreateLessonThumbnailBlankFile is create blank image file.
func CreateVoiceAndBlankFile ¶
func CreateVoiceAndBlankFile(request *http.Request, params *CreateVoiceParam) (domain.Voice, string, error)
CreateVoiceAndBlankFile creates Voice and blank mp3 file.
func GetAllCategories ¶
func GetAllCategories(request *http.Request) ([]domain.ShortCategory, error)
GetCategory return all categories.
func GetAvailableAvatars ¶
GetAvailableAvatars for fetch avatar object from Cloud Datastore
func GetBackgroundImages ¶
func GetBackgroundImages(request *http.Request) ([]domain.BackgroundImage, error)
GetBackgroundImages returns image URLs in Cloud Datastore.
func GetBackgroundMusics ¶
func GetBackgroundMusics(request *http.Request) ([]domain.BackgroundMusic, error)
GetBackgroundMusics returns music URLs in Cloud Datastore.
func GetCategories ¶
GetCategories return categories by the subject.
func GetCategory ¶
GetCategory return a category by id.
func GetCurrentUser ¶
GetCurrentUser for fetch current user account
func GetCurrentUserLessons ¶
func GetGraphicByID ¶
GetGraphicByID is fetching a graphic by id.
func GetGraphicsByLessonID ¶
GetGraphicsByLessonID is fetching graphics belongs to lesson.
func GetLessonMaterial ¶
func GetLessonsByCategoryID ¶
func GetLessonsByCategoryID(request *http.Request, categoryID int64, cursorStr string) ([]domain.ShortLesson, string, error)
GetLessonsByCategoryID for search lessons
func GetPrivateLesson ¶
func GetPublicLesson ¶
GetPublicLesson for fetch the lesson by id
func GetPublicLessonsByUser ¶
func GetSubjects ¶
GetSubjects for fetch avatar object from Cloud Datastore
func UnsubscribeCurrentUser ¶
func UpdateLessonMaterial ¶
func UpdateLessonViewCount ¶
UpdateLessonViewCountは、lessonIDのLessonのViewCountを増分します。
Types ¶
type CreateBackgroundMusicParam ¶
type CreateBackgroundMusicParam struct {
Name string `json:"name"`
}
type CreateVoiceParam ¶
type LessonErrorCode ¶
type LessonErrorCode uint
const ( LessonNotFound LessonErrorCode = 1 LessonNotAvailable LessonErrorCode = 2 InvalidLessonParams LessonErrorCode = 3 )
func (LessonErrorCode) Error ¶
func (e LessonErrorCode) Error() string
type LessonMaterialErrorCode ¶
type LessonMaterialErrorCode uint
const ( LessonMaterialNotAvailable LessonMaterialErrorCode = 1 LessonMaterialNotFound LessonMaterialErrorCode = 2 )
func (LessonMaterialErrorCode) Error ¶
func (e LessonMaterialErrorCode) Error() string
type NewLessonMaterialParams ¶
type NewLessonMaterialParams struct { DurationSec float32 `json:"durationSec"` AvatarID int64 `json:"avatarID"` AvatarLightColor string `json:"avatarLightColor"` BackgroundImageID int64 `json:"backgroundImageID"` VoiceSynthesisConfig domain.VoiceSynthesisConfig `json:"voiceSynthesisConfig"` Avatars []domain.LessonAvatar `json:"avatars"` Drawings []domain.LessonDrawing `json:"drawings"` Embeddings []domain.LessonEmbedding `json:"embeddings"` Graphics []domain.LessonGraphic `json:"graphics"` Musics []domain.LessonMusic `json:"musics"` Speeches []domain.LessonSpeech `json:"speeches"` }
NewLessonMaterialParams
type NewLessonParams ¶
type NewLessonParams struct { NeedsRecording bool `json:"needsRecording"` IsIntroduction bool `json:"isIntroduction"` SubjectID int64 `json:"subjectID"` JapaneseCategoryID int64 `json:"japaneseCategoryID"` Title string `json:"title"` }
NewLessonParamsは、Lessonの新規作成時、リクエストボディをbindするために使用されます。
type NewUserParams ¶
type NewUserParams struct { Name string `json:"name" datastore:",noindex"` Profile string `json:"profile" datastore:",noindex"` Email string `json:"email" datastore:",noindex"` }
NewUserParamsは、Userの新規作成時、リクエストボディをbindするために使用されます。
type UserErrorCode ¶
type UserErrorCode uint
const ( UserNotAvailable UserErrorCode = 1 AlreadyUserExists UserErrorCode = 2 UserNotFound UserErrorCode = 3 )
func (UserErrorCode) Error ¶
func (e UserErrorCode) Error() string