This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
summer-utils/tables/oauth/app.go
2023-04-16 11:56:17 +01:00

36 lines
666 B
Go

package oauth
import "code.mrmelon54.com/melon/summer/pkg/utils"
type App struct {
AppId uint64 `json:"id" xorm:"pk autoincr"`
UserId uint64 `json:"user_id"`
Secret string `json:"-"`
Enabled *bool `json:"enabled"`
AppName string `json:"app_name"`
AppDesc string `json:"app_desc"`
AppIcon string `json:"app_icon"`
Privacy string `json:"privacy"`
Terms string `json:"terms"`
}
func (c App) TableName() string {
return "oauth_app"
}
func (c App) GetId() uint64 {
return c.AppId
}
func (c App) SetEnabled(v bool) App {
c.Enabled = utils.PBool(v)
return c
}
func (c App) ClearForNew() App {
c.AppId = 0
c.UserId = 0
c.Secret = ""
return c
}