You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
496 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package users
import (
"github.com/gin-gonic/gin"
"goskeleton/app/global/consts"
"goskeleton/app/global/variable"
)
// 模拟Aop 实现对某个控制器函数的前置和后置回调
type DestroyAfter struct{}
func (d *DestroyAfter) After(context *gin.Context) {
// 后置函数可以使用异步执行
go func() {
userId := context.GetFloat64(consts.ValidatorPrefix + "id")
variable.ZapLog.Sugar().Infof("模拟 Users 删除操作, After 回调,用户ID%.f\n", userId)
}()
}