service.template 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // ==========================================================================
  2. // 生成日期:{{.table.CreateTime}}
  3. // 生成人:{{.table.FunctionAuthor}}
  4. // ==========================================================================
  5. package {{.table.BusinessName}}
  6. import (
  7. {{.table.BusinessName}}Model "{{.table.PackageName}}/app/model/{{.table.ModuleName}}/{{.table.BusinessName}}"
  8. )
  9. // 添加
  10. func AddSave(req *{{.table.BusinessName}}Model.AddReq) error {
  11. return {{.table.BusinessName}}Model.AddSave(req)
  12. }
  13. // 删除
  14. func DeleteByIds(Ids []int) error {
  15. return {{.table.BusinessName}}Model.DeleteByIds(Ids)
  16. }
  17. //修改
  18. func EditSave(editReq *{{.table.BusinessName}}Model.EditReq) error {
  19. return {{.table.BusinessName}}Model.EditSave(editReq)
  20. }
  21. // 根据ID查询
  22. func GetByID(id int64) (*{{.table.BusinessName}}Model.Entity, error) {
  23. return {{.table.BusinessName}}Model.GetByID(id)
  24. }
  25. // 分页查询
  26. func SelectListByPage(req *{{.table.BusinessName}}Model.SelectPageReq) (total int, page int64, list []*{{.table.BusinessName}}Model.Entity, err error) {
  27. return {{.table.BusinessName}}Model.SelectListByPage(req)
  28. }