54 lines
1.2 KiB
Go
54 lines
1.2 KiB
Go
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
|
//go:build plus
|
|
|
|
package ticket
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/userconfigs"
|
|
"github.com/iwind/TeaGo/actions"
|
|
)
|
|
|
|
type CreateLogPopupAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *CreateLogPopupAction) Init() {
|
|
this.Nav("", "", "")
|
|
}
|
|
|
|
func (this *CreateLogPopupAction) RunGet(params struct {
|
|
TicketId int64
|
|
}) {
|
|
this.Data["ticketId"] = params.TicketId
|
|
|
|
this.Data["statusList"] = userconfigs.FindAllUserTicketStatusList()
|
|
|
|
this.Show()
|
|
}
|
|
|
|
func (this *CreateLogPopupAction) RunPost(params struct {
|
|
TicketId int64
|
|
Comment string
|
|
Status string
|
|
|
|
Must *actions.Must
|
|
CSRF *actionutils.CSRF
|
|
}) {
|
|
defer this.CreateLogInfo(codes.UserTicketLog_LogReplyTicket, params.TicketId)
|
|
|
|
_, err := this.RPC().UserTicketLogRPC().CreateUserTicketLog(this.AdminContext(), &pb.CreateUserTicketLogRequest{
|
|
UserTicketId: params.TicketId,
|
|
Status: params.Status,
|
|
Comment: params.Comment,
|
|
})
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
this.Success()
|
|
}
|