service

package
v0.0.0-...-3363d21 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoticesKey = "notices"
)

Variables

View Source
var FileSet = wire.NewSet(wire.Struct(new(FileSrv), "*"))
View Source
var MonitorSet = wire.NewSet(wire.Struct(new(MonitorSrv), "*"))
View Source
var RoleSet = wire.NewSet(wire.Struct(new(RoleSrv), "*"))
View Source
var UserSet = wire.NewSet(wire.Struct(new(UserSrv), "*"))

Functions

This section is empty.

Types

type FileSrv

type FileSrv struct {
	FileRepo *file.FileRepo
	Local    *fileStore.Local
}

func (*FileSrv) DeleteFile

func (s *FileSrv) DeleteFile(ctx context.Context, id uint64) error

DeleteFile 删除文件记录

func (*FileSrv) UploadFile

func (s *FileSrv) UploadFile(ctx context.Context, header *multipart.FileHeader, noSave string) (string, error)

UploadFile 上传到本地

type MonitorSrv

type MonitorSrv struct{}

func (*MonitorSrv) Index

func (s *MonitorSrv) Index(ctx context.Context) (*monitor.Server, error)

type MsgSrv

type MsgSrv struct {
	MsgRepo *msg.MsgRepo

	Ring *redis.Ring
	// contains filtered or unexported fields
}

func NewMsgSrv

func NewMsgSrv(msgRepo *msg.MsgRepo) *MsgSrv

func (*MsgSrv) Create

func (s *MsgSrv) Create(ctx context.Context, params *schema.NoticeCreateReq) error

Create 新建公告

func (*MsgSrv) Delete

func (s *MsgSrv) Delete(ctx context.Context, id uint64) error

Delete 删除公告

func (*MsgSrv) GetPage

GetPage 获取公告信息

func (*MsgSrv) Update

func (s *MsgSrv) Update(ctx context.Context, params *schema.NoticeUpdateReq) error

Update 更新公告

type RoleSrv

type RoleSrv struct {
	RoleRepo *role.RoleRepo
}

func (*RoleSrv) GetUserRoles

func (s *RoleSrv) GetUserRoles(ctx context.Context, userName string) (*[]*schema.Role, error)

type UserSrv

type UserSrv struct {
	TransRepo *util.Trans
	UserRepo  *user.UserRepo
	RoleRepo  *role.RoleRepo
}

func (*UserSrv) CheckUser

func (s *UserSrv) CheckUser(ctx context.Context, username, password string) (uint64, error)

func (*UserSrv) Create

func (s *UserSrv) Create(ctx context.Context, req *schema.UserCreateReq, createdBy string) error

func (*UserSrv) Delete

func (s *UserSrv) Delete(ctx context.Context, id uint64) error

func (*UserSrv) ExistUserByName

func (s *UserSrv) ExistUserByName(ctx context.Context, username string) bool

func (*UserSrv) GetPage

func (*UserSrv) GetRoles

func (s *UserSrv) GetRoles(ctx context.Context, username string) (*[]string, error)

func (*UserSrv) GetUserAvatar

func (s *UserSrv) GetUserAvatar(ctx context.Context, username string) (string, error)

func (*UserSrv) Update

func (s *UserSrv) Update(ctx context.Context, req *schema.UserUpdateReq, modifiedBy string) error

Jump to

Keyboard shortcuts

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