Documentation ¶
Index ¶
- Variables
- func AddUser(LineName, UserID string, course *sql.Tx) (DBErr error)
- func Begin(course *sql.Tx) (*sql.Tx, bool, error)
- func Close() error
- func Commit(course *sql.Tx, selfCourse bool) error
- func CreateGroupTable(course *sql.Tx) (err error)
- func CreateImage(UserID string, Images []ImgInfo) error
- func CreateImageTable(course *sql.Tx) (err error)
- func CreateLine(LineName, UserID string) error
- func CreateLineTable(course *sql.Tx) (err error)
- func CreateSlice(LineName, UserID string, Gallery []string, ...) error
- func CreateSliceTable(course *sql.Tx) (err error)
- func CreateUser(Phone, Mail, HashPass string, OpenID, UnionID *string) (NickName, Pass string, ErrorMsg error)
- func CreateUserTable(course *sql.Tx) (err error)
- func GetImgInfo(UserID, Hash string) (Size, Height, Width int, Time time.Time, err error)
- func GetLineDetail(LineName string, course *sql.Tx) (LineID, Name, LatestImg string, Users []string, SliceNum, ImgNum int, ...)
- func GetLineInfo(LineName string, course *sql.Tx) (LineID, Name string, CreateTime time.Time, DBErr error)
- func GetLines(UserID string) (Lines []string, DBerr error)
- func GetUserByMail(Mail string) (ID, Phone, NickName, Gender, Salt, SaltPass, ProfilePic string, ...)
- func GetUserByOpenID(OpenID string) (ID, UnionID, Phone, Mail, NickName, Gender, Salt, SaltPass, ProfilePic string, ...)
- func GetUserByPhone(Phone string, course *sql.Tx) (ID, Mail, NickName, Gender, Salt, SaltPass, ProfilePic string, ...)
- func GraceCommit(course *sql.Tx, selfCourse bool, err error) error
- func Open() error
- func Rollback(course *sql.Tx, selfCourse bool) error
- func UpdateImgVisibility(UserID, ImgHash, Visibility string, course *sql.Tx) (ErrorMsg error)
- func UpdateNickName(UserID, NewName string, course *sql.Tx) (DBErr error)
- func UpdateProfilePic(UserID, ImgHash string) (ErrorMsg error)
- func UpdateWeiXin(OpenID, Phone, Mail string, UnionID *string) (DBErr error)
- type ImgInfo
- type SliceInfo
Constants ¶
This section is empty.
Variables ¶
var DataBase *sql.DB
DataBase is global database var
Functions ¶
func CreateGroupTable ¶
CreateGroupTable Create Group Table, Group recoder the relation between user and line
func CreateImage ¶
CreateImage will mark a group of img one by one belong to a user
func CreateImageTable ¶
CreateImageTable Create image Table, image recoder the image TODO: to recoder img size
func CreateLine ¶
CreateLine Create Line and add a user to it's group
func CreateLineTable ¶
CreateLineTable Create Line Table
func CreateSlice ¶
func CreateSlice(LineName, UserID string, Gallery []string, Content, Type, Visibility, Location, Time string) error
CreateSlice Create Slice
func CreateSliceTable ¶
CreateSliceTable Create Slice Table, Slice is the unite in the line, it has two basic type, memory and Anniversary the visibillty Protect means only people join this group can view, Private means only people create this slice can view
func CreateUser ¶
func CreateUser(Phone, Mail, HashPass string, OpenID, UnionID *string) (NickName, Pass string, ErrorMsg error)
CreateUser create a unverify user
func CreateUserTable ¶
CreateUserTable Create User Table
func GetImgInfo ¶
func GetLineDetail ¶
func GetLineDetail(LineName string, course *sql.Tx) (LineID, Name, LatestImg string, Users []string, SliceNum, ImgNum int, CreateTime, LatestTime time.Time, DBErr error)
GetLineDetail Get some statics info of line contain info of GetLineInfo
func GetLineInfo ¶
func GetLineInfo(LineName string, course *sql.Tx) (LineID, Name string, CreateTime time.Time, DBErr error)
GetLineInfo Get Line Info
func GetUserByMail ¶
func GetUserByMail(Mail string) (ID, Phone, NickName, Gender, Salt, SaltPass, ProfilePic string, SignInTime time.Time, ErrorMsg error)
GetUserByMail Found User By Mail
func GetUserByOpenID ¶
func GetUserByPhone ¶
func GetUserByPhone(Phone string, course *sql.Tx) (ID, Mail, NickName, Gender, Salt, SaltPass, ProfilePic string, SignInTime time.Time, DBErr error)
GetUserByPhone Found User By Phone Err : DataBase Connection Error User Not Exist DBErr
func GraceCommit ¶
GraceCommit will automitic commit or rollback
func UpdateImgVisibility ¶
func UpdateNickName ¶
UpdateNickName Update User NickName
func UpdateProfilePic ¶
UpdateProfilePic Update ProfilePicture Mention this func will set img Visibility to Public