package logic import ( "context" "fmt" "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/entity" "bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/internal/svc" "bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb" "github.com/zeromicro/go-zero/core/logx" ) type FunctionDefineAddLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewFunctionDefineAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FunctionDefineAddLogic { return &FunctionDefineAddLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 新增商品功能定义、功能定义明细表 func (l *FunctionDefineAddLogic) FunctionDefineAdd(in *pb.FunctionDefineReq) (*pb.StatusResp, error) { // todo: add your logic here and delete this line resp := &pb.StatusResp{} funtion_define := &entity.Base_goods_function_define_struct{ Goods_code: in.GoodsCode, Name: in.Name, Appid: in.Appid, Function_code_arr: in.FunctionCodeArr, } status, err := funtion_define.Add() if err != nil { l.Error(fmt.Sprintf("%+v", in), err.Error()) resp.ErrorMsg = err.Error() resp.ErrorCode = -1 } resp.Status = status return resp, nil }