// Path: app/src/main/java/com/haogefeifei/odoo/common/utils/Page.java
// public class Page {
// 
//     // 1.每页显示数量(everyPage)
//     private int everyPage;
//     //2.当前页(currentPage)
//     private int currentPage;
// 
//     public Page(int everyPage, int currentPage) {
//         this.everyPage = everyPage;
//         this.currentPage = currentPage;
//     }
// 
//     //构造函数，默认
//     //构造方法，对所有属性进行设置
//     public Page() {
//         this.currentPage = 1;
//         this.everyPage = 30;
//     }
// 
//     public int getEveryPage() {
//         return everyPage;
//     }
// 
//     public void setEveryPage(int everyPage) {
//         this.everyPage = everyPage;
//     }
// 
//     public int getCurrentPage() {
//         return currentPage;
//     }
// 
//     public void setCurrentPage(int currentPage) {
//         this.currentPage = currentPage;
//     }
// 
// 
// }


import com.haogefeifei.odoo.common.utils.Page;
import java.util.HashMap;
package com.haogefeifei.odoo.api.inf;



/**
 * Created by feifei on 15/12/27.
 */
public interface RpcApiInf {

    /**
     * 登录
     *
     * @return 结果代码
     */
    public int Connect() throws OdooRpcException;


    /**
     * 登录
     *
     * @param username
     * @param password
     * @return
     * @throws OdooRpcException
     */
    public int Connect(String username, String password) throws OdooRpcException;


    /**
     * 登录验证
     *
     * @param password
     * @return
     */
    public int confirmationPassWord(String password) throws OdooRpcException;

    /**
     * 查询记录总数
     *
     * @param model
     * @param filters
     * @return
     */
    public Object getCount(String model, Object[] filters) throws OdooRpcException;


    /**
     * 创建对象
     *
     * @param model
     * @param values
     * @return
     */
    public int createObject(String model, HashMap<String, Object> values) throws OdooRpcException;


    /**
     * 修改
     *
     * @param model
     * @param values
     * @return
     */
    public Object writeObject(String model, Object[] ids, HashMap<String, Object> values) throws OdooRpcException;


    /**
     * 读取数据
     *
     * @param model
     * @param ids
     * @param fields
     * @return
     */
    public Object[] readData(String model, Object[] ids, Object[] fields) throws OdooRpcException;


    /**
     * 查询
     *
     * @param model   要查询的对象
     * @param filters 查询过滤条件
     */
    public Object[] searchObject(String model, Object[] filters) throws OdooRpcException;

    /**
     * 查询
     *
     * @param model   要查询的对象
     * @param filters 查询过滤条件
     * @param page    分页对象
     */
// Path: app/src/main/java/com/haogefeifei/odoo/common/utils/Page.java
// public class Page {
// 
//     // 1.每页显示数量(everyPage)
//     private int everyPage;
//     //2.当前页(currentPage)
//     private int currentPage;
// 
//     public Page(int everyPage, int currentPage) {
//         this.everyPage = everyPage;
//         this.currentPage = currentPage;
//     }
// 
//     //构造函数，默认
//     //构造方法，对所有属性进行设置
//     public Page() {
//         this.currentPage = 1;
//         this.everyPage = 30;
//     }
// 
//     public int getEveryPage() {
//         return everyPage;
//     }
// 
//     public void setEveryPage(int everyPage) {
//         this.everyPage = everyPage;
//     }
// 
//     public int getCurrentPage() {
//         return currentPage;
//     }
// 
//     public void setCurrentPage(int currentPage) {
//         this.currentPage = currentPage;
//     }
// 
// 
// }


// Path: app/src/main/java/com/haogefeifei/odoo/api/inf/RpcApiInf.java
import com.haogefeifei.odoo.common.utils.Page;
import java.util.HashMap;

package com.haogefeifei.odoo.api.inf;



/**
 * Created by feifei on 15/12/27.
 */
public interface RpcApiInf {

    /**
     * 登录
     *
     * @return 结果代码
     */
    public int Connect() throws OdooRpcException;


    /**
     * 登录
     *
     * @param username
     * @param password
     * @return
     * @throws OdooRpcException
     */
    public int Connect(String username, String password) throws OdooRpcException;


    /**
     * 登录验证
     *
     * @param password
     * @return
     */
    public int confirmationPassWord(String password) throws OdooRpcException;

    /**
     * 查询记录总数
     *
     * @param model
     * @param filters
     * @return
     */
    public Object getCount(String model, Object[] filters) throws OdooRpcException;


    /**
     * 创建对象
     *
     * @param model
     * @param values
     * @return
     */
    public int createObject(String model, HashMap<String, Object> values) throws OdooRpcException;


    /**
     * 修改
     *
     * @param model
     * @param values
     * @return
     */
    public Object writeObject(String model, Object[] ids, HashMap<String, Object> values) throws OdooRpcException;


    /**
     * 读取数据
     *
     * @param model
     * @param ids
     * @param fields
     * @return
     */
    public Object[] readData(String model, Object[] ids, Object[] fields) throws OdooRpcException;


    /**
     * 查询
     *
     * @param model   要查询的对象
     * @param filters 查询过滤条件
     */
    public Object[] searchObject(String model, Object[] filters) throws OdooRpcException;

    /**
     * 查询
     *
     * @param model   要查询的对象
     * @param filters 查询过滤条件
     * @param page    分页对象
     */
    public Object[] searchObject(String model, Object[] filters, Page page) throws OdooRpcException;