mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 16:50:26 +08:00
29 lines
648 B
Go
29 lines
648 B
Go
package accesskeys
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
)
|
|
|
|
type UpdateIsOnAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *UpdateIsOnAction) RunPost(params struct {
|
|
AccessKeyId int64
|
|
IsOn bool
|
|
}) {
|
|
defer this.CreateLogInfo("设置AccessKey %d 启用状态", params.AccessKeyId)
|
|
|
|
_, err := this.RPC().UserAccessKeyRPC().UpdateUserAccessKeyIsOn(this.AdminContext(), &pb.UpdateUserAccessKeyIsOnRequest{
|
|
UserAccessKeyId: params.AccessKeyId,
|
|
IsOn: params.IsOn,
|
|
})
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
this.Success()
|
|
}
|