delcheckredislogic.go 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/entity"
  5. "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
  7. "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/service"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type DelCheckRedisLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewDelCheckRedisLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelCheckRedisLogic {
  16. return &DelCheckRedisLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 清除权限缓存
  23. func (l *DelCheckRedisLogic) DelCheckRedis(in *pb.CheckReq) (*pb.PowerCheckResp, error) {
  24. resp := &pb.PowerCheckResp{}
  25. power := service.NewPower(&entity.Conn{
  26. Mysql: entity.Mysql,
  27. BaseMysql: entity.BaseMysql,
  28. MgoJy: entity.MgoJy,
  29. })
  30. if power.DelRedisPower(in.PositionId) {
  31. resp.Status = 1
  32. } else {
  33. resp.Status = -1
  34. }
  35. return resp, nil
  36. }