useuserdetailedlogic.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
  4. "context"
  5. "app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
  6. "app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenter"
  7. "github.com/tal-tech/go-zero/core/logx"
  8. )
  9. type UseUserDetailedLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewUseUserDetailedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UseUserDetailedLogic {
  15. return &UseUserDetailedLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 根据账户标识使用资源
  22. func (l *UseUserDetailedLogic) UseUserDetailed(in *resourcesCenter.Resources) (*resourcesCenter.Response, error) {
  23. // todo: add your logic here and delete this line
  24. balance := &resourcesCenter.Balance{
  25. AccountId: in.AccountId,
  26. CompanyId: in.CompanyId,
  27. DepartmentId: in.DepartmentId,
  28. Name: in.Name,
  29. ResourceType: in.ResourceType,
  30. Number: in.Number,
  31. Spec: in.Spec,
  32. AppId: in.AppId,
  33. Model: in.Model,
  34. EndTime: in.EndTime,
  35. }
  36. detailed := &resourcesCenter.Detailed{
  37. AccountId: in.AccountId,
  38. CompanyId: in.CompanyId,
  39. ResourceType: in.AccountId,
  40. ExportNum: in.Number,
  41. DepartmentId: in.DepartmentId,
  42. Name: in.Name,
  43. UserId: in.UserId,
  44. UserType: in.Model,
  45. Url: in.Url,
  46. SearchCriteria: in.SearchCriteria,
  47. Source: in.Source,
  48. RuleId: in.RuleId,
  49. }
  50. code, msg := balanceService.UseUserDetailed(in.DuplicateRemoval, balance, detailed, in.InfoId, config.ConfigJson.DedupUrl)
  51. return &resourcesCenter.Response{
  52. Code: code,
  53. Message: msg,
  54. }, nil
  55. }