File was renamed from service/serviceContracts.go |
| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (SContractService) GetServiceContractList() ([]*model.ServiceContract, int) { |
| | | list, err := model.NewServiceContractSearch().FindAll() |
| | | if err != nil { |
| | | return nil, ecode.SContractListErr |
| | | } |
| | | |
| | | return list, ecode.OK |
| | | } |
| | | |
| | | func (SContractService) UpdateServiceContract(serviceContract *model.ServiceContract) int { |
| | | // check serviceContract exist |
| | | _, err := model.NewServiceContractSearch().SetId(serviceContract.Id).Find() |
| | |
| | | |
| | | return list, ecode.OK |
| | | } |
| | | |
| | | func (SContractService) GetServiceContractList(page, pageSize int, keyword string) ([]*model.ServiceContract, int) { |
| | | // get contact list |
| | | contacts, err := model.NewServiceContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() |
| | | if err != nil { |
| | | return nil, ecode.SContractListErr |
| | | } |
| | | return contacts, ecode.OK |
| | | } |