// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/api/base/bean/State.java
// public class State implements Serializable {
//     /**
//      * ok : 1
//      */
// 
//     private int ok;
// 
//     public int getOk() {
//         return ok;
//     }
// 
//     public void setOk(int ok) {
//         this.ok = ok;
//     }
// }
// 
// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/api/login/bean/Token.java
// public class Token implements Serializable {
// 
//     private String access_token;     // 用户令牌(获取相关数据使用)
//     private String token_type;       // 令牌类型
//     private int expires_in;          // 过期时间
//     private String refresh_token;    // 刷新令牌(获取新的令牌)
//     private int created_at;          // 创建时间
// 
//     public String getAccess_token() {
//         return access_token;
//     }
// 
//     public void setAccess_token(String access_token) {
//         this.access_token = access_token;
//     }
// 
//     public String getToken_type() {
//         return token_type;
//     }
// 
//     public void setToken_type(String token_type) {
//         this.token_type = token_type;
//     }
// 
//     public int getExpires_in() {
//         return expires_in;
//     }
// 
//     public void setExpires_in(int expires_in) {
//         this.expires_in = expires_in;
//     }
// 
//     public String getRefresh_token() {
//         return refresh_token;
//     }
// 
//     public void setRefresh_token(String refresh_token) {
//         this.refresh_token = refresh_token;
//     }
// 
//     public int getCreated_at() {
//         return created_at;
//     }
// 
//     public void setCreated_at(int created_at) {
//         this.created_at = created_at;
//     }
// 
//     @Override
//     public String toString() {
//         return "Token{" +
//                 "access_token='" + access_token + '\'' +
//                 ", token_type='" + token_type + '\'' +
//                 ", expires_in=" + expires_in +
//                 ", refresh_token='" + refresh_token + '\'' +
//                 ", created_at=" + created_at +
//                 '}';
//     }
// }
// 
// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/utils/Constant.java
// public class Constant {
//     // 网络相关
//     public static final String BASE_URL = "https://diycode.cc/api/v3/";
//     public static final String OAUTH_URL = "https://www.diycode.cc/oauth/token";
// }


import retrofit2.http.POST;
import com.gcssloop.diycode_sdk.api.base.bean.State;
import com.gcssloop.diycode_sdk.api.login.bean.Token;
import com.gcssloop.diycode_sdk.utils.Constant;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
/*
 * Copyright 2017 GcsSloop
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Last modified 2017-03-08 01:01:18
 *
 * GitHub:  https://github.com/GcsSloop
 * Website: http://www.gcssloop.com
 * Weibo:   http://weibo.com/GcsSloop
 */

package com.gcssloop.diycode_sdk.api.login.api;



interface LoginService {

    //--- Token ------------------------------------------------------------------------------------

    /**
     * 获取 Token (一般在登录时调用)
     *
     * @param client_id     客户端 id
     * @param client_secret 客户端私钥
     * @param grant_type    授权方式 - 密码
     * @param username      用户名
     * @param password      密码
     * @return Token 实体类
     */
    @POST(Constant.OAUTH_URL)
    @FormUrlEncoded
// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/api/base/bean/State.java
// public class State implements Serializable {
//     /**
//      * ok : 1
//      */
// 
//     private int ok;
// 
//     public int getOk() {
//         return ok;
//     }
// 
//     public void setOk(int ok) {
//         this.ok = ok;
//     }
// }
// 
// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/api/login/bean/Token.java
// public class Token implements Serializable {
// 
//     private String access_token;     // 用户令牌(获取相关数据使用)
//     private String token_type;       // 令牌类型
//     private int expires_in;          // 过期时间
//     private String refresh_token;    // 刷新令牌(获取新的令牌)
//     private int created_at;          // 创建时间
// 
//     public String getAccess_token() {
//         return access_token;
//     }
// 
//     public void setAccess_token(String access_token) {
//         this.access_token = access_token;
//     }
// 
//     public String getToken_type() {
//         return token_type;
//     }
// 
//     public void setToken_type(String token_type) {
//         this.token_type = token_type;
//     }
// 
//     public int getExpires_in() {
//         return expires_in;
//     }
// 
//     public void setExpires_in(int expires_in) {
//         this.expires_in = expires_in;
//     }
// 
//     public String getRefresh_token() {
//         return refresh_token;
//     }
// 
//     public void setRefresh_token(String refresh_token) {
//         this.refresh_token = refresh_token;
//     }
// 
//     public int getCreated_at() {
//         return created_at;
//     }
// 
//     public void setCreated_at(int created_at) {
//         this.created_at = created_at;
//     }
// 
//     @Override
//     public String toString() {
//         return "Token{" +
//                 "access_token='" + access_token + '\'' +
//                 ", token_type='" + token_type + '\'' +
//                 ", expires_in=" + expires_in +
//                 ", refresh_token='" + refresh_token + '\'' +
//                 ", created_at=" + created_at +
//                 '}';
//     }
// }
// 
// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/utils/Constant.java
// public class Constant {
//     // 网络相关
//     public static final String BASE_URL = "https://diycode.cc/api/v3/";
//     public static final String OAUTH_URL = "https://www.diycode.cc/oauth/token";
// }


// Path: sdk/src/main/java/com/gcssloop/diycode_sdk/api/login/api/LoginService.java
import retrofit2.http.POST;
import com.gcssloop.diycode_sdk.api.base.bean.State;
import com.gcssloop.diycode_sdk.api.login.bean.Token;
import com.gcssloop.diycode_sdk.utils.Constant;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;

/*
 * Copyright 2017 GcsSloop
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Last modified 2017-03-08 01:01:18
 *
 * GitHub:  https://github.com/GcsSloop
 * Website: http://www.gcssloop.com
 * Weibo:   http://weibo.com/GcsSloop
 */

package com.gcssloop.diycode_sdk.api.login.api;



interface LoginService {

    //--- Token ------------------------------------------------------------------------------------

    /**
     * 获取 Token (一般在登录时调用)
     *
     * @param client_id     客户端 id
     * @param client_secret 客户端私钥
     * @param grant_type    授权方式 - 密码
     * @param username      用户名
     * @param password      密码
     * @return Token 实体类
     */
    @POST(Constant.OAUTH_URL)
    @FormUrlEncoded
    Call<Token> getToken(