mirror of
https://github.com/PengZhangs2017582/novel.git
synced 2025-06-22 10:11:30 +08:00
redis token
This commit is contained in:
31
internal/controller/backend/writer.go
Normal file
31
internal/controller/backend/writer.go
Normal file
@ -0,0 +1,31 @@
|
||||
// Package backend -----------------------------
|
||||
// @file : writer.go
|
||||
// @author : Allen zhang
|
||||
// @contact : 364438619@qq.com
|
||||
// @time : 2024/1/15 15:15
|
||||
// -------------------------------------------
|
||||
package backend
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
"novel/api/backend"
|
||||
"novel/internal/consts"
|
||||
)
|
||||
|
||||
// Writer 内容管理
|
||||
var Writer = cWriter{}
|
||||
|
||||
type cWriter struct{}
|
||||
|
||||
// gtoken 版本返回结果
|
||||
func (c *cWriter) Info(ctx context.Context, req *backend.WriterGetInfoReq) (res *backend.WriterGetInfoRes, err error) {
|
||||
return &backend.WriterGetInfoRes{
|
||||
Id: gconv.Int(ctx.Value(consts.CtxWriterId)),
|
||||
PenName: gconv.String(ctx.Value(consts.CtxWriterName)),
|
||||
IsAdmin: gconv.Int(ctx.Value(consts.CtxWriterIsAdmin)),
|
||||
RoleIds: gconv.String(ctx.Value(consts.CtxWriterRoleIds)),
|
||||
}, err
|
||||
}
|
Reference in New Issue
Block a user