task.go 383 B

12345678910111213141516171819
  1. package db
  2. import (
  3. "context"
  4. "fmt"
  5. "youngee_b_api/model/gorm_model"
  6. )
  7. func GetTaskList(ctx context.Context, projectID int64) ([]gorm_model.YoungeeTaskInfo, error) {
  8. db := GetReadDB(ctx)
  9. tasks := []gorm_model.YoungeeTaskInfo{}
  10. err := db.Where("project_id=?", projectID).Find(&tasks).Error
  11. if err != nil {
  12. return nil, err
  13. }
  14. fmt.Printf("%+v", tasks)
  15. return tasks, nil
  16. }