Documentation ¶
Index ¶
- Constants
- func Connect() *pg.DB
- func Diet2UserUpdate(db *pg.Conn, dietID, userID string, applied bool) error
- func Diet2UserUserExists(db *pg.Conn, u User) (bool, error)
- func DietByIDExists(db *pg.Conn, id string) (bool, error)
- func Encrypt(pw string) (string, error)
- func EventIDLikeExists(db *pg.Conn, like string) (bool, error)
- func EventsDateOnly(db *pg.Conn, now time.Time) (dates []string, err error)
- func LogError(db *pg.Conn, userID, accessLogID, loc string, contents ...interface{})
- func SettingByKey(db *pg.Conn, key string) string
- func UserUpgradeExistsByID(db *pg.Conn, id string) (bool, error)
- func UsersAllCount(db *pg.Conn) (count int, err error)
- func UsersAllOptionsCount(db *pg.Conn, orderBy string, limit, page int) (int, error)
- type AccessLog
- type Campaign
- type CampaignBase
- type CampaignNotPayed
- type ClassTimetable
- type DDayEvent
- type Diet
- type Diet2User
- type DietReview
- type ElectiveSubjectsToUser
- type ErrorLog
- type Event
- type Feedback
- type Notice
- type Session
- type Setting
- type Subject
- type Token
- type User
- func UserByEmail(db *pg.Conn, email string) (u User, err error)
- func UserByID(db *pg.Conn, id string) (u User, err error)
- func UsersAll(db *pg.Conn) (us []User, err error)
- func UsersAllOptions(db *pg.Conn, orderBy string, limit, page int) (us []User, err error)
- func UsersLikeName(db *pg.Conn, name string, orderBy string, limit, page int) (us []User, err error)
- func (u User) Campaigns(conn *pg.Conn, active bool) (cmps []Campaign, err error)
- func (u User) CampaignsNotPayed(conn *pg.Conn) (cnps []CampaignNotPayed, err error)
- func (u User) CanRegister(db *pg.Conn) (ure *apierror.UserRegisterError)
- func (u *User) Create(db *pg.Conn) error
- func (u User) ElectiveSubjects(db *pg.Conn) (est ElectiveSubjectsToUser, err error)
- func (u User) NewSession(db *pg.Conn) (s Session, err error)
- func (u *User) UpdatePw(db *pg.Conn) error
- func (u *User) UpdateRoles(db *pg.Conn) error
- func (u *User) UpdateV1(db *pg.Conn) error
- func (u *User) UpgradeHakbun(db *pg.Conn) error
- func (u *User) ValidateUserRegister() (ure *apierror.UserRegisterError)
- type UserUpgrade
Constants ¶
View Source
const ( ErrPgErrCodeField = byte(67) // C ErrPgForeignKeyViolation = "23503" ErrPgUniqueViolation = "23505" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessLog ¶
type Campaign ¶
type Campaign struct {
CampaignBase
}
type CampaignBase ¶
type CampaignBase struct { ID string IsReady bool Title string SubTitle string ImageSrc string `pg:",use_zero" sql:",notnull"` Link string `pg:",use_zero" sql:",notnull"` UserID string User *User Price int Payment string PayedAt *time.Time PayCode string CreatedAt time.Time UpdatedAt time.Time DeletedAt time.Time `pg:",soft_delete"` StartAt time.Time EndAt time.Time }
type CampaignNotPayed ¶
type CampaignNotPayed struct { TableName struct{} `sql:"campaigns_not_payed" json:"-"` CampaignBase PayLink string }
func CampaignNotPayedByID ¶
func CampaignNotPayedByID(conn *pg.Conn, id string) (cnp CampaignNotPayed, err error)
func CampaignNotPayedByPayCode ¶
func CampaignNotPayedByPayCode(conn *pg.Conn, code string) (cnp CampaignNotPayed, err error)
func CampaignsNotPayedPayed ¶
func CampaignsNotPayedPayed(conn *pg.Conn) (cnps []CampaignNotPayed, err error)
func (*CampaignNotPayed) UpdatePayedAt ¶
func (cnp *CampaignNotPayed) UpdatePayedAt(conn *pg.Conn) error
func (*CampaignNotPayed) UpdatePayment ¶
func (cnp *CampaignNotPayed) UpdatePayment(conn *pg.Conn) error
type ClassTimetable ¶
func ClassTimetableByGradeClass ¶
func ClassTimetableByGradeClass(db *pg.Conn, grade, class int) (table ClassTimetable, err error)
type DDayEvent ¶
type Diet ¶
type Diet struct { ID string `pg:",pk"` Date time.Time Timestamp string Type int // MealType Content string Canceled bool `pg:",use_zero" sql:",notnull"` CreatedAt time.Time `sql:"default:now()"` }
func DietReviewPossible ¶
type Diet2User ¶
type Diet2User struct { TableName struct{} `sql:"diet2users" json:"-"` DietID string `pg:",pk"` Diet *Diet `json:"-"` UserID string `pg:",pk"` User *User `json:"-"` Applied bool `pg:",use_zero" sql:",notnull"` CreatedAt time.Time `sql:"default:now()" json:"-"` }
func Diet2UserByDietAndUser ¶
type DietReview ¶
type ElectiveSubjectsToUser ¶
type Event ¶
type Event struct { ID string Name string Date time.Time DateString string Type int `pg:",use_zero" sql:",notnull"` Grade1 bool `pg:",use_zero" sql:",notnull"` Grade2 bool `pg:",use_zero" sql:",notnull"` Grade3 bool `pg:",use_zero" sql:",notnull"` CreatedAt time.Time `sql:"default:now()" json:"-"` }
type Feedback ¶
type Notice ¶
type Session ¶
type Subject ¶
type Subject struct { ID int `pg:",pk" json:",omitempty"` Grade int ShortName string FullName string Teacher string Room string /* 형식은 0000000, 각각 1) 예술 과목 여부 2) 교양 과목 여부 3) 외국어 과목 여부 4) 선택A 5) 선택B 6) 선택C 7) 선택D ...를 나타낸다. ClassTimetables 테이블에서는 1이 0개 또는 1개 존재해야한다. ElectiveSubjects 테이블에서는 1개 이상 존재해야 한다. */ AvailableBit int // contains filtered or unexported fields }
type Token ¶
type User ¶
type User struct { ID string `pg:",pk"` EnterYear int `sql:",unique:gcn"` Grade int `sql:",unique:gcn"` Class int `sql:",unique:gcn"` Number int `sql:",unique:gcn"` Name string Sex int // 1: male 2: female Email string `sql:",unique"` Password string `json:"-"` Barcode string `sql:",unique"` KitchenMemCode string `sql:",unique"` BirthYear int BirthMonth int BirthDay int Roles string Residence int // 1: 기숙 2: 광양 CreatedAt time.Time `sql:"default:now()"` UpdatedAt time.Time `sql:"default:now()"` }
func UsersAllOptions ¶
func UsersLikeName ¶
func (User) CampaignsNotPayed ¶
func (u User) CampaignsNotPayed(conn *pg.Conn) (cnps []CampaignNotPayed, err error)
func (User) CanRegister ¶
func (u User) CanRegister(db *pg.Conn) (ure *apierror.UserRegisterError)
func (User) ElectiveSubjects ¶
func (u User) ElectiveSubjects(db *pg.Conn) (est ElectiveSubjectsToUser, err error)
func (*User) ValidateUserRegister ¶
func (u *User) ValidateUserRegister() (ure *apierror.UserRegisterError)
Click to show internal directories.
Click to hide internal directories.