12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package service
- import (
- "ulink-admin/modules/car/dao"
- "ulink-admin/modules/car/models/model"
- "ulink-admin/modules/car/models/req"
- )
- type RunService struct {
- RunDao *dao.RunDao `inject:""`
- }
- // List 查询所有营运记录业务方法
- func (this RunService) List(query *req.RunQuery, list interface{}) {
- this.RunDao.List(query, list)
- }
- // Page 查询营运记录分页列表
- func (this RunService) Page(query *req.RunQuery) (*[]model.Run, int64) {
- return this.RunDao.Page(query)
- }
- // Insert 添加营运记录
- func (this RunService) Insert(run *model.Run) {
- this.RunDao.Insert(run)
- }
- // Get 查询
- func (this RunService) Get(id int64) *model.Run {
- model := &model.Run{}
- this.RunDao.GetById(id, model)
- return model
- }
- // Delete 批量删除
- func (this RunService) Delete(list []int64) {
- this.RunDao.Delete(&model.Run{}, list)
- }
- // Edit 修改
- func (this RunService) Edit(run *model.Run, cols []string) {
- this.RunDao.Update(run, cols...)
- }
|