| | |
| | | package test |
| | | |
| | | import ( |
| | | "github.com/flipped-aurora/gin-vue-admin/server/global" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" |
| | | "github.com/flipped-aurora/gin-vue-admin/server/model/test" |
| | | testReq "github.com/flipped-aurora/gin-vue-admin/server/model/test/request" |
| | | "srm/global" |
| | | "srm/model/common/request" |
| | | "srm/model/test" |
| | | testReq "srm/model/test/request" |
| | | ) |
| | | |
| | | type IndustryService struct { |
| | |
| | | // UpdateIndustry 更新Industry记录 |
| | | // Author [piexlmax](https://github.com/piexlmax) |
| | | func (iService *IndustryService) UpdateIndustry(i test.Industry) (err error) { |
| | | err = global.GVA_DB.Save(&i).Error |
| | | err = global.GVA_DB.Updates(&i).Error |
| | | return err |
| | | } |
| | | |
| | |
| | | err = db.Limit(limit).Offset(offset).Find(&is).Error |
| | | return is, total, err |
| | | } |
| | | |
| | | func (iService *IndustryService) DeleteAll() (err error) { |
| | | err = global.GVA_DB.Where("1=1").Delete(&[]test.Industry{}).Error |
| | | return err |
| | | } |