init: 1.0.0
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package console
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/perfect-panel/ppanel-server/internal/svc"
|
||||
"github.com/perfect-panel/ppanel-server/internal/types"
|
||||
"github.com/perfect-panel/ppanel-server/pkg/logger"
|
||||
)
|
||||
|
||||
type QueryTicketWaitReplyLogic struct {
|
||||
logger.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
// NewQueryTicketWaitReplyLogic Query ticket wait reply
|
||||
func NewQueryTicketWaitReplyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueryTicketWaitReplyLogic {
|
||||
return &QueryTicketWaitReplyLogic{
|
||||
Logger: logger.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *QueryTicketWaitReplyLogic) QueryTicketWaitReply() (resp *types.TicketWaitRelpyResponse, err error) {
|
||||
count, err := l.svcCtx.TicketModel.QueryWaitReplyTotal(l.ctx)
|
||||
if err != nil {
|
||||
l.Errorw("[QueryTicketWaitReply] Query Database Error: ", logger.Field("error", err.Error()))
|
||||
return nil, err
|
||||
}
|
||||
return &types.TicketWaitRelpyResponse{
|
||||
Count: count,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user