qortenant

package module
v0.0.0-...-bff2e6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 4 Imported by: 0

README

qor-tenant

qor 多商户插件

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = "en-US"

Functions

This section is empty.

Types

type AvatarImageStorage

type AvatarImageStorage struct{ oss.OSS }

func (AvatarImageStorage) GetSizes

func (AvatarImageStorage) GetSizes() map[string]*media.Size

type Backend

type Backend interface {
	LoadTenants() []*Tenant
	SaveTenant(*Tenant) error
	DeleteTenant(*Tenant) error
}

Backend defined methods that needs for tenant backend

type QorTenant

type QorTenant struct {
	Resource        *admin.Resource
	Backends        []Backend
	FallbackLocales map[string][]string
	// contains filtered or unexported fields
}

QorTenant struct that hold all tenants

func New

func New(backends ...Backend) *QorTenant

New initialize QorTenant with backends

func (QorTenant) ResourceName

func (QorTenant) ResourceName() string

ResourceName change display name in qor admin

type Tenant

type Tenant struct {
	gorm.Model

	Name     string
	FullName string             // 全称
	Avatar   AvatarImageStorage //'头像',
	Province string
	City     string
	County   string
	Addr     string
	Phone    string
	Lng      float64 // 经度
	Lat      float64 // 纬度
	Backend  Backend `json:"-"`
}

Tenant is a struct for tenants

func (Tenant) AvatarImageURL

func (tenant Tenant) AvatarImageURL() string

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL