summaryrefslogtreecommitdiffstats
path: root/modules/convert/convert.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/convert/convert.go')
-rw-r--r--modules/convert/convert.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/convert/convert.go b/modules/convert/convert.go
index 31b46bc7eb..cab2f84bb9 100644
--- a/modules/convert/convert.go
+++ b/modules/convert/convert.go
@@ -388,3 +388,15 @@ func ToTopicResponse(topic *models.Topic) *api.TopicResponse {
Updated: topic.UpdatedUnix.AsTime(),
}
}
+
+// ToOAuth2Application convert from models.OAuth2Application to api.OAuth2Application
+func ToOAuth2Application(app *models.OAuth2Application) *api.OAuth2Application {
+ return &api.OAuth2Application{
+ ID: app.ID,
+ Name: app.Name,
+ ClientID: app.ClientID,
+ ClientSecret: app.ClientSecret,
+ RedirectURIs: app.RedirectURIs,
+ Created: app.CreatedUnix.AsTime(),
+ }
+}