corp

package
v0.0.0-...-9b6a88f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SUPER_PASSWORD = ""

Functions

func EncryptPassword

func EncryptPassword(password string) string

Types

type Corp

type Corp struct {
	eel.EntityBase
	Id         int
	Code       string
	Name       string
	Remark     string
	IsActive   bool
	IsPlatform bool
	CreatedAt  time.Time

	CorpUser *CorpUser
}

func GetCorpFromContext

func GetCorpFromContext(ctx context.Context) *Corp

func NewCorpFromId

func NewCorpFromId(ctx context.Context, id int) *Corp

func NewCorpFromModel

func NewCorpFromModel(ctx context.Context, model *m_corp.Corp) *Corp

func (*Corp) AddCorpUser

func (this *Corp) AddCorpUser(username string, password string, realname string, groupNames []string, isManager bool) error

AddCorpUser 为corp创建登录账号

func (*Corp) Delete

func (this *Corp) Delete() error

func (*Corp) Fill

func (this *Corp) Fill()

func (*Corp) FillWithModel

func (this *Corp) FillWithModel(model *m_corp.Corp)

func (*Corp) GetId

func (this *Corp) GetId() int

func (*Corp) GetUnionid

func (this *Corp) GetUnionid() string

type CorpFactory

type CorpFactory struct {
	eel.ServiceBase
}

func NewCorpFactory

func NewCorpFactory(ctx context.Context) *CorpFactory

func (*CorpFactory) CreateCorp

func (this *CorpFactory) CreateCorp(name string) (*Corp, error)

func (*CorpFactory) CreatePlatformCorp

func (this *CorpFactory) CreatePlatformCorp(name string) (*Corp, error)

type CorpRepository

type CorpRepository struct {
	eel.RepositoryBase
}

func NewCorpRepository

func NewCorpRepository(ctx context.Context) *CorpRepository

func (*CorpRepository) GetCorpById

func (this *CorpRepository) GetCorpById(id int) *Corp

func (*CorpRepository) GetCorpByName

func (this *CorpRepository) GetCorpByName(name string) *Corp

func (*CorpRepository) GetCorps

func (this *CorpRepository) GetCorps(filters eel.Map) []*Corp

func (*CorpRepository) GetCorpsByIds

func (this *CorpRepository) GetCorpsByIds(ids []int) []*Corp

func (*CorpRepository) GetPagedCorps

func (this *CorpRepository) GetPagedCorps(filters eel.Map, page *eel.PageInfo) ([]*Corp, eel.INextPageInfo)

type CorpUser

type CorpUser struct {
	eel.EntityBase
	Id        int
	CorpId    int
	IsActive  bool
	IsManager bool
	Username  string
	RealName  string
	CreatedAt time.Time

	Groups []*auth.Group
	Corp   *Corp
}

func NewCorpUserFromId

func NewCorpUserFromId(ctx context.Context, corpUserId int) *CorpUser

func NewCorpUserFromModel

func NewCorpUserFromModel(ctx context.Context, model *m_corp.CorpUser) *CorpUser

func (*CorpUser) GetJWTToken

func (this *CorpUser) GetJWTToken() string

func (*CorpUser) GetJWTTokenData

func (this *CorpUser) GetJWTTokenData() eel.Map

func (*CorpUser) ResetPassword

func (this *CorpUser) ResetPassword() (string, error)

func (*CorpUser) Update

func (this *CorpUser) Update(realname string, groupNames []string)

type CorpUserRepository

type CorpUserRepository struct {
	eel.RepositoryBase
}

func NewCorpUserRepository

func NewCorpUserRepository(ctx context.Context) *CorpUserRepository

func (*CorpUserRepository) GetCorpUserById

func (this *CorpUserRepository) GetCorpUserById(id int) *CorpUser

func (*CorpUserRepository) GetCorpUserInCorp

func (this *CorpUserRepository) GetCorpUserInCorp(id int, corp business.ICorp) *CorpUser

func (*CorpUserRepository) GetCorpUsers

func (this *CorpUserRepository) GetCorpUsers(filters eel.Map) []*CorpUser

func (*CorpUserRepository) GetCorpUsersByIds

func (this *CorpUserRepository) GetCorpUsersByIds(ids []int) []*CorpUser

func (*CorpUserRepository) GetPagedCorpUsers

func (this *CorpUserRepository) GetPagedCorpUsers(filters eel.Map, page *eel.PageInfo) ([]*CorpUser, eel.INextPageInfo)

type CorpUserService

type CorpUserService struct {
	eel.ServiceBase
}

func NewCorpUserService

func NewCorpUserService(ctx context.Context) *CorpUserService

func (*CorpUserService) Auth

func (this *CorpUserService) Auth(username string, password string) (*CorpUser, error)

type EncodeCorpService

type EncodeCorpService struct {
	eel.ServiceBase
}

func NewEncodeCorpService

func NewEncodeCorpService(ctx context.Context) *EncodeCorpService

func (*EncodeCorpService) Encode

func (this *EncodeCorpService) Encode(corp *Corp) *RCorp

func (*EncodeCorpService) EncodeMany

func (this *EncodeCorpService) EncodeMany(corps []*Corp) []*RCorp

type EncodeCorpUserService

type EncodeCorpUserService struct {
	eel.ServiceBase
}

func NewEncodeCorpUserService

func NewEncodeCorpUserService(ctx context.Context) *EncodeCorpUserService

func (*EncodeCorpUserService) Encode

func (this *EncodeCorpUserService) Encode(corpUser *CorpUser) *RCorpUser

func (*EncodeCorpUserService) EncodeMany

func (this *EncodeCorpUserService) EncodeMany(corpUsers []*CorpUser) []*RCorpUser

type FillCorpService

type FillCorpService struct {
	eel.ServiceBase
}

func NewFillCorpService

func NewFillCorpService(ctx context.Context) *FillCorpService

func (*FillCorpService) Fill

func (this *FillCorpService) Fill(corps []*Corp, option eel.FillOption)

func (*FillCorpService) FillOne

func (this *FillCorpService) FillOne(corp *Corp, option eel.FillOption)

type FillCorpUserService

type FillCorpUserService struct {
	eel.ServiceBase
}

func NewFillCorpUserService

func NewFillCorpUserService(ctx context.Context) *FillCorpUserService

func (*FillCorpUserService) Fill

func (this *FillCorpUserService) Fill(users []*CorpUser, option eel.FillOption)

func (*FillCorpUserService) FillOne

func (this *FillCorpUserService) FillOne(user *CorpUser, option eel.FillOption)

type RCorp

type RCorp struct {
	Id         int        `json:"id"`
	Code       string     `json:"code"`
	Name       string     `json:"name"`
	Remark     string     `json:"remark"`
	IsPlatform bool       `json:"is_platform"`
	CorpUser   *RCorpUser `json:"corp_user"`
	CreatedAt  string     `json:"created_at"`
}

type RCorpUser

type RCorpUser struct {
	Id          int                 `json:"id"`
	CorpId      int                 `json:"corp_id"`
	CorpName    string              `json:"corp_name"`
	Name        string              `json:"name"`
	RealName    string              `json:"real_name"`
	IsActive    bool                `json:"is_active"`
	IsManager   bool                `json:"is_manager"`
	Groups      []*auth.RGroup      `json:"groups"`
	Permissions []*auth.RPermission `json:"permissions"`
}

Jump to

Keyboard shortcuts

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