package practiceschedule import ( ecore "simrs-vx/internal/domain/base-entities/core" erx "simrs-vx/internal/domain/references/xtime" ) type CreateDto struct { Doctor_Id *uint `json:"doctor_id"` Unit_Code *string `json:"unit_code"` Day_Code *erx.DayCode `json:"day_code"` StartTime *string `json:"startTime"` EndTime *string `json:"endTime"` } type ReadListDto struct { Doctor_Id *uint `json:"doctor_id"` Unit_Code *string `json:"unit_code"` Day_Code *erx.DayCode `json:"day_code"` StartTime *string `json:"startTime"` EndTime *string `json:"endTime"` Page int `json:"page"` PageSize int `json:"page_size"` NoPagination int `json:"no_pagination"` } type ReadDetailDto struct { Id uint16 `json:"id"` Doctor_Id *uint `json:"doctor_id"` Unit_Code *string `json:"unit_code"` Day_Code *erx.DayCode `json:"day_code"` StartTime *string `json:"startTime"` EndTime *string `json:"endTime"` } type UpdateDto struct { Id uint16 `json:"id"` CreateDto } type DeleteDto struct { Id uint16 `json:"id"` } type MetaDto struct { PageNumber int `json:"page_number"` PageSize int `json:"page_size"` Count int `json:"count"` } type ResponseDto struct { ecore.Main Doctor_Id *uint `json:"doctor_id"` Unit_Code *string `json:"unit_code"` Day_Code *erx.DayCode `json:"day_code"` StartTime *string `json:"startTime"` EndTime *string `json:"endTime"` } func (d PracticeSchedule) ToResponse() ResponseDto { resp := ResponseDto{ Doctor_Id: d.Doctor_Id, Unit_Code: d.Unit_Code, Day_Code: d.Day_Code, StartTime: d.StartTime, EndTime: d.EndTime, } resp.Main = d.Main return resp } func ToResponseList(data []PracticeSchedule) []ResponseDto { resp := make([]ResponseDto, len(data)) for i, u := range data { resp[i] = u.ToResponse() } return resp }