Documentation ¶
Index ¶
- type IRouteRepository
- type RouteRepository
- func (u *RouteRepository) CreateRoute(route *model.Route) (int64, error)
- func (u *RouteRepository) DeleteRouteByID(routeID int64) error
- func (u *RouteRepository) FindAll() (routeAll []model.Route, err error)
- func (u *RouteRepository) FindRouteByID(routeID int64) (route *model.Route, err error)
- func (u *RouteRepository) InitTable() error
- func (u *RouteRepository) UpdateRoute(route *model.Route) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IRouteRepository ¶
type IRouteRepository interface { //初始化表 InitTable() error //根据ID查处找数据 FindRouteByID(int64) (*model.Route, error) //创建一条 route 数据 CreateRoute(*model.Route) (int64, error) //根据ID删除一条 route 数据 DeleteRouteByID(int64) error //修改更新数据 UpdateRoute(*model.Route) error //查找route所有数据 FindAll() ([]model.Route, error) }
创建需要实现的接口
type RouteRepository ¶
type RouteRepository struct {
// contains filtered or unexported fields
}
func (*RouteRepository) CreateRoute ¶
func (u *RouteRepository) CreateRoute(route *model.Route) (int64, error)
创建Route信息
func (*RouteRepository) DeleteRouteByID ¶
func (u *RouteRepository) DeleteRouteByID(routeID int64) error
根据ID删除Route信息
func (*RouteRepository) FindAll ¶
func (u *RouteRepository) FindAll() (routeAll []model.Route, err error)
获取结果集
func (*RouteRepository) FindRouteByID ¶
func (u *RouteRepository) FindRouteByID(routeID int64) (route *model.Route, err error)
根据ID查找Route信息
func (*RouteRepository) UpdateRoute ¶
func (u *RouteRepository) UpdateRoute(route *model.Route) error
更新Route信息
Click to show internal directories.
Click to hide internal directories.