unclaimedlogic.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package public
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "app.yhyue.com/moapp/jybase/encrypt"
  5. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
  6. "context"
  7. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/svc"
  8. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/types"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type UnclaimedLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewUnclaimedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UnclaimedLogic {
  17. return &UnclaimedLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. // Unclaimed 取消认领
  24. func (l *UnclaimedLogic) Unclaimed(req *types.UnclaimedReq) (resp *types.CommonRes, err error) {
  25. rs, _ := l.svcCtx.Medical.UnClaimed(l.ctx, &medical.UnclaimedReq{
  26. UserId: int64(req.UserId),
  27. Id: common.Int64All(encrypt.SE.Decode4Hex(req.Id)),
  28. })
  29. return &types.CommonRes{
  30. Error_msg: rs.ErrorMsg,
  31. Error_code: int(rs.ErrorCode),
  32. }, nil
  33. }