35 lines
751 B
Go
35 lines
751 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
"lone-services/pkg/utils"
|
|
"lone-services/rpc/express/pb"
|
|
"lone-services/services/express/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type ApiPrintProductLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
BaseLogic
|
|
}
|
|
|
|
func NewApiPrintProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ApiPrintProductLogic {
|
|
return &ApiPrintProductLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
func (l *ApiPrintProductLogic) ApiPrintProduct(in *express.EmtpyRequest) (*express.Response, error) {
|
|
adminInfo := utils.GetUserFromCtx(l.ctx)
|
|
if adminInfo.ID < utils.NumberOne {
|
|
return l.fail(utils.ErrorNoLoginInfo)
|
|
}
|
|
|
|
return l.ok(nil)
|
|
}
|