12345678910111213141516171819202122232425262728293031323334353637383940 |
- package logic
- import (
- "context"
- "errors"
- "strings"
- "app.yhyue.com/moapp/jyfs/rpc/internal/redis"
- "app.yhyue.com/moapp/jyfs/rpc/filesystem"
- "app.yhyue.com/moapp/jyfs/rpc/internal/svc"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type UpdateDomainMetaLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewUpdateDomainMetaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateDomainMetaLogic {
- return &UpdateDomainMetaLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 更新域
- func (l *UpdateDomainMetaLogic) UpdateDomainMeta(in *filesystem.DomainReq) (*filesystem.DomainResp, error) {
- // todo: add your logic here and delete this line
- meta := redis.GetStr("jyfs", "jyfs_"+in.Name)
- if meta != "" {
- redis.Put("jyfs", "jyfs_"+in.Name, strings.Join(in.MetaFields, ","), -1)
- } else {
- return &filesystem.DomainResp{State: false}, errors.New("域元信息为空")
- }
- return &filesystem.DomainResp{State: true}, nil
- }
|