1234567891011121314151617181920212223242526272829303132333435 |
- package logic
- import (
- "context"
- "GtDataStore/app/cmd/organization/internal/svc"
- "GtDataStore/app/cmd/organization/pb"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type RemoveAppInfoLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewRemoveAppInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveAppInfoLogic {
- return &RemoveAppInfoLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- func (l *RemoveAppInfoLogic) RemoveAppInfo(in *pb.RemoveAppInfoReq) (*pb.RemoveAppInfoResp, error) {
- appInfo, err := l.svcCtx.AppInfo.FindOneByAppName(l.ctx, in.AppName)
- if err != nil {
- return nil, err
- }
- err = l.svcCtx.AppInfo.Delete(l.ctx, appInfo.Id)
- return &pb.RemoveAppInfoResp{Ok: err == nil}, nil
- }
|