diff --git a/CZBaseDevTool/build.gradle b/CZBaseDevTool/build.gradle index ff94d80..eba4632 100644 --- a/CZBaseDevTool/build.gradle +++ b/CZBaseDevTool/build.gradle @@ -46,6 +46,7 @@ dependencies { compile 'com.squareup.okio:okio:1.6.0' compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2' compile 'com.alibaba:fastjson:1.1.54.android' + //load picture compile 'com.github.bumptech.glide:glide:3.7.0' //list-view diff --git a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/PermissionManager.java b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/PermissionManager.java index 8258c1a..dcae2e5 100644 --- a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/PermissionManager.java +++ b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/PermissionManager.java @@ -117,7 +117,7 @@ private void closeAllDialog(){ @TargetApi(Build.VERSION_CODES.KITKAT) public boolean isFloatWindowOpAllowed(Context context) { final int version = Build.VERSION.SDK_INT; - if (version >= 19) { + if (version >= 21) { return checkOp(context, 24); // AppOpsManager.OP_SYSTEM_ALERT_WINDOW } else { // if ((context.getApplicationInfo().flags & 1 << 27) == 1 << 27) { diff --git a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/CommonParamsInterceptor.java b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/CommonParamsInterceptor.java index 9f546c4..80f1595 100644 --- a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/CommonParamsInterceptor.java +++ b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/CommonParamsInterceptor.java @@ -120,4 +120,5 @@ private FormBody addParamsToFormBody(FormBody body, StringBuilder paramsBuilder) return builder.build(); } + } \ No newline at end of file diff --git a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/TokenAddInterceptor.java b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/TokenAddInterceptor.java index 4045e9b..fe4a64f 100644 --- a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/TokenAddInterceptor.java +++ b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/manager/net_about/TokenAddInterceptor.java @@ -36,7 +36,9 @@ public Response intercept(Chain chain) throws IOException { if (method.equals("GET")) { newRequest = originalRequest.newBuilder() .url(originalUrl + "&token=" + (token == null ? getToken() : token)) - .build(); + .build() + + ; } TLog.v(TAG, "intercept: url = " + newRequest.url()); return chain.proceed(newRequest); diff --git a/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java b/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java index fdf32e8..7cfa271 100644 --- a/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java +++ b/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java @@ -1,13 +1,11 @@ package xinyi.com.czdevmodule; import android.graphics.Color; -import android.os.Environment; import android.util.TypedValue; import android.view.Gravity; import android.view.View; import com.xinyi.czbasedevtool.base.bean.BaseHttpResponseBean; -import com.xinyi.czbasedevtool.base.bean.UploadFileWrapper; import com.xinyi.czbasedevtool.base.main.DefaultBaseFragment; import com.xinyi.czbasedevtool.base.manager.DataCleanManager; import com.xinyi.czbasedevtool.base.manager.net_about.RetrofitClient; @@ -15,10 +13,10 @@ import com.xinyi.czbasedevtool.base.view.ContentViewHolder; import com.xinyi.czbasedevtool.base.view.round.RoundTextView; -import java.io.File; import java.io.IOException; -import java.util.HashMap; +import xinyi.com.czdevmodule.net_test.retrofit.FJHomeBean; +import xinyi.com.czdevmodule.net_test.retrofit.RequestBean_FJHome; import xinyi.com.czdevmodule.net_test.retrofit.UserBean; import xinyi.com.czdevmodule.net_test.retrofit.action.UserAction; import xinyi.com.czdevmodule.net_test.retrofit.callback.IUserRegistCallBack; @@ -68,11 +66,8 @@ public void bindView(ContentViewHolder contentViewHolder) throws IOException { @Override public void onClick(View v) { RetrofitClient.setHasToken(true); - RetrofitClient.setBaseUrl("http://app.bestbeijing.top/"); - HashMap map = new HashMap<>(); - map.put("user_id","402"); - UploadFileWrapper logo = new UploadFileWrapper(new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/123.jpg"), "logo"); - uploadOneFileAndData(v,100,UserAction.class,"getOrSaveCompanyInfo",Object.class,map,logo,false); + RetrofitClient.setBaseUrl("http://personnel.haopeixun.org/"); + requestData(v,100, UserAction.class,"fjHome", FJHomeBean.class,new Object[]{new RequestBean_FJHome()},false); } }); diff --git a/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/FJHomeBean.java b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/FJHomeBean.java new file mode 100644 index 0000000..32bc456 --- /dev/null +++ b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/FJHomeBean.java @@ -0,0 +1,49 @@ +package xinyi.com.czdevmodule.net_test.retrofit; + +import java.util.List; + +/** + * Created by 陈章 on 2017/4/26 0026. + * func: + * 求职-首页实体类 + */ + +public class FJHomeBean { + private int p; + private int count; + private int total_pages; + + private List list; + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getP() { + return p; + } + + public void setP(int p) { + this.p = p; + } + + public int getTotal_pages() { + return total_pages; + } + + public void setTotal_pages(int total_pages) { + this.total_pages = total_pages; + } +} diff --git a/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/JobPositionBeanXX.java b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/JobPositionBeanXX.java new file mode 100644 index 0000000..b90f1f4 --- /dev/null +++ b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/JobPositionBeanXX.java @@ -0,0 +1,229 @@ +package xinyi.com.czdevmodule.net_test.retrofit; + +/** + * Created by 陈章 on 2017/4/26 0026. + * func:职位实体类 + */ + +public class JobPositionBeanXX { + private int company_job_id; + + private int position_id; + + private int company_id; + + private int salary_range_id; + + private String description; + + private String address_work; + + private int degree_id; + + private int work_year_id; + + private long time_create; + + private long time_update; + + private int profession_id; + + private int property_id; + + private String custom; + + private int positions_id; + + private String name_positions; + + private String profession_id_n; + + private String positions_id_n; + + private String salary_range_id_n; + + private String work_year_id_n; + + private String degree_id_n; + + private String address_work_province; + + private String address_work_city; + + + public String getAddress_work() { + return address_work; + } + + public void setAddress_work(String address_work) { + this.address_work = address_work; + } + + public String getAddress_work_city() { + return address_work_city; + } + + public void setAddress_work_city(String address_work_city) { + this.address_work_city = address_work_city; + } + + public String getAddress_work_province() { + return address_work_province; + } + + public void setAddress_work_province(String address_work_province) { + this.address_work_province = address_work_province; + } + + public int getCompany_id() { + return company_id; + } + + public void setCompany_id(int company_id) { + this.company_id = company_id; + } + + public String getCustom() { + return custom; + } + + public void setCustom(String custom) { + this.custom = custom; + } + + public int getDegree_id() { + return degree_id; + } + + public void setDegree_id(int degree_id) { + this.degree_id = degree_id; + } + + public String getDegree_id_n() { + return degree_id_n; + } + + public void setDegree_id_n(String degree_id_n) { + this.degree_id_n = degree_id_n; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getName_positions() { + return name_positions; + } + + public void setName_positions(String name_positions) { + this.name_positions = name_positions; + } + + public int getPosition_id() { + return position_id; + } + + public void setPosition_id(int position_id) { + this.position_id = position_id; + } + + public int getPositions_id() { + return positions_id; + } + + public void setPositions_id(int positions_id) { + this.positions_id = positions_id; + } + + public String getPositions_id_n() { + return positions_id_n; + } + + public void setPositions_id_n(String positions_id_n) { + this.positions_id_n = positions_id_n; + } + + public int getProfession_id() { + return profession_id; + } + + public void setProfession_id(int profession_id) { + this.profession_id = profession_id; + } + + public String getProfession_id_n() { + return profession_id_n; + } + + public void setProfession_id_n(String profession_id_n) { + this.profession_id_n = profession_id_n; + } + + public int getProperty_id() { + return property_id; + } + + public void setProperty_id(int property_id) { + this.property_id = property_id; + } + + public int getSalary_range_id() { + return salary_range_id; + } + + public void setSalary_range_id(int salary_range_id) { + this.salary_range_id = salary_range_id; + } + + public String getSalary_range_id_n() { + return salary_range_id_n; + } + + public void setSalary_range_id_n(String salary_range_id_n) { + this.salary_range_id_n = salary_range_id_n; + } + + public long getTime_create() { + return time_create; + } + + public void setTime_create(long time_create) { + this.time_create = time_create; + } + + public long getTime_update() { + return time_update; + } + + public void setTime_update(long time_update) { + this.time_update = time_update; + } + + public int getWork_year_id() { + return work_year_id; + } + + public void setWork_year_id(int work_year_id) { + this.work_year_id = work_year_id; + } + + public String getWork_year_id_n() { + return work_year_id_n; + } + + public void setWork_year_id_n(String work_year_id_n) { + this.work_year_id_n = work_year_id_n; + } + + public int getCompany_job_id() { + return company_job_id; + } + + public void setCompany_job_id(int company_job_id) { + this.company_job_id = company_job_id; + } +} diff --git a/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/RequestBean_FJHome.java b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/RequestBean_FJHome.java new file mode 100644 index 0000000..0599770 --- /dev/null +++ b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/RequestBean_FJHome.java @@ -0,0 +1,19 @@ +package xinyi.com.czdevmodule.net_test.retrofit; + +/** + * Created by 陈章 on 2017/4/13 0013. + * func: + * Retrofit请求实体类 + * 求职首页 + */ +public class RequestBean_FJHome { + public int p = 1; + public String address_work_province = "sdfsaf"; + public String address_work_city = ""; + public int company_property_id; + public int degree_id; + public int work_year_id; + public int salary_range_id; + public String profession_id = ""; + +} diff --git a/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/action/UserAction.java b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/action/UserAction.java index f521b62..47c6fa2 100644 --- a/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/action/UserAction.java +++ b/app/src/main/java/xinyi/com/czdevmodule/net_test/retrofit/action/UserAction.java @@ -5,12 +5,14 @@ import java.util.List; import okhttp3.MultipartBody; +import retrofit2.http.Body; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; import retrofit2.http.Multipart; import retrofit2.http.POST; import retrofit2.http.Part; import rx.Observable; +import xinyi.com.czdevmodule.net_test.retrofit.RequestBean_FJHome; /** * Created by 陈章 on 2017/4/8 0008. @@ -29,4 +31,7 @@ public interface UserAction { @Multipart @POST("index.php?g=people&m=company&a=company_save") Observable getOrSaveCompanyInfo(@Part() List parts); + + @POST("index.php?g=people&m=index&a=index_get_job") + Observable fjHome(@Body RequestBean_FJHome requestBean_fjHome); }