Add basic trello migration structure
This commit is contained in:
parent
a32741575c
commit
d49eaac191
63
pkg/modules/migration/trello/trello.go
Normal file
63
pkg/modules/migration/trello/trello.go
Normal file
@ -0,0 +1,63 @@
|
||||
// Vikunja is a to-do list application to facilitate your life.
|
||||
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package trello
|
||||
|
||||
import "code.vikunja.io/api/pkg/user"
|
||||
|
||||
type Migration struct {
|
||||
}
|
||||
|
||||
// Name is used to get the name of the trello migration - we're using the docs here to annotate the status route.
|
||||
// @Summary Get migration status
|
||||
// @Description Returns if the current user already did the migation or not. This is useful to show a confirmation message in the frontend if the user is trying to do the same migration again.
|
||||
// @tags migration
|
||||
// @Produce json
|
||||
// @Security JWTKeyAuth
|
||||
// @Success 200 {object} migration.Status "The migration status"
|
||||
// @Failure 500 {object} models.Message "Internal server error"
|
||||
// @Router /migration/trello/status [get]
|
||||
func (m *Migration) Name() string {
|
||||
return "trello"
|
||||
}
|
||||
|
||||
// AuthURL returns the url users need to authenticate against
|
||||
// @Summary Get the auth url from trello
|
||||
// @Description Returns the auth url where the user needs to get its auth code. This code can then be used to migrate everything from trello to Vikunja.
|
||||
// @tags migration
|
||||
// @Produce json
|
||||
// @Security JWTKeyAuth
|
||||
// @Success 200 {object} handler.AuthURL "The auth url."
|
||||
// @Failure 500 {object} models.Message "Internal server error"
|
||||
// @Router /migration/trello/auth [get]
|
||||
func (m *Migration) AuthURL() string {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
// Migrate gets all tasks from trello for a user and puts them into vikunja
|
||||
// @Summary Migrate all lists, tasks etc. from trello
|
||||
// @Description Migrates all projects, tasks, notes, reminders, subtasks and files from trello to vikunja.
|
||||
// @tags migration
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security JWTKeyAuth
|
||||
// @Param migrationCode body trello.Migration true "The auth code previously obtained from the auth url. See the docs for /migration/trello/auth."
|
||||
// @Success 200 {object} models.Message "A message telling you everything was migrated successfully."
|
||||
// @Failure 500 {object} models.Message "Internal server error"
|
||||
// @Router /migration/trello/migrate [post]
|
||||
func (m *Migration) Migrate(user *user.User) error {
|
||||
panic("implement me")
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user