| 1 | package edu.ucsb.cs156.frontiers.models; | |
| 2 | ||
| 3 | import com.opencsv.bean.CsvBindByName; | |
| 4 | import edu.ucsb.cs156.frontiers.entities.CourseStaff; | |
| 5 | import edu.ucsb.cs156.frontiers.enums.OrgStatus; | |
| 6 | import lombok.AllArgsConstructor; | |
| 7 | import lombok.Data; | |
| 8 | import lombok.NoArgsConstructor; | |
| 9 | ||
| 10 | /** CSV export DTO for course staff downloads. */ | |
| 11 | @Data | |
| 12 | @AllArgsConstructor | |
| 13 | @NoArgsConstructor | |
| 14 | public class CourseStaffDTO { | |
| 15 | ||
| 16 | @CsvBindByName(column = "id") | |
| 17 | private Long id; | |
| 18 | ||
| 19 | @CsvBindByName(column = "courseId") | |
| 20 | private Long courseId; | |
| 21 | ||
| 22 | @CsvBindByName(column = "userId") | |
| 23 | private Long userId; | |
| 24 | ||
| 25 | @CsvBindByName(column = "firstName") | |
| 26 | private String firstName; | |
| 27 | ||
| 28 | @CsvBindByName(column = "lastName") | |
| 29 | private String lastName; | |
| 30 | ||
| 31 | @CsvBindByName(column = "email") | |
| 32 | private String email; | |
| 33 | ||
| 34 | @CsvBindByName(column = "orgStatus") | |
| 35 | private OrgStatus orgStatus; | |
| 36 | ||
| 37 | @CsvBindByName(column = "githubId") | |
| 38 | private Integer githubId; | |
| 39 | ||
| 40 | @CsvBindByName(column = "githubLogin") | |
| 41 | private String githubLogin; | |
| 42 | ||
| 43 | @CsvBindByName(column = "role") | |
| 44 | private String role; | |
| 45 | ||
| 46 | public CourseStaffDTO(CourseStaff courseStaff) { | |
| 47 | this( | |
| 48 | courseStaff.getId(), | |
| 49 | courseStaff.getCourse().getId(), | |
| 50 |
1
1. <init> : negated conditional → KILLED |
courseStaff.getUser() != null ? courseStaff.getUser().getId() : 0L, |
| 51 | courseStaff.getFirstName(), | |
| 52 | courseStaff.getLastName(), | |
| 53 | courseStaff.getEmail(), | |
| 54 | courseStaff.getOrgStatus(), | |
| 55 | courseStaff.getGithubId(), | |
| 56 | courseStaff.getGithubLogin(), | |
| 57 | courseStaff.getRole()); | |
| 58 | } | |
| 59 | } | |
Mutations | ||
| 50 |
1.1 |