admin_service

package
v0.0.0-...-6c1bb8a Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAdminData

type CreateAdminData struct {
	Username string // 用户名
	Nickname string // 昵称
	Mobile   string // 手机号
	Password string // 密码
}

type CreateMenuData

type CreateMenuData struct {
	AdminId int32  `form:"admin_id"` // AdminID
	Actions string `form:"actions"`  // 功能权限ID,多个用,分割
}

type ListMenuData

type ListMenuData struct {
	Id     int32  `json:"id"`      // ID
	Pid    int32  `json:"pid"`     // 父类ID
	Name   string `json:"name"`    // 菜单名称
	IsHave int32  `json:"is_have"` // 是否已拥有权限
}

type ListMyMenuData

type ListMyMenuData struct {
	Id   int32  `json:"id"`   // ID
	Pid  int32  `json:"pid"`  // 父类ID
	Name string `json:"name"` // 菜单名称
	Link string `json:"link"` // 链接地址
	Icon string `json:"icon"` // 图标
}

type ModifyData

type ModifyData struct {
	Nickname string // 昵称
	Mobile   string // 手机号
}

type MyActionData

type MyActionData struct {
	Id     int32  // 主键
	MenuId int32  // 菜单栏ID
	Method string // 请求方式
	Api    string // 请求地址
}

type SearchData

type SearchData struct {
	Page     int    // 第几页
	PageSize int    // 每页显示条数
	Username string // 用户名
	Nickname string // 昵称
	Mobile   string // 手机号
}

type SearchListMenuData

type SearchListMenuData struct {
	AdminId int32 `json:"admin_id"` // 管理员ID
}

type SearchMyActionData

type SearchMyActionData struct {
	AdminId int32 `json:"admin_id"` // 管理员ID
}

type SearchMyMenuData

type SearchMyMenuData struct {
	AdminId int32 `json:"admin_id"` // 管理员ID
}

type SearchOneData

type SearchOneData struct {
	Id       int32  // 用户ID
	Username string // 用户名
	Nickname string // 昵称
	Mobile   string // 手机号
	Password string // 密码
	IsUsed   int32  // 是否启用 1:是  -1:否
}

type Service

type Service interface {
	Create(ctx core.Context, adminData *CreateAdminData) (id int32, err error)
	PageList(ctx core.Context, searchData *SearchData) (listData []*admin_repo.Admin, err error)
	PageListCount(ctx core.Context, searchData *SearchData) (total int64, err error)
	UpdateUsed(ctx core.Context, id int32, used int32) (err error)
	Delete(ctx core.Context, id int32) (err error)
	Detail(ctx core.Context, searchOneData *SearchOneData) (info *admin_repo.Admin, err error)
	ResetPassword(ctx core.Context, id int32) (err error)
	ModifyPassword(ctx core.Context, id int32, newPassword string) (err error)
	ModifyPersonalInfo(ctx core.Context, id int32, modifyData *ModifyData) (err error)

	CreateMenu(ctx core.Context, menuData *CreateMenuData) (err error)
	ListMenu(ctx core.Context, searchData *SearchListMenuData) (menuData []ListMenuData, err error)
	MyMenu(ctx core.Context, searchData *SearchMyMenuData) (menuData []ListMyMenuData, err error)
	MyAction(ctx core.Context, searchData *SearchMyActionData) (actionData []MyActionData, err error)
	// contains filtered or unexported methods
}

func New

func New(db db.Repo, cache cache.Repo) Service

Jump to

Keyboard shortcuts

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