models

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Active   = iota
	InActive = iota
	NoExist  = iota

	//default avatar if no thumb for user
	DefaultAvatar string = `` /* 2128-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginLog

type LoginLog struct {
	revmongo.BaseModel `bson:",inline"`
	Account            string `bson:"Account,omitempty"`
	Status             string `bson:"Status,omitempty"`
	IPAddress          string `bson:"IPAddress,omitempty"`
	User               *User  `bson:"-"`
}

func (*LoginLog) GenUser

func (m *LoginLog) GenUser(s *mgo.Session)

type Profile

type Profile struct {
	revmongo.BaseModel `bson:",inline"`
	Identity           string `bson:"Identity,omitempty" form:",required,input,Enterprise ID"`
	Mail               string `bson:"Mail,omitempty"`
	IsAdmin            string `bson:"IsAdmin,omitempty" form:",,radio"`
	IsDeveloper        string `bson:"IsDeveloper,omitempty" form:",,radio"`
	UserName           string `bson:"UserName,omitempty"`
	User               *User  `bson:"-"`
}

type StudyUser

type StudyUser struct {
	revmongo.BaseModel `bson:",inline"`
	StudyCode          string `bson:"StudyCode,omitempty" form:",required,select"`
	Identity           string `bson:"Identity,omitempty" form:",required,input,Enterprise ID"`
	Mail               string `bson:"Mail,omitempty"`
	RoleName           string `bson:"RoleName,omitempty" form:",required,select"`
	IsApprover         string `bson:"IsApprover,omitempty" form:",,radio"` // who can approve access
	IsGuest            string `bson:"IsGuest,omitempty" form:",,radio"`    // who only have view access
	UserName           string `bson:"UserName,omitempty"`                  // copy from User.Name
	User               *User  `bson:"-"`
	AccessToken        string `bson:"-"`
}

type User

type User struct {
	revmongo.BaseModel `bson:",inline"`
	Identity           string                 `bson:"Identity,omitempty"`
	Name               string                 `bson:"Name,omitempty"`
	First              string                 `bson:"First,omitempty"`
	Last               string                 `bson:"Last,omitempty"`
	Mail               string                 `bson:"Mail,omitempty"`
	Depart             string                 `bson:"Depart,omitempty"`
	Avatar             string                 `bson:"Avatar,omitempty"`
	UsageLocation      string                 `bson:"UsageLocation,omitempty"`
	IsNotExist         bool                   `bson:"IsNotExist,omitempty"`
	IsAdmin            bool                   `bson:"IsAdmin"`
	AdditionalSettings map[string]interface{} `bson:"AdditionalSettings,omitempty"`
}

func (*User) GetAvatar

func (c *User) GetAvatar()

func (*User) GetName

func (c *User) GetName() string

GetName Parse full name from Li, Ming R&D/CN format

func (*User) SaveUser

func (c *User) SaveUser(s *mgo.Session) error

Save authorized saUser to local User

Jump to

Keyboard shortcuts

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