staff_role

package
v0.0.0-...-1bd4bba Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreatedSuccess = "添加用户角色关联成功!"
	CreatedFail    = "添加用户角色关联失败!"
	UpdatedSuccess = "修改用户角色关联成功!"
	UpdatedFail    = "修改用户角色关联失败!"
	DeletedSuccess = "删除用户角色关联成功!"
	DeletedFail    = "删除用户角色关联失败!"
)
View Source
const (
	FieldStaffID = "staff_id"
	FieldRoleID  = "role_id"

	FieldCreatedAt = "created_at"
	FieldUpdatedAt = "updated_at"
	FieldCreatedBy = "created_by"
	FieldUpdatedBy = "updated_by"

	Table = "system_staffs_roles"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateInput

type CreateInput struct {
	StaffID   string   `zh:"用户ID" json:"staff_id,omitempty"`
	RoleIDs   []string `zh:"角色ID列表" json:"role_ids,omitempty"`
	CreatedBy string   `zh:"创建人员" json:"created_by" validate:"omitempty"`
}

type DeleteInput

type DeleteInput struct {
	StaffID string   `zh:"用户ID" json:"staff_id" validate:"required"`
	RoleIDs []string `zh:"角色ID列表" json:"role_ids" validate:"required"`
}

type Repository

type Repository struct{}

func NewRepository

func NewRepository() *Repository

func (*Repository) CreateBatchWithTx

func (r *Repository) CreateBatchWithTx(i *CreateInput, tx *sqlx.Tx) error

func (*Repository) DeleteBatchWithTx

func (r *Repository) DeleteBatchWithTx(i *DeleteInput, tx *sqlx.Tx) error

func (*Repository) Exist

func (r *Repository) Exist(e *StaffRole, db *sqlx.DB) (bool, error)

func (*Repository) QueryAll

func (r *Repository) QueryAll(w *WhereParams, db *sqlx.DB) ([]*StaffRole, error)

type StaffRole

type StaffRole struct {
	StaffID   string `db:"staff_id" json:"staff_id"`
	RoleID    string `db:"role_id" json:"role_id"`
	CreatedAt int64  `db:"created_at" json:"-"`
	UpdatedAt int64  `db:"updated_at" json:"updated_at"`
	CreatedBy string `db:"created_by" json:"-"`
	UpdatedBy string `db:"updated_by" json:"-"`
}

type UpdateInput

type UpdateInput struct {
	StaffID   string `zh:"用户ID" json:"staff_id,omitempty"`
	RoleID    string `zh:"角色ID" json:"role_id,omitempty"`
	UpdatedBy string `zh:"更新人员" json:"updated_by" validate:"omitempty"`
}

type WhereParams

type WhereParams struct {
	StaffID  string   `zh:"用户ID" query:"staff_id" json:"staff_id" validate:"omitempty"`
	StaffIDs []string `zh:"用户ID列表" query:"staff_ids" json:"staff_ids" validate:"omitempty"`
}

Jump to

Keyboard shortcuts

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