fund.go 502 B

12345678910111213141516171819202122232425262728
  1. package service
  2. import (
  3. "context"
  4. "gof_ppw_api/internal/dao"
  5. )
  6. var Fund = new(FundService)
  7. type FundService struct {
  8. Service
  9. }
  10. // List 基金列表
  11. func (p *FundService) List() {
  12. }
  13. // Detail 特定基金详情
  14. func (p *FundService) Detail(ctx context.Context, fundId string) (m interface{}, err error) {
  15. one, err := dao.FundInformation.Ctx(ctx).
  16. Where("fund_id", fundId).
  17. Fields("fund_id,fund_name,fund_short_name").
  18. One()
  19. if err != nil {
  20. return nil, err
  21. }
  22. return one.Map(), nil
  23. }