package logic import ( "context" "git.i2edu.net/i2/i2-bill-erp/internal/svc" "git.i2edu.net/i2/i2-bill-erp/model" "git.i2edu.net/i2/i2-bill-erp/transform" "git.i2edu.net/i2/go-zero/core/logx" ) type GetStudentLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewGetStudentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStudentLogic { return &GetStudentLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } func (l *GetStudentLogic) GetStudent(in *transform.StudentReq) (*transform.StudentRes, error) { mkt := model.MktResource{} err := l.svcCtx.SqlConn.QueryRowPartial(&mkt, "select id, stu_phone from mkt_resource where id=?", in.Id) if err != nil { logx.Error(err.Error()) return nil, err } return &transform.StudentRes{StuPhone: mkt.StuPhone.String}, nil }