Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
hzwy23 committed Jul 9, 2017
1 parent 554cc12 commit a81d201
Show file tree
Hide file tree
Showing 41 changed files with 57 additions and 73 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified hauth/bin/src/main/java/com/asofdate/hauth/dao/RoleDao.class
Binary file not shown.
Binary file not shown.
Binary file modified hauth/bin/src/main/java/com/asofdate/hauth/dao/UserDao.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import com.asofdate.hauth.dto.LoginMsgDTO;
import com.asofdate.utils.Hret;
import com.asofdate.utils.SysStatus;
import com.google.gson.GsonBuilder;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.AuthenticationManager;
Expand Down Expand Up @@ -76,7 +74,7 @@ protected void unsuccessfulAuthentication(
response.setContentType("application/json");
response.setStatus(HttpServletResponse.SC_FORBIDDEN);

LoginMsgDTO loginMsgDTO = new GsonBuilder().create().fromJson(failed.getMessage(),LoginMsgDTO.class);
LoginMsgDTO loginMsgDTO = new GsonBuilder().create().fromJson(failed.getMessage(), LoginMsgDTO.class);
String retMsg = Hret.error(loginMsgDTO.getRetCode(), loginMsgDTO.getMessage(), loginMsgDTO);
response.getOutputStream().println(retMsg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public PagingDto<List<HandleLogEntity>> getAll(HttpServletRequest request) {
List<HandleLogEntity> list = handleLogService.findAll(domainId, Integer.parseInt(offset), Integer.parseInt(limit));

Integer total = handleLogService.getTotal(domainId);
return new PagingDto<List<HandleLogEntity>>(total,list);
return new PagingDto<List<HandleLogEntity>>(total, list);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.asofdate.utils.RetMsg;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
Expand Down Expand Up @@ -74,9 +73,11 @@ public String update(HttpServletResponse response, HttpServletRequest request) {
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public String delete(HttpServletResponse response, HttpServletRequest request) {
String json = request.getParameter("JSON");
List<OrgEntity> list = new GsonBuilder().create().fromJson(json,
new TypeToken<List<OrgEntity>>(){}.getType());;
for (OrgEntity m:list) {
List<OrgEntity> list = new GsonBuilder().create().fromJson(json,
new TypeToken<List<OrgEntity>>() {
}.getType());
;
for (OrgEntity m : list) {

String orgId = m.getOrg_id();
String domainId = m.getDomain_id();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public String changeTheme(HttpServletResponse response, HttpServletRequest reque
try {
int code = jdbcTemplate.update(SqlDefine.sys_rdbms_024, themeId, username);
if (1 == code) {
return Hret.success(200,"modify theme info successfully",null);
return Hret.success(200, "modify theme info successfully", null);
} else {
response.setStatus(421);
return Hret.error(421,"modify user theme failed",null);
return Hret.error(421, "modify user theme failed", null);
}
} catch (Exception e) {
logger.info(e.getMessage());
response.setStatus(422);
return Hret.error(422,e.getMessage(),null);
return Hret.error(422, e.getMessage(), null);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.asofdate.hauth.dao;

import com.asofdate.hauth.entity.ShareDomainEntity;
import org.json.JSONArray;

import java.util.List;

Expand Down
2 changes: 0 additions & 2 deletions hauth/src/main/java/com/asofdate/hauth/dao/UserDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.asofdate.hauth.dto.UserDTO;
import com.asofdate.hauth.entity.UserEntity;
import org.json.JSONArray;
import org.json.JSONObject;

import java.util.List;

Expand Down
10 changes: 5 additions & 5 deletions hauth/src/main/java/com/asofdate/hauth/dao/impl/RoleDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public List<RoleEntity> getOwner(String userId) {
@Transactional
@Override
public int auth(List<UserRoleEntity> list, String modifyUserId) {
for (UserRoleEntity m:list) {
String userId =m.getUserId();
for (UserRoleEntity m : list) {
String userId = m.getUserId();
String roleId = m.getRoleId();
String uuid = JoinCode.join(userId, roleId);
jdbcTemplate.update(SqlDefine.sys_rdbms_096, uuid, roleId, userId, modifyUserId);
Expand All @@ -77,8 +77,8 @@ public int auth(List<UserRoleEntity> list, String modifyUserId) {
@Transactional
@Override
public int batchAuth(List<UserRoleEntity> list, String modifyUserId) {
for (UserRoleEntity m:list) {
String userId =m.getUserId();
for (UserRoleEntity m : list) {
String userId = m.getUserId();
String roleId = m.getRoleId();
String uuid = JoinCode.join(userId, roleId);
try {
Expand All @@ -94,7 +94,7 @@ public int batchAuth(List<UserRoleEntity> list, String modifyUserId) {
@Transactional
@Override
public int revoke(List<UserRoleEntity> list) {
for (UserRoleEntity m:list) {
for (UserRoleEntity m : list) {
String userId = m.getUserId();
String roleId = m.getRoleId();
String uuid = JoinCode.join(userId, roleId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.asofdate.hauth.dao.ShareDomainDao;
import com.asofdate.hauth.entity.ShareDomainEntity;
import com.asofdate.sql.SqlDefine;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
Expand Down Expand Up @@ -47,7 +45,7 @@ public int add(ShareDomainEntity shareDomainEntity) {
@Transactional
@Override
public int delete(List<ShareDomainEntity> list) {
for (ShareDomainEntity m:list) {
for (ShareDomainEntity m : list) {
jdbcTemplate.update(SqlDefine.sys_rdbms_087, m.getUuid());
}
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import com.asofdate.hauth.entity.UserEntity;
import com.asofdate.sql.SqlDefine;
import com.asofdate.utils.CryptoAES;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
Expand Down Expand Up @@ -84,7 +82,7 @@ public int add(UserEntity userEntity) {
@Transactional
@Override
public int delete(List<UserEntity> list) {
for (UserEntity m:list) {
for (UserEntity m : list) {
jdbcTemplate.update(SqlDefine.sys_rdbms_007,
m.getUser_id(),
m.getOrg_unit_id());
Expand Down
60 changes: 32 additions & 28 deletions hauth/src/main/java/com/asofdate/hauth/dto/PagingDto.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
package com.asofdate.hauth.dto;

public class PagingDto<T> {
public T rows;
public Integer total;

public PagingDto(){
}

public PagingDto(Integer total,T rows) {
this.rows = rows;
this.total = total;
}

public T getRows() {
return rows;
}
public void setRows(T rows) {
this.rows = rows;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
@Override
public String toString() {
return "PageDto [rows=" + rows + ", total=" + total + "]";
}

public T rows;
public Integer total;

public PagingDto() {
}

public PagingDto(Integer total, T rows) {
this.rows = rows;
this.total = total;
}

public T getRows() {
return rows;
}

public void setRows(T rows) {
this.rows = rows;
}

public Integer getTotal() {
return total;
}

public void setTotal(Integer total) {
this.total = total;
}

@Override
public String toString() {
return "PageDto [rows=" + rows + ", total=" + total + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.asofdate.hauth.entity.RoleEntity;
import com.asofdate.hauth.entity.UserRoleEntity;
import com.asofdate.utils.RetMsg;
import org.json.JSONArray;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.asofdate.hauth.service;

import com.asofdate.hauth.entity.ShareDomainEntity;
import org.json.JSONArray;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.asofdate.hauth.dto.UserDTO;
import com.asofdate.hauth.entity.UserEntity;
import org.json.JSONArray;
import org.json.JSONObject;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.asofdate.hauth.dao.ShareDomainDao;
import com.asofdate.hauth.entity.ShareDomainEntity;
import com.asofdate.hauth.service.ShareDomainService;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.asofdate.hauth.dto.UserDTO;
import com.asofdate.hauth.entity.UserEntity;
import com.asofdate.hauth.service.UserService;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand Down
6 changes: 3 additions & 3 deletions hauth/src/main/java/com/asofdate/utils/Hret.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public static String error(RetMsg retMsg) {
}

public static String error(int status, String message, Object result) {
HerrorEntity herrorEntity = new HerrorEntity(status,message,result);
HerrorEntity herrorEntity = new HerrorEntity(status, message, result);
return new GsonBuilder().create().toJson(herrorEntity);
}

public static String success(int status, String message, Object result) {
HsuccessEntity hsuccessEntity = new HsuccessEntity(status,message,result);
HsuccessEntity hsuccessEntity = new HsuccessEntity(status, message, result);
return new GsonBuilder().create().toJson(hsuccessEntity);
}

Expand All @@ -28,7 +28,7 @@ public static String success(RetMsg retMsg) {
}

public static String success() {
HsuccessEntity hsuccessEntity = new HsuccessEntity(200,"success",null);
HsuccessEntity hsuccessEntity = new HsuccessEntity(200, "success", null);
return new GsonBuilder().create().toJson(hsuccessEntity);
}
}
2 changes: 1 addition & 1 deletion hauth/src/main/java/com/asofdate/utils/HsuccessEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public HsuccessEntity(RetMsg retMsg) {
this.data = retMsg.getDetails();
}

public HsuccessEntity(Integer reply_code,String reply_msg, Object data) {
public HsuccessEntity(Integer reply_code, String reply_msg, Object data) {
this.reply_code = reply_code;
this.reply_msg = reply_msg;
this.data = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletRe
String uri = httpServletRequest.getRequestURI();
Map<String, String[]> map = httpServletRequest.getParameterMap();

Map<String,String> dt = new HashMap<>();
Map<String, String> dt = new HashMap<>();
for (Map.Entry<String, String[]> m : map.entrySet()) {
if ("_".equals(m.getKey())) {
continue;
Expand Down
5 changes: 3 additions & 2 deletions hauth/src/main/java/com/asofdate/utils/ParseJson.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
* Created by hzwy23 on 2017/7/8.
*/
public class ParseJson<T> {
public List<T> toList(String json){
public List<T> toList(String json) {
return new GsonBuilder().create().fromJson(json,
new TypeToken<List<T>>(){}.getType());
new TypeToken<List<T>>() {
}.getType());
}
}
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@
<version>0.7.0</version>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>


<!--<dependency>-->
<!--<groupId>com.oracle</groupId>-->
<!--<artifactId>ojdbc6</artifactId>-->
Expand Down

0 comments on commit a81d201

Please sign in to comment.