1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package logic
- import (
- "context"
- "GtDataStore/app/cmd/organization/internal/svc"
- "GtDataStore/app/cmd/organization/pb"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type DisableAppInfoLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewDisableAppInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DisableAppInfoLogic {
- return &DisableAppInfoLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- func (l *DisableAppInfoLogic) DisableAppInfo(in *pb.DisableAppInfoReq) (*pb.DisableAppInfoResp, error) {
- appInfo, err := l.svcCtx.AppInfo.FindOneByAppName(l.ctx, in.AppName)
- if err != nil {
- return nil, err
- }
- if appInfo.Status != 1 {
- appInfo.Status = 1
- err = l.svcCtx.AppInfo.Update(l.ctx, appInfo)
- if err != nil {
- return nil, err
- }
- }
- return &pb.DisableAppInfoResp{Ok: true}, nil
- }
|