service

package
v0.0.0-...-621c15c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	USER_DISPATCH_QUEUE_KEY = "openkf:user_dispatch_queue"
	USER_SLACK_MAP_KEY      = "openkf:user_slack_map"
)

user dispatch queue key.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotService

type BotService struct {
	Service

	SysBotDao       *dao.SysBotDao
	SysCommunityDao *dao.SysCommunityDao
}

BotService bot service.

func NewBotService

func NewBotService(c *gin.Context) *BotService

NewBotService return new service with gin context.

func (*BotService) CreateBot

func (svc *BotService) CreateBot(cid string, params *requestparams.CreateBotParams) (string, uint, error)

CreateBot create bot.

func (*BotService) DeleteBot

func (svc *BotService) DeleteBot(uid string) error

DeleteBot delete a bot.

func (*BotService) GetCommunityBotList

func (svc *BotService) GetCommunityBotList(cid string, params *requestparams.ListPageParams) (*responseparams.ListPageResponse, error)

GetCommunityBotList get community bot list.

func (*BotService) UpdateBotInfo

UpdateBotInfo update bot info.

type CommonService

type CommonService struct {
	Service
}

CommonService community service.

func NewCommonService

func NewCommonService(c *gin.Context) *CommonService

NewCommonService return new service with gin context.

func (*CommonService) UploadFile

func (svc *CommonService) UploadFile(file *multipart.FileHeader) (string, error)

UploadFile upload file.

type CommunityService

type CommunityService struct {
	Service

	SysCommunityDao *dao.SysCommunityDao
}

CommunityService community service.

func NewCommunityService

func NewCommunityService(c *gin.Context) *CommunityService

NewCommunityService return new service with gin context.

func (*CommunityService) Create

func (svc *CommunityService) Create(community *requestparams.CommunityParams) (string, uint, error)

Create create community.

func (*CommunityService) GetCommunityInfoById

func (svc *CommunityService) GetCommunityInfoById(id uint) (*responseparams.CommunityInfoResponse, error)

GetCommunityInfoById get community info by id.

func (*CommunityService) GetCommunityInfoByUUID

func (svc *CommunityService) GetCommunityInfoByUUID(uid string) (*responseparams.CommunityInfoResponse, error)

GetCommunityInfoByUUID get community info by uuid.

func (*CommunityService) GetCommunityInfoByUUIDV2

func (svc *CommunityService) GetCommunityInfoByUUIDV2(uid string) (*systemroles.SysCommunity, error)

GetCommunityInfoByUUIDV2 get community info by uuid and return SysCommunity.

func (*CommunityService) UpdateCommunity

UpdateCommunity update community info.

type IMCallbackService

type IMCallbackService struct {
	Service

	UserStatisticDao *dao.UserStatisticDao
}

IMCallbackService openim callback service.

func NewIMCallbackService

func NewIMCallbackService(c *gin.Context) *IMCallbackService

NewIMCallbackService return new service with gin context.

func (*IMCallbackService) AfterSendSingleMsgCallback

func (svc *IMCallbackService) AfterSendSingleMsgCallback(uid string, msg string) error

AfterSendSingleMsgCallback after send msg callback.

func (*IMCallbackService) UserOfflineCallback

func (svc *IMCallbackService) UserOfflineCallback(uid string) error

UserOfflineCallback user offline callback.

func (*IMCallbackService) UserOnlineCallback

func (svc *IMCallbackService) UserOnlineCallback(uid string) error

UserOnlineCallback user online callback.

type MailService

type MailService struct {
	Service
	// contains filtered or unexported fields
}

MailService mail service.

func NewMailService

func NewMailService(c *gin.Context) *MailService

NewMailService return new service with gin context.

func (*MailService) CheckCode

func (svc *MailService) CheckCode(email, code string) bool

CheckCode check code.

func (*MailService) SendCode

func (svc *MailService) SendCode(email string) (err error)

SendCode send code to email.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service service.

func (*Service) GetCtx

func (svc *Service) GetCtx() context.Context

GetCtx get context.

type SlackService

type SlackService struct {
	Service

	CustomerSlackDao *dao.CustomerSlackDao
}

SlackService slack service.

func NewSlackService

func NewSlackService(ctx context.Context) *SlackService

NewSlackService return new service with Background context.

func (*SlackService) CreateCustomer

func (svc *SlackService) CreateCustomer(userId string, profile *slack.UserProfile) (string, uint, error)

CreateCustomer create customer if not exists.

func (*SlackService) GetSlackConfig

func (svc *SlackService) GetSlackConfig() (*responseparams.SlackConfigResponse, error)

GetSlackConfig get slack config.

func (*SlackService) GetSlackUser

func (svc *SlackService) GetSlackUser(userId string) (*customerroles.CustomerSlack, error)

GetSlackUser get slack user.

func (*SlackService) SendMsg

func (svc *SlackService) SendMsg(uid, question string, botContext slacker.BotContext) error

SendMsg send message to openkf.

type UserDispatchService

type UserDispatchService struct {
	Service

	UserDispatchDao *dao.UserDispatchDao
	SysUserDao      *dao.SysUserDao
}

UserDispatchService user service.

func NewUserDispatchService

func NewUserDispatchService(c context.Context) *UserDispatchService

NewUserDispatchService return new service with context.

func (*UserDispatchService) AddUser

func (s *UserDispatchService) AddUser(uuid string) error

AddUser add user to enqueue.

func (*UserDispatchService) DeleteUser

func (s *UserDispatchService) DeleteUser(uuid string) error

DeleteUser delete user from queue.

func (*UserDispatchService) GetSlackIDs

func (s *UserDispatchService) GetSlackIDs() ([]string, error)

GetSlackIDs get all staff id.

func (*UserDispatchService) GetSlackMap

func (s *UserDispatchService) GetSlackMap(customID string) *dao.SlackMap

GetSlackMap get slack map.

func (*UserDispatchService) GetUser

func (s *UserDispatchService) GetUser() (string, error)

GetUser get user and update timestamp.

func (*UserDispatchService) SetSlackMap

func (s *UserDispatchService) SetSlackMap(customID, staffID string, botContext slacker.BotContext) error

SetSlackMap set slack map.

func (*UserDispatchService) SlackUserFilter

func (s *UserDispatchService) SlackUserFilter(uid string) bool

SlackUserFilter filter user by slack id.

type UserService

type UserService struct {
	Service

	SysUserDao      *dao.SysUserDao
	SysCommunityDao *dao.SysCommunityDao
}

UserService user service.

func NewUserService

func NewUserService(c *gin.Context) *UserService

NewUserService return new service with gin context.

func (*UserService) CreateAdmin

func (svc *UserService) CreateAdmin(user *requestparams.RegisterAdminParams) (string, uint, error)

CreateAdmin create admin user.

func (*UserService) CreateStaff

func (svc *UserService) CreateStaff(cid string, user *requestparams.RegisterStaffParams) (string, uint, error)

CreateStaff create staff user.

func (*UserService) DeleteStaff

func (svc *UserService) DeleteStaff(uid string) error

DeleteStaff delete staff user.

func (*UserService) GetAdminToken

func (svc *UserService) GetAdminToken() (*response.TokenData, error)

GetAdminToken get admin token.

func (*UserService) GetCommunityUserList

func (svc *UserService) GetCommunityUserList(cid string, params *requestparams.ListPageParams) (*responseparams.ListPageResponse, error)

GetCommunityUserList get community user list.

func (*UserService) GetUserInfoByUUID

func (svc *UserService) GetUserInfoByUUID(uid string) (*responseparams.UserInfoResponse, error)

GetUserInfoByUUID get user info by uuid.

func (*UserService) LoginWithAccount

LoginWithAccount login with account.

func (*UserService) UpdateUserInfo

UpdateUserInfo update user info.

func (*UserService) UpdateUserPassword

func (svc *UserService) UpdateUserPassword(uid string, params *requestparams.UpdateUserPasswordParams) error

UpdateUserPassword update user password.

type UserStatistic

type UserStatistic struct {
	Service

	UserStatisticDao *dao.UserStatisticDao
}

UserStatistic user statistics service.

func NewUserStatisticService

func NewUserStatisticService(c context.Context) *UserStatistic

NewUserStatisticService return new service with context.

func (*UserStatistic) ReadUserOnlineTimePerDay

func (svc *UserStatistic) ReadUserOnlineTimePerDay(uid string, startTime, endTime int64) ([]*responseparams.UserStatisticItem, error)

ReadUserOnlineTimePerDay read user online time per day.

func (*UserStatistic) ReadUserSendMsgCountPerDay

func (svc *UserStatistic) ReadUserSendMsgCountPerDay(uid string, startTime, endTime int64) ([]*responseparams.UserStatisticItem, error)

ReadUserSendMsgCountPerDay read user send message count per day.

func (*UserStatistic) ReadUserSendMsgLenPerDay

func (svc *UserStatistic) ReadUserSendMsgLenPerDay(uid string, startTime, endTime int64) ([]*responseparams.UserStatisticItem, error)

ReadUserSendMsgLenPerDay read user send message length per day.

Jump to

Keyboard shortcuts

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