subscribe

package
v1.3.4-beta Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ApplyStatusRefuse 拒绝
	ApplyStatusRefuse = iota
	// ApplyStatusReview 审核中
	ApplyStatusReview
	// ApplyStatusSubscribe 已订阅
	ApplyStatusSubscribe
	// ApplyStatusUnsubscribe 已退订
	ApplyStatusUnsubscribe
	// ApplyStatusCancel 取消申请
	ApplyStatusCancel
)
View Source
const (
	// FromUser 用户添加
	FromUser = iota
	// FromSubscribe 订阅
	FromSubscribe
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Apply

type Apply struct {
	Id          string
	Service     string
	Team        string
	Application string
	ApplyTeam   string
	Applier     string
	ApplyAt     time.Time
	Approver    string
	ApproveAt   time.Time
	Status      int
	Opinion     string
	Reason      string
}

func FromApplyEntity

func FromApplyEntity(e *subscribe.Apply) *Apply

type CreateApply

type CreateApply struct {
	Uuid        string
	Service     string
	Team        string
	Application string
	ApplyTeam   string
	Reason      string
	Status      int
	Applier     string
}

type CreateSubscribe

type CreateSubscribe struct {
	Uuid        string
	Service     string
	Applier     string
	Application string
	ApplyStatus int
	From        int
}

type EditApply

type EditApply struct {
	Opinion  *string
	Status   *int
	Applier  *string
	Approver *string
}

type ISubscribeApplyService

type ISubscribeApplyService interface {
	universally.IServiceGet[Apply]
	universally.IServiceDelete
	universally.IServiceCreate[CreateApply]
	universally.IServiceEdit[EditApply]
	GetApply(ctx context.Context, serviceId string, appId string) (*Apply, error)
	ListByStatus(ctx context.Context, pid string, status ...int) ([]*Apply, error)
	Revoke(ctx context.Context, service string, application string) error
	RevokeById(ctx context.Context, id string) error
}

type ISubscribeService

type ISubscribeService interface {
	universally.IServiceGet[Subscribe]
	universally.IServiceDelete
	universally.IServiceCreate[CreateSubscribe]
	universally.IServiceEdit[UpdateSubscribe]
	CountMapByService(ctx context.Context, status int, service ...string) (map[string]int64, error)
	DeleteByApplication(ctx context.Context, service string, application string) error
	ListByApplication(ctx context.Context, service string, application ...string) ([]*Subscribe, error)
	ListByServices(ctx context.Context, serviceIds ...string) ([]*Subscribe, error)
	GetByServiceAndApplication(ctx context.Context, serviceId string, applicationId string) (*Subscribe, error)

	MySubscribeServices(ctx context.Context, application string, serviceIDs []string) ([]*Subscribe, error)
	UpdateSubscribeStatus(ctx context.Context, application string, service string, status int) error
	ListBySubscribeStatus(ctx context.Context, projectId string, status int) ([]*Subscribe, error)
	SubscribersByProject(ctx context.Context, projectIds ...string) ([]*Subscribe, error)
	Subscribers(ctx context.Context, project string, status int) ([]*Subscribe, error)
	SubscriptionsByApplication(ctx context.Context, applicationIds ...string) ([]*Subscribe, error)
}

type Subscribe

type Subscribe struct {
	Id      string
	Service string

	// 订阅方相关
	Application string
	From        int
	Applier     string
	ApplyStatus int
	CreateAt    time.Time
}

func FromEntity

func FromEntity(e *subscribe.Subscribe) *Subscribe

type UpdateSubscribe

type UpdateSubscribe struct {
	ApplyStatus *int
}

Jump to

Keyboard shortcuts

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