models

package
v0.0.0-...-8170b65 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDept

func AddDept(m *SysDept) error

func AddDict

func AddDict(m *SysDict) error

last inserted Id on success.

func AddDictDetail

func AddDictDetail(m *SysDictDetail) error

func AddJob

func AddJob(m *SysJob) error

func AddLog

func AddLog(m *SysLog) error

last inserted Id on success.

func AddMaterial

func AddMaterial(m *SysMaterial) error

func AddMaterialGroup

func AddMaterialGroup(m *SysMaterialGroup) error

func AddMenu

func AddMenu(m *SysMenu) error

func AddNideshopAd

func AddNideshopAd(m *NideshopAd) error

func AddProduct

func AddProduct(m *YshopStorePic) error

func AddRole

func AddRole(m *SysRole) error

func AddUser

func AddUser(m *SysUser) error

func AddWechatUser

func AddWechatUser(m *YshopUser) error

func BatchRoleMenuAdd

func BatchRoleMenuAdd(menu dto2.RoleMenu) error

func DelByDept

func DelByDept(ids []int64) error

func DelByDict

func DelByDict(ids []int64) error

func DelByDictDetail

func DelByDictDetail(ids []int64) error

func DelByJob

func DelByJob(ids []int64) error

func DelByMaterial

func DelByMaterial(ids []int64) error

func DelByMaterialGroup

func DelByMaterialGroup(ids []int64) error

func DelByMenu

func DelByMenu(ids []int64) error

func DelByProduct

func DelByProduct(ids []int64) error

func DelByRole

func DelByRole(ids []int64) error

func DelByUser

func DelByUser(ids []int64) error

func DelByWechatUser

func DelByWechatUser(ids []int64) error

func DelBylog

func DelBylog(ids []int64) error

func DelNideshopAd

func DelNideshopAd(ids []int64) error

func FindByUserId

func FindByUserId(id int64) ([]string, error)

func Setup

func Setup()

Setup initializes the database instance

func UpdateByDept

func UpdateByDept(m *SysDept) error

func UpdateByDict

func UpdateByDict(m *SysDict) error

func UpdateByDictDetail

func UpdateByDictDetail(m *SysDictDetail) error

func UpdateByJob

func UpdateByJob(m *SysJob) error

func UpdateByMaterial

func UpdateByMaterial(m *SysMaterial) error

func UpdateByMaterialGroup

func UpdateByMaterialGroup(m *SysMaterialGroup) error

func UpdateByMenu

func UpdateByMenu(m *SysMenu) error

func UpdateByProduct

func UpdateByProduct(id int64, m YshopStorePic) error

func UpdateByRole

func UpdateByRole(m *SysRole) error

func UpdateByUser

func UpdateByUser(m *SysUser) error

func UpdateByWechatUsere

func UpdateByWechatUsere(id int64, m *YshopUser) error

func UpdateCurrentUser

func UpdateCurrentUser(m *SysUser) (err error)

func UpdateNideshopAd

func UpdateNideshopAd(m *NideshopAd) error

Types

type BaseModel

type BaseModel struct {
	Id         int64                 `gorm:"primary_key;autoIncrement" json:"id"` // 主键id
	UpdateTime time.Time             `json:"updateTime" gorm:"autoUpdateTime"`    // 更新时间
	CreateTime time.Time             `json:"createTime" gorm:"autoCreateTime"`    // 创建时间
	IsDel      soft_delete.DeletedAt `json:"isDel" gorm:"softDelete:flag"`        // 删除标签 0 未删除 1 已删除
}

type BaseModelNew

type BaseModelNew struct {
	Id         int64                 `gorm:"primary_key;autoIncrement" json:"id"` // 主键id
	UpdateTime *time.Time            `json:"updateTime" gorm:"autoUpdateTime"`    // 更新时间
	CreateTime *time.Time            `json:"createTime" gorm:"autoCreateTime"`    // 创建时间
	IsDel      soft_delete.DeletedAt `json:"isDel" gorm:"softDelete:flag"`        // 删除标签 0 未删除 1 已删除
}

type NideshopAd

type NideshopAd struct {
	AdPositionId int                   `json:"ad_position_id"`
	Content      string                `json:"content"`
	Enabled      int                   `json:"enabled"`
	EndTime      int                   `json:"end_time"`
	Id           int                   `json:"id"`
	ImageUrl     string                `json:"image_url"`
	Link         string                `json:"link"`
	MediaType    int                   `json:"media_type"`
	Name         string                `json:"name"`
	UpdateTime   time.Time             `json:"updateTime" gorm:"autoUpdateTime"`
	CreateTime   time.Time             `json:"createTime" gorm:"autoCreateTime"`
	IsDel        soft_delete.DeletedAt `json:"isDel" gorm:"softDelete:flag"`
}

func GetAllNideshopAds

func GetAllNideshopAds(pageNUm int, pageSize int, maps interface{}) (int64, []NideshopAd)

get all

func GetNideShopAd

func GetNideShopAd(id int64) *NideshopAd

func (NideshopAd) TableName

func (NideshopAd) TableName() string

type RoleId

type RoleId struct {
	Id int64 `json:"id"`
}

type RoleIdList

type RoleIdList struct {
	Id int64
}

type SysDept

type SysDept struct {
	Name     string    `json:"name" valid:"Required;"`
	Pid      int64     `json:"pid"`
	Enabled  int8      `json:"enabled" `
	Children []SysDept `gorm:"-" json:"children"`
	Label    string    `gorm:"-" json:"label"`
	BaseModel
}

func GetAllDepts

func GetAllDepts(maps interface{}) []SysDept

func RecursionDeptList

func RecursionDeptList(data []SysDept, pid int64) []SysDept

递归函数

func (SysDept) TableName

func (SysDept) TableName() string

type SysDict

type SysDict struct {
	Name   string `json:"name" valid:"Required;"`
	Remark string `json:"remark" valid:"Required;"`
	BaseModel
}

func GetAllDict

func GetAllDict(pageNUm int, pageSize int, maps interface{}) (int64, []SysDict)

get all

func (SysDict) TableName

func (SysDict) TableName() string

type SysDictDetail

type SysDictDetail struct {
	Label    string `json:"label" valid:"Required;"`
	Value    string `json:"value" valid:"Required;"`
	Sort     int    `json:"sort"`
	DictId   int64  `json:"dictId"`
	DictName string `json:"dictName"`
	BaseModel
}

func GetAllDictDetail

func GetAllDictDetail(pageNUm int, pageSize int, maps interface{}) (int64, []SysDictDetail)

get all

func (SysDictDetail) TableName

func (SysDictDetail) TableName() string

type SysJob

type SysJob struct {
	Name    string   `json:"name" valid:"Required;"`
	Enabled int8     `json:"enabled"`
	Sort    int      `json:"sort"`
	DeptId  int64    `json:"deptId"`
	Dept    *SysDept `json:"dept" gorm:"foreignKey:DeptId;association_autoupdate:false;association_autocreate:false"`
	BaseModel
}

func GetAllJob

func GetAllJob(pageNUm int, pageSize int, maps interface{}) (int64, []SysJob)

get all

func (SysJob) TableName

func (SysJob) TableName() string

type SysLog

type SysLog struct {
	Description string `json:"description"`
	Method      string `json:"method"`
	RequestIp   string `json:"requestIp"`
	Username    string `json:"username"`
	Address     string `json:"address"`
	Browser     string `json:"browser"`
	Type        int8   `json:"type"`
	Uid         int64  `json:"uid"`
	Time        int64  `json:"time"`
	BaseModel
}

func GetAllLog

func GetAllLog(pageNUm int, pageSize int, maps interface{}) (int64, []SysLog)

get all

func (SysLog) TableName

func (SysLog) TableName() string

type SysMaterial

type SysMaterial struct {
	Name     string `json:"name" valid:"Required;"`
	Type     string `json:"type"`
	Url      string `json:"url"`
	GroupId  int64  `json:"groupId"`
	CreateId int64  `json:"create_id"`
	BaseModel
}

func GetAllMaterial

func GetAllMaterial(pageNUm int, pageSize int, maps interface{}) (int64, []SysMaterial)

func (SysMaterial) TableName

func (SysMaterial) TableName() string

type SysMaterialGroup

type SysMaterialGroup struct {
	Name     string `json:"name" valid:"Required;"`
	CreateId int64  `json:"create_id"`
	BaseModel
}

func GetAllGroup

func GetAllGroup(maps interface{}) []SysMaterialGroup

func (SysMaterialGroup) TableName

func (SysMaterialGroup) TableName() string

type SysMenu

type SysMenu struct {
	Name          string    `json:"name" valid:"Required;"`
	IFrame        int8      `json:"iframe"`
	Component     string    `json:"component"`
	Pid           int64     `json:"pid"`
	Sort          int32     `json:"sort"`
	Icon          string    `json:"icon"`
	Path          string    `json:"path"`
	Cache         int8      `json:"cache"`
	Hidden        int8      `json:"hidden"`
	ComponentName string    `json:"componentName"`
	Permission    string    `json:"permission"`
	Type          int32     `json:"type"`
	Router        string    `json:"router"`
	RouterMethod  string    `json:"routerMethod"`
	Children      []SysMenu `json:"children" gorm:"-"`
	Label         string    `gorm:"-" json:"label"`
	BaseModel
}

func BuildMenus

func BuildMenus(uid int64) []SysMenu

func FindMenuByRouterAndMethod

func FindMenuByRouterAndMethod(url string, method string) SysMenu

func GetAllMenus

func GetAllMenus(maps interface{}) []SysMenu

func GetOneMenuById

func GetOneMenuById(id int64) SysMenu

func RecursionMenuList

func RecursionMenuList(data []SysMenu, pid int64) []SysMenu

递归函数

func (SysMenu) TableName

func (SysMenu) TableName() string

type SysRole

type SysRole struct {
	Name       string     `json:"name" valid:"Required;"`
	Remark     string     `json:"remark"`
	DataScope  string     `json:"dataScope"`
	Level      int32      `json:"level"`
	Permission string     `json:"permission"`
	Users      []*SysUser `gorm:"many2many:sys_users_roles;association_autoupdate:false;association_autocreate:false"`
	Menus      []*SysMenu `json:"menus" gorm:"many2many:sys_roles_menus;association_autoupdate:false;association_autocreate:false"`
	Depts      []*SysDept `gorm:"many2many:sys_roles_depts;association_autoupdate:false;association_autocreate:false"`
	BaseModel
}

func GetAllRole

func GetAllRole(pageNUm int, pageSize int, maps interface{}) (int64, []SysRole)

get all

func GetOneRole

func GetOneRole(id int64) SysRole

func (SysRole) TableName

func (SysRole) TableName() string

type SysRolesDepts

type SysRolesDepts struct {
	Id     int64
	RoleId *SysRole `gorm:"column:sys_role_id;association_autoupdate:false;association_autocreate:false"`
	DeptId *SysDept `gorm:"column:sys_dept_id;association_autoupdate:false;association_autocreate:false"`
}

type SysRolesMenus

type SysRolesMenus struct {
	ID     int64 `gorm:"primaryKey;autoIncrement"`
	MenuId int64 `gorm:"column:sys_menu_id;"`
	RoleId int64 `gorm:"column:sys_role_id;"`
}

type SysUser

type SysUser struct {
	Avatar      string     `json:"avatar"`
	Email       string     `json:"email"`
	Enabled     int8       `json:"enabled"`
	Password    string     `json:"password"`
	Username    string     `json:"username" valid:"Required;"`
	DeptId      int32      `json:"deptId"`
	Phone       string     `json:"phone"`
	JobId       int32      `json:"jobId"`
	NickName    string     `json:"nickName"`
	Sex         string     `json:"sex"`
	Roles       []*SysRole `json:"roles" gorm:"many2many:sys_users_roles;association_autoupdate:false;association_autocreate:false"`
	Jobs        *SysJob    `json:"job" gorm:"foreignKey:JobId;association_autoupdate:false;association_autocreate:false"`
	Depts       *SysDept   `json:"dept" gorm:"foreignKey:DeptId;association_autoupdate:false;association_autocreate:false"`
	Permissions []string   `gorm:"-"`
	RoleIds     []int64    `json:"roleIds" gorm:"-"`
	BaseModel
}

func GetAllUser

func GetAllUser(pageNUm int, pageSize int, maps interface{}) (int64, []SysUser)

get all

func GetUserById

func GetUserById(id int64) (SysUser, error)

GetUserById retrieves User by Id. Returns error if Id doesn't exist

func GetUserByUsername

func GetUserByUsername(name string) (*SysUser, error)

根据用户名返回

func (SysUser) TableName

func (SysUser) TableName() string

type SysUsersRoles

type SysUsersRoles struct {
	Id     int64
	UserId int64 `gorm:"column:sys_user_id;"`
	RoleId int64 `gorm:"column:sys_role_id;"`
}

type YshopStorePic

type YshopStorePic struct {
	Id            int64     `json:"id"`
	ListPicUrl    string    `json:"list_pic_url"`    // 商品列表图
	PrimaryPicUrl string    `json:"primary_pic_url"` // 主图
	Mobile        string    `json:"mobile"`
	Wechat        string    `json:"wechat"`
	PicType       int       `json:"pic_type"`
	UpdateTime    time.Time `json:"updateTime" gorm:"autoUpdateTime"`
	CreateTime    time.Time `json:"createTime" gorm:"autoCreateTime"`
}

func GetAllProduct

func GetAllProduct(pageNUm int, pageSize int, maps interface{}) (int64, []YshopStorePic)

get all

func GetProduct

func GetProduct(id int64) YshopStorePic

func (YshopStorePic) TableName

func (YshopStorePic) TableName() string

type YshopUser

type YshopUser struct {
	Username       string         `json:"username"`
	Password       string         `json:"password"`
	RealName       string         `json:"real_name"`
	Birthday       int            `json:"birthday"`
	CardId         string         `json:"card_id"`
	Mark           string         `json:"mark"`
	Nickname       string         `json:"nickname"`
	Avatar         string         `json:"avatar"`
	Phone          string         `json:"phone"`
	AddIp          string         `json:"add_ip"`
	LastIp         string         `json:"last_ip"`
	NowMoney       float64        `json:"nowMoney"`
	BrokeragePrice float64        `json:"brokeragePrice"`
	Integral       int            `json:"integral"`
	SignNum        int            `json:"sign_num"`
	Status         int8           `json:"status"`
	Level          int8           `json:"level"`
	SpreadUid      string         `json:"spreadUid"`
	SpreadTime     time.Time      `json:"spread_time"`
	UserType       string         `json:"userType"`
	PayCount       int            `json:"payCount"`
	SpreadCount    int            `json:"spread_count"`
	Address        string         `json:"address"`
	LoginType      string         `json:"login_type"`
	WxProfile      datatypes.JSON `json:"wx_profile"`
	BaseModel
}

func GetAllWechatUser

func GetAllWechatUser(pageNUm int, pageSize int, maps interface{}) (int64, []YshopUser)

get all

func (YshopUser) TableName

func (YshopUser) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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