findbalancelogic.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package logic
  2. import (
  3. "context"
  4. "log"
  5. "app.yhyue.com/moapp/jyResourcesCenter/api/internal/svc"
  6. "app.yhyue.com/moapp/jyResourcesCenter/api/internal/types"
  7. "github.com/tal-tech/go-zero/core/logx"
  8. )
  9. type FindBalanceLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewFindBalanceLogic(ctx context.Context, svcCtx *svc.ServiceContext) FindBalanceLogic {
  15. return FindBalanceLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *FindBalanceLogic) FindBalance(req types.BalanceReq) (*types.BalanceRes, error) {
  22. // todo: add your logic here and delete this line
  23. log.Println(req)
  24. result := &types.BalanceRes{}
  25. result.Code = 1
  26. result.Message = "请求成功"
  27. data := []map[string]interface{}{
  28. {
  29. "id": 1,
  30. "name": "高级字段包",
  31. "number": 30000,
  32. "thirtyNum": 100,
  33. "resourceType":"001",
  34. },
  35. {
  36. "id": 1,
  37. "name": "标准字段包",
  38. "number": 30000,
  39. "thirtyNum": 300,
  40. "resourceType":"002",
  41. },
  42. }
  43. result.Data = data
  44. return result, nil
  45. }