unclaimedlogic.go 997 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
  4. "context"
  5. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/internal/svc"
  6. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type UnClaimedLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewUnClaimedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UnClaimedLogic {
  15. return &UnClaimedLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // UnClaimed 取消认领(经销商/医疗机构)
  22. func (l *UnClaimedLogic) UnClaimed(in *medical.UnclaimedReq) (*medical.CommonResp, error) {
  23. rs := l.svcCtx.EntClaimSrv.Unclaimed(int(in.Id), int(in.UserId))
  24. if !rs {
  25. return &medical.CommonResp{
  26. ErrorMsg: "操作失败",
  27. ErrorCode: entity.ERRORCODE,
  28. }, nil
  29. }
  30. return &medical.CommonResp{
  31. ErrorMsg: "",
  32. ErrorCode: entity.SUCCESSCODE,
  33. }, nil
  34. }