Documentation ¶
Index ¶
- Variables
- func InitDB()
- type Devices
- func (c Devices) Borrow(user_id int64, device_id int64) revel.Result
- func (c Devices) Create(name string, manufacturer string, carrier string, os string, size string, ...) revel.Result
- func (c Devices) FindAfterCreateDeviceState(user m.User, device m.Device, state bool) []m.DeviceState
- func (c Devices) List() revel.Result
- func (c Devices) Return(user_id int64, device_id int64) revel.Result
- func (c Devices) Update(device_id int64, name string, manufacturer string, carrier string, os string, ...) revel.Result
- type GormController
- type Users
Constants ¶
This section is empty.
Variables ¶
View Source
var Gdb gorm.DB
it can be used for jobs
Functions ¶
Types ¶
type Devices ¶
type Devices struct {
GormController
}
func (Devices) Borrow ¶
Deviceを特定のユーザーに貸し出す @param userId:ユーザ-ID @param deviceId:端末ID return data{sucess, device}
func (Devices) Create ¶
func (c Devices) Create(name string, manufacturer string, carrier string, os string, size string, resolution string, memory string, dateOfRelease int64, other string) revel.Result
Deviceを作成 @param name:機種名 @param manufacturer:メーカー @param carrier:キャリア @param os:OS @param size:サイズ @param resolution:解像度 @param memory:メモリ @param dateOfRelease:発売日 @param other:その他 return data{sucess, device}
func (Devices) FindAfterCreateDeviceState ¶
func (c Devices) FindAfterCreateDeviceState(user m.User, device m.Device, state bool) []m.DeviceState
履歴を追加する @param deviceStates:端末の貸し出し履歴 @param user:ユーザ- @param device_id:端末ID return deviceStates
func (Devices) Return ¶
ユーザーがDeviceを返却する @param userId:ユーザ-ID @param deviceId:端末ID return data{sucess, device}
func (Devices) Update ¶
func (c Devices) Update(device_id int64, name string, manufacturer string, carrier string, os string, size string, resolution string, memory string, dateOfRelease int64, other string) revel.Result
Deviceを更新 @param device_id:ID @param name:機種名 @param manufacturer:メーカー @param carrier:キャリア @param os:OS @param size:サイズ @param resolution:解像度 @param memory:メモリ @param dateOfRelease:発売日 @param other:その他 return data{sucess, device}
type GormController ¶
type GormController struct { *r.Controller Txn *gorm.DB }
type: revel controller with `gorm.DB` c.Txn will keep `db gorm.DB`
func (*GormController) Begin ¶
func (c *GormController) Begin() r.Result
This method fills the c.Txn before each transaction
func (*GormController) Commit ¶
func (c *GormController) Commit() r.Result
This method clears the c.Txn after each transaction
func (*GormController) Rollback ¶
func (c *GormController) Rollback() r.Result
This method clears the c.Txn after each transaction, too
type Users ¶
type Users struct {
GormController
}
Click to show internal directories.
Click to hide internal directories.