Documentation ¶
Index ¶
- Variables
- func CloseDB()
- func CreateClient(client *model.Client) error
- func CreateEvent(event *model.Event) error
- func CreateEventLog(eventLog *model.EventLog, conn *sqlx.Tx) error
- func CreateMember(member *model.Member) error
- func ExistEventAction(action string) (bool, error)
- func ExistEventStatus(status string) (bool, error)
- func ExistMember(id string) (bool, error)
- func ExistRole(role string) (bool, error)
- func GetClientByOpenId(openId string) (model.Client, error)
- func GetClientEvents(f EventFilter, clientId string) ([]model.Event, error)
- func GetEventById(id int64) (model.Event, error)
- func GetEventClientId(eventId int64) (int64, error)
- func GetEvents(f EventFilter) ([]model.Event, error)
- func GetMemberById(id string) (model.Member, error)
- func GetMemberEvents(f EventFilter, memberId string) ([]model.Event, error)
- func GetMemberIdByLogtoId(logtoId string) (sql.NullString, error)
- func GetMembers(offset uint64, limit uint64) ([]model.Member, error)
- func GetRoleId(role string) (sql.NullInt64, error)
- func InitDB()
- func SetDB(dbx *sqlx.DB)
- func SetEventAction(eventLogId int64, action string, conn *sqlx.Tx) error
- func SetEventStatus(eventId int64, status string, conn *sqlx.Tx) (sql.Result, error)
- func SetMemberRole(memberId string, role string, conn *sqlx.Tx) error
- func UpdateEvent(event *model.Event, eventLog *model.EventLog) error
- func UpdateMember(member model.Member) error
- type EventFilter
- type Hooks
- type JoinEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var EventLogFields = []string{"event_log_id", "description", "gmt_create", "member_id", "action"}
Functions ¶
func CreateClient ¶
func CreateEvent ¶
func CreateMember ¶
func ExistEventAction ¶
func ExistEventStatus ¶
func ExistMember ¶
func GetClientEvents ¶
func GetClientEvents(f EventFilter, clientId string) ([]model.Event, error)
func GetEventClientId ¶
func GetMemberEvents ¶
func GetMemberEvents(f EventFilter, memberId string) ([]model.Event, error)
func GetMemberIdByLogtoId ¶
func GetMemberIdByLogtoId(logtoId string) (sql.NullString, error)
func SetEventStatus ¶
func UpdateMember ¶
Types ¶
type EventFilter ¶
type Hooks ¶
type Hooks struct{}
Hooks satisfies the sqlhooks.Hooks interface
type JoinEvent ¶
type JoinEvent struct { Event model.Event `db:"event"` Member model.NullMember `db:"member"` Admin model.NullMember `db:"admin"` }
when a struct contains sub struct, the struct's field has the db tag of "struct'dbTag.subStruct.dbTag" for example: the db tag here for event is event, the db tag for mode.Event has field "EventId" with db tag "event_id" therefore the JoinEvent.Event.EventId has db tag of event.event_id.
Click to show internal directories.
Click to hide internal directories.