Documentation ¶
Index ¶
- func DeleteUser(UserID int, PassWord string) error
- func FindDataSpecifiedNumber(GroupID string, num int) ([]string, error)
- func FindUserIDbyMail(mail string) (int, error)
- func GetGroupIDFromLineID(lineID string) (string, error)
- func GroupCheck(UserID int, PassWord string, GroupID string) (err error)
- func InitDB()
- func InsertDataData(UserID int, PassWord string, GroupID string, DataName string, ImageName string, ...) error
- func InsertUserData(UserName string, PassWord string, Mail string, GroupID string) (int, error)
- func UpdateGroupID(UserID int, GroupID string, PassWord string) (gid string, err error)
- func UpdateLineID(UserID int, LineID, PassWord string) error
- func UserAuth(mail string, password string) error
- type Data
- type Model
- type Result
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteUser ¶
DeleteUser delete user on database
func FindDataSpecifiedNumber ¶
FindDataSpecifiedNumber return all data information in specified number of GroupID
func FindUserIDbyMail ¶
FindUserIDbyMail Return UserID from mail
func GetGroupIDFromLineID ¶
GetGroupIDFromLineID Return GroupID from LineID
func GroupCheck ¶
GroupCheck check group and user auth
func InsertDataData ¶
func InsertDataData(UserID int, PassWord string, GroupID string, DataName string, ImageName string, Title string, DataType int) error
InsertDataData insert data data to data table
func InsertUserData ¶
InsertUserData i nsert user data to users table
func UpdateGroupID ¶
UpdateGroupID update database's user's GroupID
func UpdateLineID ¶
UpdateLineID update database's user's LIneID
Types ¶
type Data ¶
type Data struct { gorm.Model UserID int `grom:"primary_key:true"` GroupID string `gorm:"not null"` DataName string `gorm:"primary_key"` ImageName string Title string DataType int `gorm:"not null"` }
Data struct define data table's struct
type Model ¶
type Model struct { ID uint `gorm:"primary_key"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` }
Model base model definition, including fields `ID`, `CreatedAt`, `UpdatedAt`, `DeletedAt`, which could be embedded in your models
type Result ¶
type Result struct { UserID int UserName string GroupID string DataName string ImageName string Title string DataType int }
Result struct define return data's list
func FindAllDataInGroup ¶
FindAllDataInGroup return all data information of GroupID
type User ¶
type User struct { gorm.Model UserName string `gorm:"not null"` Password string `gorm:"not null"` Mail string `gorm:"not null"` GroupID string `gorm:"not null"` LineID string `gorm:"default:null"` }
User struct define users table's struct
func RetUserStruct ¶
RetUserStruct return user as struct