Skip to content

Commit

Permalink
permission manager bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed May 3, 2017
1 parent 5acb7df commit c9fd65c
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 11 deletions.
1 change: 1 addition & 0 deletions CZBaseDevTool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,5 @@ private FormBody addParamsToFormBody(FormBody body, StringBuilder paramsBuilder)

return builder.build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 4 additions & 9 deletions app/src/main/java/xinyi/com/czdevmodule/Fragment1.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
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;
import com.xinyi.czbasedevtool.base.utils.ToastUtil;
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;
Expand Down Expand Up @@ -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<String, String> 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);
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -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<JobPositionBeanXX> list;

public int getCount() {
return count;
}

public void setCount(int count) {
this.count = count;
}

public List<JobPositionBeanXX> getList() {
return list;
}

public void setList(List<JobPositionBeanXX> 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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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 = "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -29,4 +31,7 @@ public interface UserAction {
@Multipart
@POST("index.php?g=people&m=company&a=company_save")
Observable<BaseHttpResultBean> getOrSaveCompanyInfo(@Part() List<MultipartBody.Part> parts);

@POST("index.php?g=people&m=index&a=index_get_job")
Observable<BaseHttpResultBean> fjHome(@Body RequestBean_FJHome requestBean_fjHome);
}

0 comments on commit c9fd65c

Please sign in to comment.