package logic import ( "context" "app.yhyue.com/moapp/jybase/common" "bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/service" "github.com/gogf/gf/v2/util/gconv" "bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/svc" "bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type UpdateInitInfoLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewUpdateInitInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateInitInfoLogic { return &UpdateInitInfoLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *UpdateInitInfoLogic) UpdateInitInfo(req *types.UpdateInitInfoReq) (resp *types.Reply, err error) { // todo: add your logic here and delete this line resp = &types.Reply{} initInfoService := &service.InitInfoService{ PositionType: req.PositionType, MgoUserId: req.MgoUserId, EntId: req.EntId, PositionId: req.PositionId, EntUserId: req.EntUserId, } fool := initInfoService.UpdateInitInfo(req.Company, req.Business) if fool { (&service.InitNetwork{ PositionId: req.PositionId, EntId: req.EntId, DeptId: req.EntDeptId, UserId: req.NewUserId, EntName: req.EntName, BusinessType: req.Business, }).Init() } resp.Data = map[string]interface{}{ "status": gconv.Int64(common.If(fool, 1, 0)), } if fool { resp.Error_msg = "修改成功" } else { resp.Error_msg = "修改失败" } return }