Documentation
¶
Index ¶
- Constants
- Variables
- func CheckCustomerAccountExists(account string) (e bool)
- func CheckCustomerEmailExists(email string) (e bool)
- func CheckEmployeeID(cid, employeeID string) (r bool, err error)
- func CheckMemberSNSLinkExists(cid, mid string) (b bool, err error)
- func CheckSNSLinkExists(cid, userID string) (b bool, err error)
- func CheckUserExists(userID string) (exists bool)
- func CreateAccessToken(u *User) (token string, err error)
- func CreateMemberReportMonthly(cid, day string) (err error)
- func DeleteAccessToken(token string) (res int, err error)
- func DeleteCustomLink(cid, mid string) (err error)
- func DeleteSNSLink(cid, mid string) (err error)
- func ExtendAccessToken(u *User, token string) (err error)
- func FetchCustomerMembersMap(cid string) (membersMap map[string]Member, err error)
- func FetchMemberCount(cid string) (count int)
- func GetAccessToken(token string) (res map[string]string, err error)
- func GetCustomerGroupMemberMap(cid string) (groupsMap map[string]*GroupResult, err error)
- func GetCustomerTodayPunchMemberIDs(customerID, timezone string) (memberIDs []string, err error)
- func GetFormStatusNoneCount(cid string, memberIDs []string) (count int, err error)
- func GetGroupMemberMap(cid string, gIDs []string) (memberIDs []string, groupsMap map[string]string, err error)
- func GetGroupsMemberIDs(cid, mid string) (memberIDs []string, err error)
- func GetPairCode(code string) (userID string, err error)
- func ReplaceRosterData(cid, sid, mid, startDay, endDay string, days []string) (err error)
- func SetL10n()
- func SetPairCode(code, userID string, pairTokenExpire int) (err error)
- func Start()
- type Category
- type Contract
- type Customer
- func (c *Customer) Create() error
- func (c *Customer) CreateCustomerFlow(userID string, member *Member, group *Group) (t time.Time, err error)
- func (c *Customer) Delete() error
- func (c *Customer) GetByConditionWithRoster() (err error)
- func (c *Customer) GetBySt() error
- func (Customer) TableName() string
- func (c *Customer) Update(val interface{}) int64
- type Customers
- type DEVICE
- type DEVICES
- type Dayoff
- type Dayoffs
- type DeviceFaceLog
- type Form
- func (s *Form) Create() error
- func (s *Form) Delete() error
- func (s *Form) GetAttachmentURL() (signURL string)
- func (s *Form) GetBySt() error
- func (s *Form) GetCheckStatus() string
- func (s *Form) GetGPSData() (g GPSInfo)
- func (s *Form) GetLocalApplyTime() string
- func (s *Form) GetRawLocalApplyTime() string
- func (s *Form) GetReportedForm(withinDate time.Time) error
- func (Form) TableName() string
- func (s *Form) Update(val interface{}) error
- type Forms
- type GPSInfo
- type Geometry
- type Group
- type GroupResult
- type Groups
- type MRHGPS
- type Member
- func (s *Member) Create() error
- func (s *Member) Delete() error
- func (s *Member) GetAvatarURL() string
- func (s *Member) GetBySt() error
- func (s *Member) GetJoinedAt(timezone string) (at string)
- func (s *Member) IsAdmin() bool
- func (Member) TableName() string
- func (s *Member) Update(val interface{}) int64
- type MemberAndMemberGroup
- type MemberFace
- func (mf *MemberFace) Create() error
- func (mf *MemberFace) Delete() error
- func (mf *MemberFace) GetAllMemberFaces(cid, mid string) ([]MemberFace, error)
- func (mf *MemberFace) GetBySt() error
- func (mf *MemberFace) GetFaceCount(cid, mid string) (count int)
- func (MemberFace) TableName() string
- func (mf *MemberFace) Update(val interface{}) int64
- type MemberFaces
- type MemberGroup
- type MemberGroupResult
- type MemberGroups
- func (mgs *MemberGroups) GetAllByCID(cid string) error
- func (mgs *MemberGroups) GetAllByGID(cid, gid string) error
- func (mgs *MemberGroups) GetAllMemberAndGroupInfo(cid string) []MemberAndMemberGroup
- func (mgs *MemberGroups) GetMemberGroups(cid, mid string) error
- func (mgs *MemberGroups) GetMemberIDsInGroupIDsAndGroupByMID(cid string, gids []string) ([]string, error)
- type MemberReportHistory
- func (s *MemberReportHistory) Create() error
- func (s *MemberReportHistory) Delete() error
- func (s *MemberReportHistory) GetBySt() error
- func (s *MemberReportHistory) GetCategory() string
- func (s *MemberReportHistory) GetCheckTime() string
- func (s *MemberReportHistory) GetLocalCheckinAt() string
- func (s *MemberReportHistory) GetLocalCheckoutAt() string
- func (MemberReportHistory) TableName() string
- func (s *MemberReportHistory) Update(val interface{}) int64
- type MemberReportHistorys
- type MemberReportMonthly
- func (s *MemberReportMonthly) Create() error
- func (s *MemberReportMonthly) Delete() error
- func (s *MemberReportMonthly) GetBySt() error
- func (s *MemberReportMonthly) GetCountInMonth(mid string, mon time.Time) (count int)
- func (s *MemberReportMonthly) GetLocalCheckinAt() string
- func (s *MemberReportMonthly) GetLocalCheckoutAt() string
- func (s *MemberReportMonthly) Status() string
- func (MemberReportMonthly) TableName() string
- func (s *MemberReportMonthly) Update(val interface{}) int64
- func (s *MemberReportMonthly) Weekday() string
- func (s *MemberReportMonthly) WorkingHours() string
- type MemberReportMonthlys
- type MemberReportRawData
- type Members
- type MobileDeviceToken
- func (m *MobileDeviceToken) Create() error
- func (m *MobileDeviceToken) Delete() error
- func (m *MobileDeviceToken) Get(userID, token string) error
- func (m *MobileDeviceToken) GetUserEndpoints(userID string) ([]MobileDeviceToken, error)
- func (m *MobileDeviceToken) GetUserEndpointsByMemberID(customerID, memberID string) ([]MobileDeviceToken, error)
- func (MobileDeviceToken) TableName() string
- func (m *MobileDeviceToken) Update(val interface{}) int64
- type Notification
- func (s *Notification) Create() error
- func (s *Notification) CreateNotify(notify interface{}, cid, mid, class, source string) (err error)
- func (s *Notification) Delete() error
- func (s *Notification) GetBySt() error
- func (Notification) TableName() string
- func (s *Notification) Update(val interface{}) int64
- type Notifications
- type Package
- type RoleEnum
- type Roster
- type RosterConfig
- type Rosters
- type SendEmailData
- type SendEmailDatas
- type Shift
- type Shifts
- type USERS
- type UpdateRosterMembers
- type User
- func (s *User) CheckPassWord(passwd string) (isMatch bool)
- func (s *User) Create() error
- func (s *User) Delete() error
- func (s *User) FetchCustomUserByMemberID(cid, memberID string) (err error)
- func (s *User) FetchSigninCustomUser(cid, employeeID string) (err error)
- func (s *User) GetBySt() error
- func (s *User) IsRegisterCustomerByEmail() (e string)
- func (User) TableName() string
- func (s *User) Update(val interface{}) int64
- func (s *User) UseEternalToken() (r bool)
- type UserMemberLink
- type UserMemberLinks
Constants ¶
const ( //GfFacialIdentifyDisable - GfFacialIdentifyDisable = "0" //GfFacialIdentifyEnable - GfFacialIdentifyEnable = "1" //TemperatureNone - TemperatureNone = "NONE" //TemperatureCelsius - TemperatureCelsius = "C" //TemperatureFahrenheit - TemperatureFahrenheit = "F" )
const ( DutyTypeHoliDay = iota DutyTypeWorkDay DutyTypeManPower DutyTypeWorkDayAndManPower )
DutyType define
const ( //FaceLogStatusFail - FaceLogStatusFail = -1 //FaceLogStatusInit - FaceLogStatusInit = 0 //FaceLogStatusOK - FaceLogStatusOK = 1 )
const ( FormStatusReject = iota - 1 FormStatusNone FormStatusDone CategoryCheckIn = "checkin" CategoryCheckOut = "checkout" FormColorNone = "0" FormColorGray = "1" FormCreatorRoleStaff = "staff" FormCreatorRoleAdmin = "admin" )
const -
const ( //MemberRoleStaff - MemberRoleStaff = "staff" //MemberRoleAdmin - MemberRoleAdmin = "admin" //MemberRoleCustomer - MemberRoleCustomer = "customer" )
const ( //ReportStatusRed ... ReportStatusRed = "-1" //ReportStatusNone ... ReportStatusNone = "0" //ReportStatusGreen ... ReportStatusGreen = "1" )
const ( EODFalse = 0 EODTrue = 1 CheckInNext = "checkin_next" CheckOutNext = "checkout_next" )
EOD FLAG Define -
const ( RosterDayNotOpen = "-1" RosterDayNone = "0" RosterDayWork = "1" RosterDayWorkAccept = "2" RosterDayWorkAcceptNotRelease = "3" RosterDayoff = "4" )
RosterDay define
const ( ManPowerNone = "0" ManPowerGray = "1" ManPowerBlue = "2" ManPowerRed = "3" )
ManPower Color Define -
const ( ShiftTypePast = iota ShiftTypeCurrent ShiftTypeNext )
Shift Type Define -
const ( //SNSTypeGoogle - SNSTypeGoogle = "google" //SNSTypeApple - SNSTypeApple = "apple" //SNSTypeCustom - SNSTypeCustom = "custom" )
Variables ¶
var ( //DB DB Client DB *gorm.DB //RedisPool Redis Pool RedisPool *redis.Pool )
Functions ¶
func CheckCustomerAccountExists ¶
CheckCustomerAccountExists -
func CheckCustomerEmailExists ¶
CheckCustomerEmailExists -
func CheckEmployeeID ¶
CheckEmployeeID -
func CheckMemberSNSLinkExists ¶
CheckMemberSNSLinkExists -
func CheckSNSLinkExists ¶
CheckSNSLinkExists -
func CreateAccessToken ¶
CreateAccessToken -
func CreateMemberReportMonthly ¶
CreateMemberReportMonthly -
func DeleteAccessToken ¶
DeleteAccessToken -
func DeleteCustomLink ¶
DeleteCustomLink - 若 sns = custom, 則移除 table::user 與 table::user_member_link 資料
func ExtendAccessToken ¶
ExtendAccessToken -
func FetchCustomerMembersMap ¶
FetchCustomerMembersMap -
func GetAccessToken ¶
GetAccessToken -
func GetCustomerGroupMemberMap ¶
func GetCustomerGroupMemberMap(cid string) (groupsMap map[string]*GroupResult, err error)
GetCustomerGroupMemberMap - 取得 cid 下 member_group 中的資訊
func GetCustomerTodayPunchMemberIDs ¶
GetCustomerTodayPunchMemberIDs -
func GetFormStatusNoneCount ¶
GetFormStatusNoneCount -
func GetGroupMemberMap ¶
func GetGroupMemberMap(cid string, gIDs []string) (memberIDs []string, groupsMap map[string]string, err error)
GetGroupMemberMap -
func GetGroupsMemberIDs ¶
GetGroupsMemberIDs -
func ReplaceRosterData ¶
ReplaceRosterData -
func SetPairCode ¶
SetPairCode -
Types ¶
type Contract ¶
type Contract struct { ID uint64 CustomerID string PackageID string `gorm:"column:pkg_id"` StartDate time.Time EndDate time.Time OriginFee int Fee int Applied int InvoiceNo string Memo string CreatedAt time.Time UpdatedAt time.Time }
Contract -
type Customer ¶
type Customer struct { ID uint64 CustomerID string Account string Passwd string Email string Language string Timezone string Name string Category int `gorm:"column:category"` MemberLimit int `gorm:"column:member_limit"` DailyPunchLimit int `gorm:"daily_punch_limit"` GfFacialIdentify int CustomLogin int EmailNotify int `gorm:"email_notify"` // 0: 不寄送, 1: 寄送 CollectionID string `gorm:"column:collection_id"` RingCount int RosterConfigJSON json.RawMessage `gorm:"column:roster_config"` RosterConfig RosterConfig `gorm:"-"` HourOffset int `gorm:"column:hour_offset"` WageEnable int TemperatureUnit string `gorm:"column:temperature_unit"` Tel string MemberFaceLimit int ContractStartAt time.Time `gorm:"column:contract_start_at"` ContractEndAt time.Time `gorm:"column:contract_end_at"` CreatedAt time.Time UpdatedAt time.Time }
Customer -
func (*Customer) CreateCustomerFlow ¶
func (c *Customer) CreateCustomerFlow(userID string, member *Member, group *Group) (t time.Time, err error)
CreateCustomerFlow -
func (*Customer) GetByConditionWithRoster ¶
GetByConditionWithRoster -
type Customers ¶
type Customers []Customer
Customers -
func (*Customers) GetByInterface ¶
GetByInterface -
type DEVICE ¶
type DEVICE struct { ID uint64 `gorm:"column:id"` CustomerID string `gorm:"column:customer_id"` DeviceID string `gorm:"column:device_id"` DeviceType string `gorm:"column:device_type"` Model string `gorm:"column:model"` Name string `gorm:"column:name"` Timezone string `gorm:"column:timezone"` FaceDevice int `gorm:"column:face_device"` FaceThreshold int `gorm:"column:face_threshold"` CreatedAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` }
func (*DEVICE) GetDeviceByDeviceID ¶
Get Device By Device ID
type DEVICES ¶
type DEVICES []DEVICE
func (*DEVICES) GetAllByCustomIDWithPageAndSize ¶
GetByCustomID -
func (*DEVICES) GetAllByCustomerID ¶
type Dayoff ¶
type Dayoff struct { ID uint64 CustomerID string OffDay time.Time OffName string OnDutyJSON json.RawMessage `gorm:"column:on_duty"` OnDuty map[string]string `gorm:"-"` DutyType int CreatedAt time.Time UpdatedAt time.Time }
Dayoff -
type Dayoffs ¶
type Dayoffs []Dayoff
Dayoffs -
func (*Dayoffs) GetByCondition ¶
GetByCondition -
func (*Dayoffs) GetManPowerList ¶
GetManPowerList -
func (*Dayoffs) GetOffDayList ¶
GetOffDayList -
type DeviceFaceLog ¶
type DeviceFaceLog struct { ID uint64 IdentifyID string CustomerID string DeviceID string MemberID string ImageURL string Status int Action string LocalAt *time.Time Confidence float64 RemoteIP string ExpiredAt int64 CreatedAt time.Time UpdatedAt time.Time }
DeviceFaceLog -
type Form ¶
type Form struct { ID uint64 FormID string CustomerID string MemberID string ReportID string DeviceName string `gorm:"column:device_name"` Category string LocalApplyDay time.Time LocalApplyHour string Remark string AttachmentURL string GPS json.RawMessage AdminMemberID string Message string ReviewTime time.Time CreatorRole string `sql:"not null;type:ENUM('staff', 'admin')"` Status int CreatedAt time.Time UpdatedAt time.Time }
Form -
func (*Form) GetAttachmentURL ¶
GetAttachmentURL -
func (*Form) GetRawLocalApplyTime ¶
GetRawLocalApplyTime -
func (*Form) GetReportedForm ¶
GetReportedForm -
type Forms ¶
type Forms []Form
Forms -
func (*Forms) GetByCustomID ¶
func (fs *Forms) GetByCustomID(cid string, memberIDs []string, status, page, size int, afterTime time.Time) (count int, err error)
GetByCustomID - - afterTime: 指定日期, 取得該日期後的資料
func (*Forms) GetByInterface ¶
GetByInterface -
func (*Forms) GetByInterfaceOrderID ¶
GetByInterfaceOrderID -
type Geometry ¶
type Geometry struct {
X, Y float64
}
Geometry - 此為 mysql 欄位類行為 Geometry - 因為 gorm 不支援此類型 - 故自定義此類型
func (Geometry) GormDataType ¶
type Group ¶
type Group struct { ID uint64 CustomerID string GroupID string Name string ParentGroupID string BufferEnable int Buffer int Boundary int `gorm:"default:0"` // 0=disable, 1=limited, 2=same as root Distance int `gorm:"default:0"` Coordinate Geometry `gorm:"default:'GeomFromText('POINT(0 0)')'"` CreatedAt time.Time UpdatedAt time.Time }
Group -
func (*Group) GetDistance ¶
計算距離
func (*Group) GetGroupInfo ¶
type GroupResult ¶
GroupResult -
type Groups ¶
type Groups []Group
Groups -
func (*Groups) GetListOrderByIDDESC ¶
GetListOrderByIDDESC -
type MRHGPS ¶
type Member ¶
type Member struct { ID uint64 CustomerID string MemberID string Name string EmployeeID string AvatarURL string Role RoleEnum `sql:"type:ENUM('admin', 'staff')"` Category int Tel string Leave int CreatedAt time.Time UpdatedAt time.Time }
Member -
func (*Member) GetJoinedAt ¶
GetJoinedAt -
type MemberAndMemberGroup ¶
type MemberAndMemberGroup struct { MemberID string Name string GroupID string Role RoleEnum `sql:"type:ENUM('admin', 'staff')"` }
Member 與 MemberGroup 的物件集合
type MemberFace ¶
type MemberFace struct { ID uint64 CustomerID string MemberID string MFID string `gorm:"column:mf_id"` FaceID string AvatarURL string IsDefault bool CreatedAt time.Time UpdatedAt time.Time }
Member Face -
func (*MemberFace) GetAllMemberFaces ¶
func (mf *MemberFace) GetAllMemberFaces(cid, mid string) ([]MemberFace, error)
func (*MemberFace) GetFaceCount ¶
func (mf *MemberFace) GetFaceCount(cid, mid string) (count int)
type MemberFaces ¶
type MemberFaces []MemberFace
type MemberGroup ¶
type MemberGroup struct { ID uint64 MemberID string CustomerID string GroupID string CreatedAt time.Time UpdatedAt time.Time }
MemberGroup -
func (*MemberGroup) GetBySt ¶
func (mg *MemberGroup) GetBySt() error
type MemberGroupResult ¶
MemberGroupResult -
func GetMemberGroups ¶
func GetMemberGroups(cid, mid string) (results []MemberGroupResult, err error)
GetMemberGroups -
type MemberGroups ¶
type MemberGroups []MemberGroup
MemberGroups -
func (*MemberGroups) GetAllByCID ¶
func (mgs *MemberGroups) GetAllByCID(cid string) error
GetAllByGID - 透過 CID 取得所有資料
func (*MemberGroups) GetAllByGID ¶
func (mgs *MemberGroups) GetAllByGID(cid, gid string) error
GetAllByGID - 透過 GID 取得所有資料
func (*MemberGroups) GetAllMemberAndGroupInfo ¶
func (mgs *MemberGroups) GetAllMemberAndGroupInfo(cid string) []MemberAndMemberGroup
取得 cid 下, 所有 member 與 group 的資訊
func (*MemberGroups) GetMemberGroups ¶
func (mgs *MemberGroups) GetMemberGroups(cid, mid string) error
GetMemberGroups - 取得該 member 的所有 member_group 資訊
func (*MemberGroups) GetMemberIDsInGroupIDsAndGroupByMID ¶
func (mgs *MemberGroups) GetMemberIDsInGroupIDsAndGroupByMID(cid string, gids []string) ([]string, error)
GetMemberIDsInGroupIDsAndGroupByMID - 取得 member IDs IN group_ids, 且 group by MemberID
type MemberReportHistory ¶
type MemberReportHistory struct { ID uint64 CustomerID string ReportID string MemberID string Role string `sql:"not null;type:ENUM('staff', 'admin', 'customer')"` LocalCheckinAt string `sql:"default:null"` LocalCheckoutAt string `sql:"default:null"` Discard int FormID string Title string GPS json.RawMessage Temperature *float64 `gorm:"column:temperature"` RawDataID uint64 `gorm:"column:rawdata_id"` CreatedAt time.Time UpdatedAt time.Time }
MemberReportHistory -
func (*MemberReportHistory) GetCategory ¶
func (s *MemberReportHistory) GetCategory() string
GetCategory -
func (*MemberReportHistory) GetCheckTime ¶
func (s *MemberReportHistory) GetCheckTime() string
GetCheckTime -
func (*MemberReportHistory) GetLocalCheckinAt ¶
func (s *MemberReportHistory) GetLocalCheckinAt() string
GetLocalCheckinAt -
func (*MemberReportHistory) GetLocalCheckoutAt ¶
func (s *MemberReportHistory) GetLocalCheckoutAt() string
GetLocalCheckoutAt -
func (*MemberReportHistory) Update ¶
func (s *MemberReportHistory) Update(val interface{}) int64
Update -
type MemberReportHistorys ¶
type MemberReportHistorys []MemberReportHistory
MemberReportHistorys -
func (*MemberReportHistorys) GetByInterface ¶
func (s *MemberReportHistorys) GetByInterface(val interface{}) error
GetByInterface -
func (*MemberReportHistorys) OrderByTime ¶
func (s *MemberReportHistorys) OrderByTime()
OrderByTime -
type MemberReportMonthly ¶
type MemberReportMonthly struct { ID uint64 CustomerID string ReportID string MemberID string LocalReportDay time.Time LocalCheckinAt string `sql:"default:null"` LocalCheckoutAt string `sql:"default:null"` WorkingHour string RealWorkingHour float64 `gorm:"-"` PaidHour string PaidDetail json.RawMessage EarnWage string ModifyFlag int Name string `gorm:"-"` CreatedAt time.Time UpdatedAt time.Time }
MemberReportMonthly -
func (*MemberReportMonthly) GetCountInMonth ¶
func (s *MemberReportMonthly) GetCountInMonth(mid string, mon time.Time) (count int)
GetCountInMonth -
func (*MemberReportMonthly) GetLocalCheckinAt ¶
func (s *MemberReportMonthly) GetLocalCheckinAt() string
GetLocalCheckinAt -
func (*MemberReportMonthly) GetLocalCheckoutAt ¶
func (s *MemberReportMonthly) GetLocalCheckoutAt() string
GetLocalCheckoutAt -
func (*MemberReportMonthly) Status ¶
func (s *MemberReportMonthly) Status() string
- Status - 判斷 member report monthly 中, 是否上下班都『已』打卡 - 上下班都沒打卡 = ReportStatusNone - 上下班都打卡 = ReportStatusGreen - 上下班其一打卡 = ReportStatusRed
func (*MemberReportMonthly) Update ¶
func (s *MemberReportMonthly) Update(val interface{}) int64
Update ...
func (*MemberReportMonthly) WorkingHours ¶
func (s *MemberReportMonthly) WorkingHours() string
WorkingHours ...
type MemberReportMonthlys ¶
type MemberReportMonthlys []MemberReportMonthly
MemberReportMonthlys -
func (*MemberReportMonthlys) GetByInMonth ¶
func (s *MemberReportMonthlys) GetByInMonth(mid string, mon time.Time) error
GetByInMonth -
func (*MemberReportMonthlys) GetByInterface ¶
func (s *MemberReportMonthlys) GetByInterface(val interface{}) error
GetByInterface -
func (*MemberReportMonthlys) GetByInterfaceJoinMember ¶
func (s *MemberReportMonthlys) GetByInterfaceJoinMember(val interface{}, memberIDs []string) error
GetByInterfaceJoinMember -
type MemberReportRawData ¶
type MemberReportRawData struct { ID uint64 MemberID string HistoryMemberID string `gorm:"column:history_member_id"` Role string `sql:"not null;type:ENUM('staff', 'admin', 'customer')"` Action string `sql:"not null;type:ENUM('checkin', 'checkout')"` LocalAt time.Time `gorm:"column:local_at"` EOD int `gorm:"column:eod"` Discard int FormID string Memo string Title string GPS json.RawMessage Temperature *float64 `gorm:"column:temperature"` CreatedAt time.Time UpdatedAt time.Time CustomerHourOffset int `gorm:"-"` }
MemberReportRawData -
func (*MemberReportRawData) Update ¶
func (r *MemberReportRawData) Update(val interface{}) int64
Update ...
type Members ¶
type Members []Member
Members -
func (*Members) GetAllMembers ¶
func (*Members) GetByCustomerID ¶
GetByCustomerID -
func (*Members) GetByInterface ¶
GetByInterface -
func (*Members) GetNotLeaveMembers ¶
GetNotLeaveMembers -
type MobileDeviceToken ¶
type MobileDeviceToken struct { ID uint64 User_id string Token string Sns_platform_endpoint string Language string UpdatedAt time.Time CreatedAt time.Time }
MobileDeviceToken -
func (*MobileDeviceToken) GetUserEndpoints ¶
func (m *MobileDeviceToken) GetUserEndpoints(userID string) ([]MobileDeviceToken, error)
GetUserEndpoints -
func (*MobileDeviceToken) GetUserEndpointsByMemberID ¶
func (m *MobileDeviceToken) GetUserEndpointsByMemberID(customerID, memberID string) ([]MobileDeviceToken, error)
GetUserEndpointsByMemberID -
func (*MobileDeviceToken) Update ¶
func (m *MobileDeviceToken) Update(val interface{}) int64
Update -
type Notification ¶
type Notification struct { ID uint64 CustomerID string MemberID string Class string Source string Field json.RawMessage ExpiredAT int64 CreatedAt time.Time UpdatedAt time.Time }
Notification -
func (*Notification) CreateNotify ¶
func (s *Notification) CreateNotify(notify interface{}, cid, mid, class, source string) (err error)
CreateNotify -
type Notifications ¶
type Notifications []Notification
Notifications -
func (*Notifications) GetByInterfaceCount ¶
func (ns *Notifications) GetByInterfaceCount(n interface{}, page, pagesize int, rosterEnable string, afterTime time.Time, role RoleEnum) (count int, err error)
GetByInterfaceCount - - afterTime: 指定日期, 取得該日期後的資料
type Package ¶
type Package struct { ID uint64 PkgID string `gorm:"column:pkg_id"` Name string DailyPunchLimit int `gorm:"daily_punch_limit"` Member int MemberFaceLimit int Period int CreatedAt time.Time UpdatedAt time.Time }
Package -
type Roster ¶
type Roster struct { ID uint64 CustomerID string LocalDutyDate time.Time ShiftID string MemberID string CreatedAt time.Time UpdatedAt time.Time }
Roster -
type RosterConfig ¶
type RosterConfig struct { EndDay string `json:"end_day"` WorkDay []int `json:"work_day"` RosterEnable string `json:"roster_enable"` SendNotifyDay string `json:"send_notify_day"` RosterStarDay string `json:"roster_start_day"` }
RosterConfig -
type Rosters ¶
type Rosters []Roster
Rosters -
func (*Rosters) GetByCondition ¶
GetByCondition -
func (*Rosters) GetByInterface ¶
GetByInterface -
func (*Rosters) GetDateList ¶
GetDateList -
type SendEmailData ¶
type SendEmailDatas ¶
type SendEmailDatas []SendEmailData
func (*SendEmailDatas) GetSendEmailDatasByMIDs ¶
func (seds *SendEmailDatas) GetSendEmailDatasByMIDs(cid string, mids []string) (err error)
type Shift ¶
type Shift struct { ID uint64 ShiftID string CustomerID string ShiftType int Name string StartTime string EndTime string Manpower int CreatedAt time.Time UpdatedAt time.Time }
Shift -
type Shifts ¶
type Shifts []Shift
Shifts -
func (*Shifts) FetchCustomerCurrentShifts ¶
FetchCustomerCurrentShifts -
func (*Shifts) FetchCustomerMonthShifts ¶
FetchCustomerMonthShifts -
type UpdateRosterMembers ¶
type UpdateRosterMembers struct { Cid string Sid string Day time.Time AddMembers []string DelMembers []string Rosters Rosters Members Members }
UpdateRosterMembers -
func (*UpdateRosterMembers) UpdateRosterShiftMembers ¶
func (urm *UpdateRosterMembers) UpdateRosterShiftMembers() error
UpdateRosterShiftMembers -
type User ¶
type User struct { ID uint64 Sns string SnsUID string UserID string Name string Email string Picture string EternalToken int Password string `gorm:"column:passwd"` CreatedAt time.Time UpdatedAt time.Time }
User -
func (*User) CheckPassWord ¶
CheckPassWord -
func (*User) FetchCustomUserByMemberID ¶
FetchCustomUserByMemberID -
func (*User) FetchSigninCustomUser ¶
FetchSigninCustomUser -
func (*User) IsRegisterCustomerByEmail ¶
IsRegisterCustomerByEmail -
type UserMemberLink ¶
type UserMemberLink struct { ID uint64 UserID string CustomerID string MemberID string NotifyCount int CreatedAt time.Time UpdatedAt time.Time }
UserMemberLink -
func (*UserMemberLink) IncrNotifyCnt ¶
func (s *UserMemberLink) IncrNotifyCnt() error
IncrNotifyCnt - 如 member 有更新資料, 則增加 count ex: - UpdateForm - CreateReportRecord - MemberUpdate - UpdateRosterShiftMembers - UpdateRosterShiftMembers - UpdateRosterShiftMembers
type UserMemberLinks ¶
type UserMemberLinks []UserMemberLink
UserMemberLinks -
func (*UserMemberLinks) GetAllByMIDs ¶
func (umls *UserMemberLinks) GetAllByMIDs(cid string, mids []string) error
GetAllByMIDs - 透過 mids 取得所有資料
func (*UserMemberLinks) GetAllByUIDs ¶
func (umls *UserMemberLinks) GetAllByUIDs(cid string, uids []string) error
GetAllByMIDs - 透過 mids 取得所有資料
func (*UserMemberLinks) GetByInterface ¶
func (s *UserMemberLinks) GetByInterface(val interface{}) error
GetByInterface -
Source Files
¶
- base_model.go
- contract.go
- customer.go
- day_off.go
- device.go
- device_face_log.go
- form.go
- geometry.go
- groups.go
- member.go
- member_face.go
- member_group.go
- member_report_history.go
- member_report_monthly.go
- member_report_rawdata.go
- mobile_device_token.go
- notification.go
- package.go
- roster.go
- shift.go
- token.go
- user.go
- user_member_link.go