entity

package
v0.0.0-...-a2d17c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addparticipator

func Addparticipator(title string, participator []string) bool

* * add participator into the meetings created by sponsor * @param title meeting's title * @return if success, true will be returned

func CreateMeeting

func CreateMeeting(userName, title, startDate, endDate string, participator []string) bool

*

  • create a meeting
  • @param userName the sponsor's userName
  • @param title the meeting's title
  • @param participator the meeting's participator
  • @param startData the meeting's start date
  • @param endData the meeting's end date
  • @return if success, true will be returned

func CreateMeeting_DB

func CreateMeeting_DB(meeting *Meeting) error

对未存在的会议进行插入,若存在则返回错误

func CreateUser_DB

func CreateUser_DB(user *User) error

对未存在的用户进行插入,若存在则返回错误

func DeleteAllMeetings

func DeleteAllMeetings(name string) bool

* * delete all meetings by sponsor * @param userName sponsor's username * @return if success, true will be returned

func DeleteMeeting

func DeleteMeeting(name, title string) bool

* * delete a meeting by title and its sponsor * @param userName sponsor's username * @param title meeting's title * @return if success, true will be returned

func DeleteMeeting_DB

func DeleteMeeting_DB(meeting *Meeting) error

删除会议

func DeleteUser

func DeleteUser(userName string, password string) bool

*

  • delete a user
  • @param userName user's username
  • @param password user's password
  • @return if success, true will be returned

func DeleteUser_DB

func DeleteUser_DB(user *User) error

删除用户

func GetJson

func GetJson(v interface{}) string

getJson

func IntToString

func IntToString(a int) string

func QuitMeeting

func QuitMeeting(title string) bool

* * CurrentUser quits meeting in which the currentUser participate * @param title meeting's title * @return if success, true will be returned

func ReadCurrentUser

func ReadCurrentUser()

func ReadFromDb

func ReadFromDb()

ReadFromDb .

func Removeparticipator

func Removeparticipator(title string, participator []string) bool

* * remove participator from the meetings created by sponsor * @param title meeting's title * @return if success, true will be returned

func StartAgenda

func StartAgenda() bool

func UpdateMeeting_DB

func UpdateMeeting_DB(meeting *Meeting) error

func UpdateUser_DB

func UpdateUser_DB(user *User) error

更新用户

func UserLogIn

func UserLogIn(userName string, password string) bool

* * check if the username match password * @param userName the username want to login * @param password the password user enter * @return if success, true will be returned

登录命令不需要调用StartAgenda,但需要调用QuitAgenda来保存登录信息

func UserRegister

func UserRegister(userName, password, email, phone string) bool

*

  • regist a user
  • @param userName new user's username
  • @param password new user's password
  • @param email new user's email
  • @param phone new user's phone
  • @return if success, true will be returned

Types

type Date

type Date struct {
	Year   int
	Month  int
	Day    int
	Hour   int
	Minute int
}

func (Date) GreaterOrEqual

func (m Date) GreaterOrEqual(t_date Date) bool

func (Date) SmallerOrEqual

func (m Date) SmallerOrEqual(t_date Date) bool

type Meeting

type Meeting struct {
	Sponsor       string
	Title         string
	StartDate     string
	EndDate       string
	Participators []string
}

func FindAllMeeting

func FindAllMeeting() ([]Meeting, error)

得到所有会议数据

func ListAllMeetings

func ListAllMeetings(name string) []Meeting

* * list all meetings the user take part in * @param userName user's username * @return a meeting list result

func ListAllParticipateMeetings

func ListAllParticipateMeetings(name string) []Meeting

* * list all meetings the user take part in and sponsor by other * @param userName user's username * @return a meeting list result

func ListAllSponsorMeetings

func ListAllSponsorMeetings(name string) []Meeting

* * delete a meeting by title and its sponsor * @param userName sponsor's username * @param title meeting's title * @return if success, true will be returned

func MeetingQuery

func MeetingQuery(sponsor, startDate, endDate string) []Meeting

* * search a meeting by username, time interval (user as sponsor or participator) * @param uesrName the user's userName * @param startDate time interval's start date * @param endDate time interval's end date * @return a meeting list result

type MeetingTable

type MeetingTable struct {
	Title         string `xorm:"pk varchar(255) notnull "`
	Sponsor       string `xorm:"varchar(255) notnull"`
	StartTime     string `xorm:"varchar(255) notnull"`
	EndTime       string `xorm:"varchar(255) notnull"`
	Participators string `xorm:"varchar(255) notnull"`
}

type User

type User struct {
	Name     string
	Password string
	Email    string
	Phone    string
}
var CurrentUser User

func FindAllUser

func FindAllUser() ([]User, error)

得到所有用户数据

func FindUserByName

func FindUserByName(name string) User

得到所有用户数据

func ListAllUsers

func ListAllUsers() []User

*

  • list all users from storage
  • @return a user list result

func (*User) InitUser

func (m *User) InitUser(t_userName, t_userPassword, t_userEmail, t_userPhone string)

type UserTable

type UserTable struct {
	UserName string `xorm:"pk varchar(255) notnull "`
	Password string `xorm:"varchar(255) notnull"`
	Email    string `xorm:"varchar(255) notnull"`
	Phone    string `xorm:"varchar(255) notnull"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL