1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package service
- import (
- "ulink-admin/modules/car/dao"
- "ulink-admin/modules/car/models/model"
- "ulink-admin/modules/car/models/req"
- )
- type CarService struct {
- CarDao *dao.CarDao `inject:""`
- }
- // List 查询所有车辆管理业务方法
- func (this CarService) List(query *req.CarQuery, list interface{}) {
- this.CarDao.List(query, list)
- }
- // Page 查询车辆管理分页列表
- func (this CarService) Page(query *req.CarQuery, list interface{}) int64 {
- return this.CarDao.Page(query, list)
- }
- // Insert 添加车辆管理
- func (this CarService) Insert(car *model.Car) {
- this.CarDao.Insert(car)
- }
- // Get 查询
- func (this CarService) Get(id int64) *model.Car {
- return this.CarDao.GetById(id, &model.Car{}).(*model.Car)
- }
- // Delete 批量删除
- func (this CarService) Delete(list []int64) {
- this.CarDao.Delete(&model.Car{}, list)
- }
- // Edit 修改
- func (this CarService) Edit(car *model.Car, cols []string) {
- this.CarDao.Update(car, cols...)
- }
|