dao

package
v0.0.0-...-fa598d4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DRIVER_MYSQL = "mysql"
View Source
const DRIVER_SQLITE = "sqlite"

Variables

This section is empty.

Functions

func GetDb

func GetDb() *gorm.DB

GetDb - get a database connection

func Setup

func Setup()

Setup : Connect to mysql database

func Shutdown

func Shutdown() error

Shutdown - close database connection

Types

type DataPerm

type DataPerm struct {
}

func (DataPerm) Create

func (dp DataPerm) Create(dataPerm *model.DataPerm) *gorm.DB

Create

func (DataPerm) Delete

func (dp DataPerm) Delete(dataPerm *model.DataPerm) *gorm.DB

Create

func (DataPerm) Get

func (dp DataPerm) Get(id int) model.DataPerm

Get

func (DataPerm) List

func (dp DataPerm) List(listDto dto.GeneralListDto) ([]model.DataPerm, int64)

List

func (DataPerm) Update

func (dp DataPerm) Update(dataPerm *model.DataPerm) *gorm.DB

Update

type Dept

type Dept struct {
}

func (Dept) Create

func (u Dept) Create(Dept *model.Department) *gorm.DB

Create - new Dept

func (Dept) Delete

func (u Dept) Delete(Dept *model.Department) *gorm.DB

Create - new Dept

func (Dept) Get

func (u Dept) Get(id int) model.Department
func (Dept) GetByRole(role model.Role){
	db := GetDb()
	db.Where("code",role.Dept.Code)
}

Get - get single Dept infoD

func (Dept) List

func (u Dept) List(listDto dto.GeneralListDto) ([]model.Department, int64)

List - Depts list

func (Dept) Update

func (u Dept) Update(Dept *model.Department, ups map[string]interface{}) *gorm.DB

Update - update Dept

type DomainDao

type DomainDao struct {
}

func (DomainDao) Create

func (u DomainDao) Create(domain *model.Domain) *gorm.DB

Create - new Domain

func (DomainDao) Delete

func (u DomainDao) Delete(domain *model.Domain) *gorm.DB

Create - new Domain

func (DomainDao) Get

func (u DomainDao) Get(id int) model.Domain

Get - get single domain infoD

func (DomainDao) GetByCode

func (u DomainDao) GetByCode(code string) model.Domain

GetByCode - get single domain by code

func (DomainDao) List

func (u DomainDao) List(listDto dto.GeneralListDto) ([]model.Domain, int64)

List - Domains list

func (DomainDao) Update

func (u DomainDao) Update(domain *model.Domain, ups map[string]interface{}) *gorm.DB

Update - update Domain

type LoginLog

type LoginLog = model.LoginLog

type LoginLogDao

type LoginLogDao struct {
}

func (LoginLogDao) Create

func (LoginLogDao) Create(loginLogDto *dto.LoginLogDto) error

Insert Login Log

func (LoginLogDao) Detail

func (LoginLogDao) Detail(id int) model.LoginLog

Get

func (LoginLogDao) Lists

func (LoginLogDao) Lists(listDto dto.LoginLogListDto) ([]LoginLogList, int64)

List

type LoginLogList

type LoginLogList struct {
	Id               int       `json:"id"`
	UserId           int       `json:"user_id" binding:"required"`
	User             User      `json:"user"`
	Client           string    `json:"client"`
	Platform         string    `json:"platform"`
	LoginResult      string    `json:"login_result"`
	LoginStatus      int       `json:"login_status"`
	LoginTime        time.Time `json:"login_time"`
	Ip               string    `json:"ip"`
	IpLocation       string    `json:"ip_location"`
	OperationTime    string    `json:"operation_time"`
	OperationContent string    `json:"operation_content"`
	CreateTime       time.Time `json:"-"`
	LastUpdateTime   time.Time `json:"-"`
	Username         string    `json:"username"`
}
type Menu struct {
}
func (m Menu) Create(menu *model.Menu) *gorm.DB

Create - new menu

func (m Menu) Delete(menu *model.Menu) *gorm.DB

Delete - delete menu

func (m Menu) Get(id int, preload bool) model.Menu

Get - get single menu info

func (m Menu) GetByAlias(alias string) model.Menu

GetByAlias - get row by alias

func (m Menu) GetMenusByIds(ids string) []model.Menu

GetMenusByIds

func (m Menu) GetMenusPermByIds(ids string) []model.Menu

GetMenusPermByIds - get permissions in menu table

func (m Menu) GetSubMenus(id int) []model.Menu

GetSubMenus

func (m Menu) List(treeDto dto.GeneralTreeDto) ([]model.Menu, int64)

List

func (m Menu) Update(menu *model.Menu, ups map[string]interface{}) *gorm.DB

Update - update menu

type MenuPermAlias struct {
}
func (MenuPermAlias) Create(menuPermAlias *model.MenuPermAlias)

Create - create of crud

func (MenuPermAlias) Delete(menuPermAlias model.MenuPermAlias)

Delete - delete of crud

func (MenuPermAlias) GetByAlias(alias string, domainId int) model.MenuPermAlias

GetByAlias - get single row of alias

func (MenuPermAlias) GetByPerms(perms string) []model.MenuPermAlias

GetByPerms - get all aliases rows of specific permission code

type OperationLog

type OperationLog = model.OperationLog

type OperationLogDao

type OperationLogDao struct {
}

func (OperationLogDao) Create

func (ol OperationLogDao) Create(orLogDto *dto.OperationLogDto) error

Insert OperationLog

func (OperationLogDao) Detail

func (OperationLogDao) Detail(id int) OperationLog

Get

func (OperationLogDao) Lists

List

type OperationLogList

type OperationLogList struct {
	Id               int       `json:"id"`
	LogNo            string    `json:"log_no" binding:"required"`
	Module           string    `json:"module"`
	RequestUrl       string    `json:"request_url"`
	OperationMethod  string    `json:"operation_method"`
	Params           string    `json:"params"`
	ExceptionStack   string    `json:"exception_stack"`
	OperationResult  string    `json:"operation_result"`
	OperationSuccess int       `json:"operation_success"`
	OperationTime    time.Time `json:"operation_time"`
	UserId           int       `json:"user_id"`
	Ip               string    `json:"ip"`
	IpLocation       string    `json:"ip_location"`
	OperationContent string    `json:"operation_content"`
	CreateTime       time.Time `json:"create_time"`
	LastUpdateTime   time.Time `json:"updated_time"`
	Username         string    `json:"username"`
}

type Role

type Role struct {
}

func (Role) Create

func (r Role) Create(role *model.Role) *gorm.DB

Create - new role

func (Role) Delete

func (r Role) Delete(role *model.Role) *gorm.DB

Delete - delete role

func (Role) Get

func (u Role) Get(id int, preload bool) model.Role

Get - get single roel info

func (Role) GetByName

func (u Role) GetByName(name string) model.Role

Get - get single roel infoD

func (Role) GetRolesByIds

func (Role) GetRolesByIds(ids string) []model.Role

GetRolesByIds

func (Role) GetRolesByNames

func (Role) GetRolesByNames(names []string) []model.Role

GetRolesByNames

func (Role) List

func (u Role) List(listDto dto.GeneralListDto) ([]model.Role, int64)

List - users list

func (Role) Update

func (r Role) Update(role *model.Role, ups map[string]interface{}) *gorm.DB

Update - update role

type RoleDataPermDao

type RoleDataPermDao struct {
}

func (RoleDataPermDao) DeleteByDataPermId

func (dao RoleDataPermDao) DeleteByDataPermId(dataPermId int) error

delete by dataPermId

func (RoleDataPermDao) DeleteByRoleId

func (dao RoleDataPermDao) DeleteByRoleId(roleId int) error

delete by role_id

func (RoleDataPermDao) DeleteMulti

func (dao RoleDataPermDao) DeleteMulti(roleId int, dataPermIds []int) error

batch delete

func (RoleDataPermDao) GetByRoleId

func (dao RoleDataPermDao) GetByRoleId(roleId int) ([]model.GetByRoleIdData, int64)

get by role_id

func (RoleDataPermDao) InsertMulti

func (dao RoleDataPermDao) InsertMulti(dtos []dto.AssignDataPermDto) error

assign data permission

type User

type User struct {
}

func (User) Create

func (u User) Create(user *model.User) *gorm.DB

Create - new user

func (User) Delete

func (u User) Delete(user *model.User) *gorm.DB

Delete - delete user

func (User) Get

func (User) Get(id int, preload bool) model.User

Get - get single user info

func (User) GetByUserName

func (u User) GetByUserName(username string) model.User

GetByUserName - get user from name

func (User) List

func (User) List(listDto dto.GeneralListDto) ([]model.User, int64)

List - users list

func (User) Update

func (u User) Update(user *model.User, ups map[string]interface{}) *gorm.DB

Update - update user

func (User) UpdateDepartment

func (u User) UpdateDepartment(uids []string, departmentId int) error

UpdateDepartment - update user's department

type UserOAuthDao

type UserOAuthDao struct {
}

func (UserOAuthDao) Create

func (u UserOAuthDao) Create(UserOAuth *model.UserOAuth) *gorm.DB

func (UserOAuthDao) Delete

func (u UserOAuthDao) Delete(UserOAuth *model.UserOAuth) *gorm.DB

func (*UserOAuthDao) DeleteByUseridAndFrom

func (dao *UserOAuthDao) DeleteByUseridAndFrom(from int, user_id int) error

func (UserOAuthDao) Get

func (u UserOAuthDao) Get(id int) model.UserOAuth

func (*UserOAuthDao) GetUserByOpenId

func (dao *UserOAuthDao) GetUserByOpenId(openid string, from int) (model.UserOAuth, error)

func (UserOAuthDao) List

func (u UserOAuthDao) List(listDto dto.GeneralListDto) ([]model.UserOAuth, int64)

List - userOAuth list

type UserSecretDao

type UserSecretDao struct {
}

func (UserSecretDao) Create

func (u UserSecretDao) Create(UserSecret *model.UserSecret) *gorm.DB

func (UserSecretDao) Get

func (u UserSecretDao) Get(uid int) model.UserSecret

func (UserSecretDao) Update

func (u UserSecretDao) Update(UserSecret *model.UserSecret, ups map[string]interface{}) *gorm.DB

Update - update UserSecret

Jump to

Keyboard shortcuts

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