controllers

package
v0.0.0-...-7071d43 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gdb gorm.DB

it can be used for jobs

Functions

func InitDB

func InitDB()

init db

Types

type Devices

type Devices struct {
	GormController
}

func (Devices) Borrow

func (c Devices) Borrow(user_id int64, device_id int64) revel.Result
	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) List

func (c Devices) List() revel.Result
	Deviceのリストを取得
 	return data{sucess, devices}

func (Devices) Return

func (c Devices) Return(user_id int64, device_id int64) revel.Result
	ユーザーが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
}

func (Users) Create

func (c Users) Create(username string) revel.Result
	Userを作成
 	@param username:ユーザーネーム
 	return data{sucess, user}

func (Users) List

func (c Users) List() revel.Result
	Userのリストを取得
 	return data{sucess, users}

func (Users) Update

func (c Users) Update(user_id int64, username string) revel.Result
	Userを更新
	@param user_id:ID
 	@param username:ユーザーネーム
 	return data{sucess, user}

Jump to

Keyboard shortcuts

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