123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package logic
- import (
- "app.yhyue.com/moapp/jybase/common"
- "context"
- "jyBXBase/rpc/bxcollection/bxcol"
- "jyBXBase/api/internal/svc"
- "jyBXBase/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type AddLabelLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewAddLabelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddLabelLogic {
- return &AddLabelLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *AddLabelLogic) AddLabel(req *types.AddLabel) (resp *types.CommonRes, err error) {
- res, err0 := l.svcCtx.Bxcollection.Addlabel(l.ctx, &bxcol.AddlabelReq{
- UserId: req.UserId,
- Name: req.Name,
- })
- if err0 != nil {
- return &types.CommonRes{
- Err_code: -1,
- Err_msg: "错误",
- Data: nil,
- }, nil
- }
- return &types.CommonRes{
- Err_code: common.IntAll(res.ErrCode),
- Err_msg: res.ErrMsg,
- Data: res.Labid,
- }, nil
- }
|