models

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	model.Base
	Name   string
	Secret string
	Active bool
}

@model @db s_apps

func NewApp

func NewApp(name, secret string) *App

func (*App) Reset

func (app *App) Reset(secret string)

type AuthToken

type AuthToken struct {
	model.Created
	AccessToken  string `db:"access_token"`
	RefreshToken string `db:"refresh_token"`
	AppId        uint32 `db:"app_id"`
	AccountId    uint32 `db:"account_id"`
}

@model @db s_auth_tokens

func NewAuthToken

func NewAuthToken(accessToken, refreshToken string, appId, accountId uint32) *AuthToken

type AuthTokenWithApp

type AuthTokenWithApp struct {
	AuthToken
	AppName string `db:"app_name"`
}

@model @embed AuthToken

type Department

type Department struct {
	model.Base
	Name    string
	OwnerId uint32 `db:"owner_id"`
	Active  bool
}

@model @db s_departments

func NewDept

func NewDept(name string, ownerId int) *Department

type DeptLevel

type DeptLevel struct {
	model.Record
	DeptId    uint32 `db:"dept_id"`
	SubDeptId uint32 `db:"sub_dept_id"`
}

@model @db s_dept_leves

type DeptStaff

type DeptStaff struct {
	model.Record
	DeptId  uint32 `db:"dept_id"`
	StaffId uint32 `db:"staff_id"`
}

@model @db s_dept_staffs

type Group

type Group struct {
	model.Base
	Name   string
	Type   uint16
	AppId  uint32 `db:"app_id"`
	Active bool
}

@model @db s_groups

func NewGroup

func NewGroup(name string, gtype uint16, appId uint32) *Group

type GroupPage

type GroupPage struct {
	model.Page
	Type  int
	AppId int `db:"app_id"`
}

type GroupWithApp

type GroupWithApp struct {
	Group
	AppName string `db:"app_name"`
}

@model @embed Group

type Log

type Log struct {
	model.Created
	Detail string
}

@model @db s_logs

func NewLog

func NewLog(log fmt.Stringer) *Log

func (*Log) GetDetail

func (log *Log) GetDetail() *LogDetail

type LogDetail

type LogDetail struct {
	AppId     int        `json:"appId,omitempty"`
	StaffId   int        `json:"staffId,omitempty"`
	Resource  string     `json:"resource,omitempty"`
	Action    string     `json:"action,omitempty"`
	PathVars  gin.Params `json:"pathVars,omitempty"`
	QueryVars url.Values `json:"queryVars,omitempty"`
}

func (*LogDetail) String

func (ld *LogDetail) String() string

type Staff

type Staff struct {
	model.Base
	Email     string
	Password  string
	Phone     string
	Super     bool
	Active    bool
	Departure bool
}

@model @db s_staffs

func NewStaff

func NewStaff(email, password, phone string, super bool) *Staff

func (*Staff) Reset

func (s *Staff) Reset(password string)

Jump to

Keyboard shortcuts

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