| | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (ContractService) GetContractList() ([]*model.Contract, int) { |
| | | list, err := model.NewContractSearch().FindAll() |
| | | if err != nil { |
| | | return nil, ecode.ContractListErr |
| | | } |
| | | |
| | | return list, ecode.OK |
| | | } |
| | | |
| | | func (ContractService) UpdateContract(contract *model.Contract) int { |
| | | // check contract exist |
| | | _, err := model.NewContractSearch().SetId(contract.Id).Find() |
| | |
| | | |
| | | return ecode.OK |
| | | } |
| | | |
| | | func (ContractService) GetContractList(page, pageSize int, keyword string) ([]*model.Contract, int) { |
| | | // get contact list |
| | | contacts, err := model.NewContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() |
| | | if err != nil { |
| | | return nil, ecode.ContractListErr |
| | | } |
| | | return contacts, ecode.OK |
| | | } |