提交 283c4a5b 编写于 作者: M MaxKey

mybatis-jpa-extra-2.7

上级 dc686cb0
...@@ -40,9 +40,11 @@ public class JsonPretty implements Pretty{ ...@@ -40,9 +40,11 @@ public class JsonPretty implements Pretty{
* @return String * @return String
*/ */
public String jacksonFormat(Object bean){ public String jacksonFormat(Object bean){
String prettyJson=""; String prettyJson = "";
try { try {
prettyJson= (new ObjectMapper()).writerWithDefaultPrettyPrinter().writeValueAsString(bean); prettyJson = (new ObjectMapper())
.writerWithDefaultPrettyPrinter()
.writeValueAsString(bean);
} catch (JsonGenerationException e) { } catch (JsonGenerationException e) {
e.printStackTrace(); e.printStackTrace();
} catch (JsonMappingException e) { } catch (JsonMappingException e) {
...@@ -59,7 +61,9 @@ public class JsonPretty implements Pretty{ ...@@ -59,7 +61,9 @@ public class JsonPretty implements Pretty{
* @return String * @return String
*/ */
public String format(Object bean){ public String format(Object bean){
Gson gson = new GsonBuilder().setPrettyPrinting().create(); Gson gson = new GsonBuilder()
.setPrettyPrinting()
.create();
String json = gson.toJson(bean); String json = gson.toJson(bean);
return json; return json;
} }
......
...@@ -26,13 +26,17 @@ import java.util.StringTokenizer; ...@@ -26,13 +26,17 @@ import java.util.StringTokenizer;
import org.maxkey.pretty.Pretty; import org.maxkey.pretty.Pretty;
public class SqlPretty implements Pretty{ public class SqlPretty implements Pretty{
public static final String WHITESPACE = " \n\r\f\t";
private static final Set<String> BEGIN_CLAUSES = new HashSet<String>(); public static final String WHITESPACE = " \n\r\f\t";
private static final Set<String> END_CLAUSES = new HashSet<String>(); private static final Set<String> BEGIN_CLAUSES = new HashSet<String>();
private static final Set<String> LOGICAL = new HashSet<String>(); private static final Set<String> END_CLAUSES = new HashSet<String>();
private static final Set<String> QUANTIFIERS = new HashSet<String>(); private static final Set<String> LOGICAL = new HashSet<String>();
private static final Set<String> DML = new HashSet<String>(); private static final Set<String> QUANTIFIERS = new HashSet<String>();
private static final Set<String> MISC = new HashSet<String>(); private static final Set<String> DML = new HashSet<String>();
private static final Set<String> MISC = new HashSet<String>();
private static final String INDENT_STRING = " ";
//mhshi modify
private static final String INITIAL = "";//System.lineSeparator() + INDENT_STRING;
static { static {
BEGIN_CLAUSES.add( "left" ); BEGIN_CLAUSES.add( "left" );
...@@ -72,10 +76,6 @@ public class SqlPretty implements Pretty{ ...@@ -72,10 +76,6 @@ public class SqlPretty implements Pretty{
MISC.add( "on" ); MISC.add( "on" );
} }
private static final String INDENT_STRING = " ";
//mhshi modify
private static final String INITIAL = "";//System.lineSeparator() + INDENT_STRING;
public SqlPretty() { public SqlPretty() {
} }
...@@ -95,8 +95,8 @@ public class SqlPretty implements Pretty{ ...@@ -95,8 +95,8 @@ public class SqlPretty implements Pretty{
boolean afterInsert; boolean afterInsert;
int inFunction; int inFunction;
int parensSinceSelect; int parensSinceSelect;
private LinkedList<Integer> parenCounts = new LinkedList<Integer>(); private LinkedList<Integer> parenCounts = new LinkedList<Integer>();
private LinkedList<Boolean> afterByOrFromOrSelects = new LinkedList<Boolean>(); private LinkedList<Boolean> afterByOrFromOrSelects = new LinkedList<Boolean>();
//mhshi modify //mhshi modify
int indent = 0;//1; int indent = 0;//1;
......
...@@ -25,11 +25,11 @@ package org.maxkey.constants; ...@@ -25,11 +25,11 @@ package org.maxkey.constants;
*/ */
public class Boolean { public class Boolean {
public static final int FALSE = 0; public static final int FALSE = 0;
public static final int TRUE = 1; public static final int TRUE = 1;
private int value = FALSE; private int value = FALSE;
public Boolean() { public Boolean() {
......
...@@ -21,15 +21,15 @@ import org.maxkey.configuration.ApplicationConfig; ...@@ -21,15 +21,15 @@ import org.maxkey.configuration.ApplicationConfig;
public class ConstantsDatabase { public class ConstantsDatabase {
public static String MYSQL = "MySQL"; public static String MYSQL = "MySQL";
public static String POSTGRESQL = "PostgreSQL"; public static String POSTGRESQL = "PostgreSQL";
public static String ORACLE = "Oracle"; public static String ORACLE = "Oracle";
public static String MSSQLSERVER = "SQL Server"; public static String MSSQLSERVER = "SQL Server";
public static String DB2 = "db2"; public static String DB2 = "db2";
public static boolean compare(String databaseProduct) { public static boolean compare(String databaseProduct) {
if(databaseProduct.equalsIgnoreCase(ApplicationConfig.databaseProduct)) { if(databaseProduct.equalsIgnoreCase(ApplicationConfig.databaseProduct)) {
......
...@@ -19,11 +19,16 @@ package org.maxkey.constants; ...@@ -19,11 +19,16 @@ package org.maxkey.constants;
public class ConstantsEntryType { public class ConstantsEntryType {
public static int USERINFO_TYPE = 1; public static int USERINFO_TYPE = 1;
public static int ORG_TYPE = 2;
public static int GROUP_TYPE = 3; public static int ORGANIZATION_TYPE = 2;
public static int PASSWORD_TYPE = 4;
public static int RESOURCES_TYPE = 5; public static int GROUP_TYPE = 3;
public static int PERMISSIONS_TYPE = 6;
public static int PASSWORD_TYPE = 4;
public static int RESOURCES_TYPE = 5;
public static int PERMISSIONS_TYPE = 6;
} }
...@@ -19,19 +19,28 @@ package org.maxkey.constants; ...@@ -19,19 +19,28 @@ package org.maxkey.constants;
public class ConstantsLoginType { public class ConstantsLoginType {
public static final String LOCAL = "Local Login"; public static final String LOCAL = "Local Login";
public static final String BASIC = "Basic";
public static final String SOCIALSIGNON = "Social Sign On"; public static final String BASIC = "Basic";
public static final String REMEBER_ME = "RemeberMe";
public static final String DESKTOP = "Desktop"; public static final String SOCIALSIGNON = "Social Sign On";
public static final String KERBEROS = "Kerberos";
public static final String SAMLTRUST = "SAML v2.0 Trust"; public static final String REMEBER_ME = "RemeberMe";
public static final String MSADTRUST = "MS AD Trust";
public static final String CAS = "CAS"; public static final String DESKTOP = "Desktop";
public static final String WSFEDERATION = "WsFederation";
public static final String KERBEROS = "Kerberos";
public static final String SAMLTRUST = "SAML v2.0 Trust";
public static final String MSADTRUST = "MS AD Trust";
public static final String CAS = "CAS";
public static final String WSFEDERATION = "WsFederation";
public static final String JWT = "Jwt"; public static final String JWT = "Jwt";
public static final String HTTPHEADER = "HttpHeader"; public static final String HTTPHEADER = "HttpHeader";
} }
...@@ -19,18 +19,18 @@ package org.maxkey.constants; ...@@ -19,18 +19,18 @@ package org.maxkey.constants;
public final class ConstantsOperateAction { public final class ConstantsOperateAction {
public static final int CREATE_ACTION = 1; public static final int CREATE_ACTION = 1;
public static final int DELETE_ACTION = 2; public static final int DELETE_ACTION = 2;
public static final int UPDATE_ACTION = 3; public static final int UPDATE_ACTION = 3;
public static final int CHANGE_PASSWORD_ACTION = 4; public static final int CHANGE_PASSWORD_ACTION = 4;
public static final int ADD_MEMBER_ACTION = 5; public static final int ADD_MEMBER_ACTION = 5;
public static final int DELETE_MEMBER_ACTION = 6; public static final int DELETE_MEMBER_ACTION = 6;
public static final int VIEW_ACTION = 7; public static final int VIEW_ACTION = 7;
} }
...@@ -19,13 +19,13 @@ package org.maxkey.constants; ...@@ -19,13 +19,13 @@ package org.maxkey.constants;
public final class ConstantsOperateMessage { public final class ConstantsOperateMessage {
public static final String INSERT_SUCCESS = "message.action.insert.success"; public static final String INSERT_SUCCESS = "message.action.insert.success";
public static final String INSERT_ERROR = "message.action.insert.error"; public static final String INSERT_ERROR = "message.action.insert.error";
public static final String UPDATE_SUCCESS = "message.action.update.success"; public static final String UPDATE_SUCCESS = "message.action.update.success";
public static final String UPDATE_ERROR = "message.action.update.error"; public static final String UPDATE_ERROR = "message.action.update.error";
public static final String DELETE_SUCCESS = "message.action.delete.success"; public static final String DELETE_SUCCESS = "message.action.delete.success";
public static final String DELETE_ERROR = "message.action.delete.error"; public static final String DELETE_ERROR = "message.action.delete.error";
} }
...@@ -24,12 +24,12 @@ package org.maxkey.constants; ...@@ -24,12 +24,12 @@ package org.maxkey.constants;
*/ */
public final class ConstantsPasswordSetType { public final class ConstantsPasswordSetType {
public static final int PASSWORD_NORMAL = 0; public static final int PASSWORD_NORMAL = 0;
public static final int INITIAL_PASSWORD = 1; public static final int INITIAL_PASSWORD = 1;
public static final int MANAGER_CHANGED_PASSWORD = 2; public static final int PASSWORD_EXPIRED = 3;
public static final int PASSWORD_EXPIRED = 3; public static final int MANAGER_CHANGED_PASSWORD = 2;
} }
...@@ -24,10 +24,10 @@ package org.maxkey.constants; ...@@ -24,10 +24,10 @@ package org.maxkey.constants;
*/ */
public final class ConstantsPersistence { public final class ConstantsPersistence {
public static final int INMEMORY = 0; public static final int INMEMORY = 0;
public static final int JDBC = 1; public static final int JDBC = 1;
public static final int REDIS = 2; public static final int REDIS = 2;
} }
...@@ -19,9 +19,9 @@ package org.maxkey.constants; ...@@ -19,9 +19,9 @@ package org.maxkey.constants;
public final class ConstantsPlatformRole { public final class ConstantsPlatformRole {
public static final String PLATFORM_ADMIN = "PLATFORM_ADMIN"; public static final String PLATFORM_ADMIN = "PLATFORM_ADMIN";
public static final String TANANT_ADMIN = "TANANT_ADMIN"; public static final String TANANT_ADMIN = "TANANT_ADMIN";
public static final String ORDINARY_USER = "ORDINARY_USER"; public static final String ORDINARY_USER = "ORDINARY_USER";
} }
...@@ -24,26 +24,26 @@ package org.maxkey.constants; ...@@ -24,26 +24,26 @@ package org.maxkey.constants;
*/ */
public final class ConstantsProtocols { public final class ConstantsProtocols {
public static final String BASIC = "Basic"; public static final String BASIC = "Basic";
public static final String EXTEND_API = "Extend_API"; public static final String EXTEND_API = "Extend_API";
public static final String FORMBASED = "Form_Based"; public static final String FORMBASED = "Form_Based";
public static final String TOKENBASED = "Token_Based"; public static final String TOKENBASED = "Token_Based";
// OAuth
public static final String OAUTH20 = "OAuth_v2.0";
public static final String OAUTH21 = "OAuth_v2.1";
// SAML // SAML
public static final String SAML20 = "SAML_v2.0"; public static final String SAML20 = "SAML_v2.0";
public static final String OPEN_ID_CONNECT10 = "OpenID_Connect_v1.0"; public static final String CAS = "CAS";
public static final String CAS = "CAS"; public static final String JWT = "JWT";
// OAuth
public static final String OAUTH20 = "OAuth_v2.0";
public static final String OAUTH21 = "OAuth_v2.1";
public static final String JWT = "JWT"; public static final String OPEN_ID_CONNECT10 = "OpenID_Connect_v1.0";
} }
...@@ -19,34 +19,34 @@ package org.maxkey.constants; ...@@ -19,34 +19,34 @@ package org.maxkey.constants;
public final class ConstantsStatus { public final class ConstantsStatus {
public static final int ACTIVE = 1; public static final int ACTIVE = 1;
public static final int INACTIVE = 2; public static final int INACTIVE = 2;
public static final int ENABLED = 3; public static final int ENABLED = 3;
public static final int DISABLED = 4; public static final int DISABLED = 4;
public static final int LOCK = 5; public static final int LOCK = 5;
public static final int UNLOCK = 6; public static final int UNLOCK = 6;
public static final int INVALID = 7; public static final int INVALID = 7;
public static final int EXPIRED = 8; public static final int EXPIRED = 8;
public static final int DELETE = 9; public static final int DELETE = 9;
public static final int VALIDATED = 10; public static final int VALIDATED = 10;
public static final int START = 11; public static final int START = 11;
public static final int STOP = 12; public static final int STOP = 12;
public static final int APPLY = 13; public static final int APPLY = 13;
public static final int APPROVED = 14; public static final int APPROVED = 14;
public static final int QUITED = 15; public static final int QUITED = 15;
} }
...@@ -19,22 +19,22 @@ package org.maxkey.constants; ...@@ -19,22 +19,22 @@ package org.maxkey.constants;
public final class ConstantsTimeInterval { public final class ConstantsTimeInterval {
public static final Integer ONE_MINUTE = 60; // 1 minutes public static final Integer ONE_MINUTE = 60; // 1 minutes
public static final Integer ONE_HOUR = 60 * 60; // 1 hour public static final Integer ONE_HOUR = 60 * 60; // 1 hour
public static final Integer ONE_DAY = 60 * 60 * 24; // 1 day public static final Integer ONE_DAY = 60 * 60 * 24; // 1 day
public static final Integer ONE_WEEK = ONE_DAY * 7; // 1 week public static final Integer ONE_WEEK = ONE_DAY * 7; // 1 week
public static final Integer TWO_WEEK = ONE_DAY * 14; // 2 week public static final Integer TWO_WEEK = ONE_DAY * 14; // 2 week
public static final Integer ONE_MONTH = ONE_DAY * 30; // 1 month public static final Integer ONE_MONTH = ONE_DAY * 30; // 1 month
public static final Integer TWO_MONTH = ONE_DAY * 60; // 2 month public static final Integer TWO_MONTH = ONE_DAY * 60; // 2 month
/** /**
* The number of seconds in one year (= 60 * 60 * 24 * 365). * The number of seconds in one year (= 60 * 60 * 24 * 365).
*/ */
public static final Integer ONE_YEAR = 60 * 60 * 24 * 365; public static final Integer ONE_YEAR = 60 * 60 * 24 * 365;
} }
...@@ -19,32 +19,30 @@ package org.maxkey.constants; ...@@ -19,32 +19,30 @@ package org.maxkey.constants;
public class ContentType { public class ContentType {
public static final String TEXT_PLAIN = "text/plain"; public static final String TEXT_PLAIN = "text/plain";
public static final String TEXT_PLAIN_UTF8 = "text/plain;charset=UTF-8"; public static final String TEXT_PLAIN_UTF8 = "text/plain;charset=UTF-8";
public static final String TEXT_XML = "text/xml"; public static final String TEXT_XML = "text/xml";
public static final String TEXT_XML_UTF8 = "text/xml;charset=UTF-8"; public static final String TEXT_XML_UTF8 = "text/xml;charset=UTF-8";
public static final String APPLICATION_JSON = "application/json"; public static final String APPLICATION_JSON = "application/json";
public static final String APPLICATION_JSON_UTF8 = "application/json;charset=UTF-8"; public static final String APPLICATION_JSON_UTF8 = "application/json;charset=UTF-8";
public static final String APPLICATION_JWT = "application/jwt"; public static final String APPLICATION_JWT = "application/jwt";
public static final String APPLICATION_JWT_UTF8 = "application/jwt;charset=UTF-8"; public static final String APPLICATION_JWT_UTF8 = "application/jwt;charset=UTF-8";
public static final String APPLICATION_XML = "application/xml"; public static final String APPLICATION_XML = "application/xml";
public static final String APPLICATION_XML_UTF8 = "application/xml;charset=UTF-8"; public static final String APPLICATION_XML_UTF8 = "application/xml;charset=UTF-8";
public static final String IMAGE_GIF = "image/gif"; public static final String IMAGE_GIF = "image/gif";
public static final String IMAGE_JPEG = "image/jpeg"; public static final String IMAGE_JPEG = "image/jpeg";
public static final String IMAGE_PNG = "image/png"; public static final String IMAGE_PNG = "image/png";
} }
...@@ -86,7 +86,7 @@ public class FormBasedDetailsServiceTest { ...@@ -86,7 +86,7 @@ public class FormBasedDetailsServiceTest {
idList.add("ab7422e9-a91a-4840-9e59-9d911257c918"); idList.add("ab7422e9-a91a-4840-9e59-9d911257c918");
idList.add("12b6ceb8-573b-4f01-ad85-cfb24cfa007c"); idList.add("12b6ceb8-573b-4f01-ad85-cfb24cfa007c");
idList.add("dafd5ba4-d2e3-4656-bd42-178841e610fe"); idList.add("dafd5ba4-d2e3-4656-bd42-178841e610fe");
service.batchDelete(idList); service.deleteBatch(idList);
} }
@Test @Test
......
...@@ -76,19 +76,17 @@ public class AuthorizeBaseEndpoint { ...@@ -76,19 +76,17 @@ public class AuthorizeBaseEndpoint {
Accounts account=new Accounts(); Accounts account=new Accounts();
UserInfo userInfo=WebContext.getUserInfo(); UserInfo userInfo=WebContext.getUserInfo();
Apps loadApp = getApp(app.getId()); Apps loadApp = getApp(app.getId());
if(loadApp.getCredential()==Apps.CREDENTIALS.USER_DEFINED){ if(loadApp.getCredential() == Apps.CREDENTIALS.USER_DEFINED){
account = accountsService.load(new Accounts(userInfo.getId(),loadApp.getId()));
account=accountsService.load(new Accounts(userInfo.getId(),loadApp.getId())); if(account != null){
if(account!=null){
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(account.getRelatedPassword())); account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(account.getRelatedPassword()));
} }
}else if(loadApp.getCredential()==Apps.CREDENTIALS.SHARED){
}else if(loadApp.getCredential() == Apps.CREDENTIALS.SHARED){
account.setRelatedUsername(loadApp.getSharedUsername()); account.setRelatedUsername(loadApp.getSharedUsername());
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(loadApp.getSharedPassword())); account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(loadApp.getSharedPassword()));
}else if(loadApp.getCredential()==Apps.CREDENTIALS.SYSTEM){ }else if(loadApp.getCredential() == Apps.CREDENTIALS.SYSTEM){
if(loadApp.getSystemUserAttr().equalsIgnoreCase("userId")){ if(loadApp.getSystemUserAttr().equalsIgnoreCase("userId")){
account.setUsername(userInfo.getId()); account.setUsername(userInfo.getId());
}else if(loadApp.getSystemUserAttr().equalsIgnoreCase("username")){ }else if(loadApp.getSystemUserAttr().equalsIgnoreCase("username")){
...@@ -104,7 +102,6 @@ public class AuthorizeBaseEndpoint { ...@@ -104,7 +102,6 @@ public class AuthorizeBaseEndpoint {
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(WebContext.getUserInfo().getDecipherable())); account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(WebContext.getUserInfo().getDecipherable()));
}else if(loadApp.getCredential()==Apps.CREDENTIALS.NONE){ }else if(loadApp.getCredential()==Apps.CREDENTIALS.NONE){
account.setUsername(userInfo.getUsername()); account.setUsername(userInfo.getUsername());
account.setRelatedPassword(userInfo.getUsername()); account.setRelatedPassword(userInfo.getUsername());
......
...@@ -44,6 +44,6 @@ public class OnlineTicketEndpoint { ...@@ -44,6 +44,6 @@ public class OnlineTicketEndpoint {
public String ticketValidate( public String ticketValidate(
@RequestParam(value ="ticket",required = true) String ticket) { @RequestParam(value ="ticket",required = true) String ticket) {
OnlineTicket onlineTicket = onlineTicketServices.get(ticket); OnlineTicket onlineTicket = onlineTicketServices.get(ticket);
return onlineTicket == null ? "" :onlineTicket.getTicketId(); return onlineTicket == null ? "" : onlineTicket.getTicketId();
} }
} }
...@@ -21,117 +21,117 @@ package org.maxkey.authz.cas.endpoint.ticket; ...@@ -21,117 +21,117 @@ package org.maxkey.authz.cas.endpoint.ticket;
public class CasConstants { public class CasConstants {
/* CAS Protocol Parameters. **/ /* CAS Protocol Parameters. **/
public static final class PARAMETER{ public static final class PARAMETER{
public final static String ENDPOINT_CAS_DETAILS="CAS_AUTHORIZE_ENDPOINT_CAS_DETAILS"; public final static String ENDPOINT_CAS_DETAILS = "CAS_AUTHORIZE_ENDPOINT_CAS_DETAILS";
public final static String PARAMETER_MAP="CAS_AUTHORIZE_ENDPOINT_PARAMETER_MAP"; public final static String PARAMETER_MAP = "CAS_AUTHORIZE_ENDPOINT_PARAMETER_MAP";
/** Constant representing the ticket parameter in the request. */ /** Constant representing the ticket parameter in the request. */
public final static String TICKET="ticket"; public final static String TICKET = "ticket";
/** Constant representing the service parameter in the request. */ /** Constant representing the service parameter in the request. */
public static final String SERVICE = "service"; public static final String SERVICE = "service";
/** Constant representing the targetService parameter in the request. */ /** Constant representing the targetService parameter in the request. */
public static final String TARGET_SERVICE = "targetService"; public static final String TARGET_SERVICE = "targetService";
/** Constant representing the method parameter in the request. */ /** Constant representing the method parameter in the request. */
public static final String METHOD = "method"; public static final String METHOD = "method";
/** Constant representing the proxy callback url parameter in the request. */ /** Constant representing the proxy callback url parameter in the request. */
public static final String PROXY_CALLBACK_URL = "pgtUrl"; public static final String PROXY_CALLBACK_URL = "pgtUrl";
/** Constant representing the renew parameter in the request. */ /** Constant representing the renew parameter in the request. */
public static final String RENEW = "renew"; public static final String RENEW = "renew";
/** Constant representing the gateway parameter in the request. */ /** Constant representing the gateway parameter in the request. */
public static final String GATEWAY = "gateway"; public static final String GATEWAY = "gateway";
/** Constant representing the format parameter in the request. */ /** Constant representing the format parameter in the request. */
public static final String FORMAT = "format"; public static final String FORMAT = "format";
/** Constant representing the pgtId parameter in the request. */ /** Constant representing the pgtId parameter in the request. */
public static final String PROXY_GRANTING_TICKET_ID = "pgtId"; public static final String PROXY_GRANTING_TICKET_ID = "pgtId";
/** Constant representing the pgt parameter in the request. */ /** Constant representing the pgt parameter in the request. */
public static final String PROXY_GRANTING_TICKET = "pgt"; public static final String PROXY_GRANTING_TICKET = "pgt";
/** Constant representing the pgtIou parameter in the request. */ /** Constant representing the pgtIou parameter in the request. */
public static final String PROXY_GRANTING_TICKET_IOU = "pgtIou"; public static final String PROXY_GRANTING_TICKET_IOU = "pgtIou";
public static final String REST_USERNAME = "username"; public static final String REST_USERNAME = "username";
public static final String REST_PASSWORD = "password"; public static final String REST_PASSWORD = "password";
} }
/* CAS Protocol PREFIX */ /* CAS Protocol PREFIX */
public static final class PREFIX{ public static final class PREFIX{
/** Proxy ticket prefix applied to unique ids. */ /** Proxy ticket prefix applied to unique ids. */
public static final String PROXY_TICKET_PREFIX = "PT"; public static final String PROXY_TICKET_PREFIX = "PT";
/** /**
* Prefix generally applied to unique ids generated * Prefix generally applied to unique ids generated
* by UniqueTicketIdGenerator. * by UniqueTicketIdGenerator.
*/ */
public static final String SERVICE_TICKET_PREFIX = "ST"; public static final String SERVICE_TICKET_PREFIX = "ST";
/** The prefix to use when generating an id for a Proxy Granting Ticket. */ /** The prefix to use when generating an id for a Proxy Granting Ticket. */
public static final String PROXY_GRANTING_TICKET_PREFIX = "PGT"; public static final String PROXY_GRANTING_TICKET_PREFIX = "PGT";
/** The prefix to use when generating an id for a Proxy Granting Ticket IOU. */ /** The prefix to use when generating an id for a Proxy Granting Ticket IOU. */
public static final String PROXY_GRANTING_TICKET_IOU_PREFIX = "PGTIOU"; public static final String PROXY_GRANTING_TICKET_IOU_PREFIX = "PGTIOU";
public static final String TICKET_GRANTING_TICKET_PREFIX = "TGT"; public static final String TICKET_GRANTING_TICKET_PREFIX = "TGT";
} }
/* CAS Protocol Error Codes. **/ /* CAS Protocol Error Codes. **/
public static class ERROR_CODE{ public static class ERROR_CODE{
/** Constant representing an invalid request for validation. */ /** Constant representing an invalid request for validation. */
public static String INVALID_REQUEST = "INVALID_REQUEST"; public static String INVALID_REQUEST = "INVALID_REQUEST";
/** Constant representing an invalid pgt request. */ /** Constant representing an invalid pgt request. */
public static String INVALID_REQUEST_PROXY = "INVALID_REQUEST_PROXY"; public static String INVALID_REQUEST_PROXY = "INVALID_REQUEST_PROXY";
public static String INVALID_TICKET_SPEC = "INVALID_TICKET_SPEC"; public static String INVALID_TICKET_SPEC = "INVALID_TICKET_SPEC";
/** Constant representing an invalid proxy callback for validation. */ /** Constant representing an invalid proxy callback for validation. */
public static String INVALID_PROXY_CALLBACK = "INVALID_PROXY_CALLBACK"; public static String INVALID_PROXY_CALLBACK = "INVALID_PROXY_CALLBACK";
/** Constant representing an invalid ticket for validation. */ /** Constant representing an invalid ticket for validation. */
public static String INVALID_TICKET = "INVALID_TICKET"; public static String INVALID_TICKET = "INVALID_TICKET";
public static String INVALID_SERVICE = "INVALID_SERVICE"; public static String INVALID_SERVICE = "INVALID_SERVICE";
public static String INTERNAL_ERROR = "INTERNAL_ERROR"; public static String INTERNAL_ERROR = "INTERNAL_ERROR";
/** Constant representing an invalid service proxy request. */ /** Constant representing an invalid service proxy request. */
public static String UNAUTHORIZED_SERVICE_PROXY = "UNAUTHORIZED_SERVICE_PROXY"; public static String UNAUTHORIZED_SERVICE_PROXY = "UNAUTHORIZED_SERVICE_PROXY";
/** Constant representing an invalid service request. */ /** Constant representing an invalid service request. */
public static String UNAUTHORIZED_SERVICE = "UNAUTHORIZED_SERVICE"; public static String UNAUTHORIZED_SERVICE = "UNAUTHORIZED_SERVICE";
} }
/* CAS Protocol endpoint. **/ /* CAS Protocol endpoint. **/
public static class ENDPOINT{ public static class ENDPOINT{
public static final String ENDPOINT_BASE = "/authz/cas"; public static final String ENDPOINT_BASE = "/authz/cas";
/** /**
* Constant representing login. * Constant representing login.
*/ */
public static final String ENDPOINT_LOGIN = ENDPOINT_BASE + "/login"; public static final String ENDPOINT_LOGIN = ENDPOINT_BASE + "/login";
/** /**
* Constant representing logout. * Constant representing logout.
*/ */
public static final String ENDPOINT_LOGOUT = ENDPOINT_BASE + "/logout"; public static final String ENDPOINT_LOGOUT = ENDPOINT_BASE + "/logout";
/** /**
* Constant representing proxy validate. * Constant representing proxy validate.
*/ */
public static final String ENDPOINT_PROXY_VALIDATE = ENDPOINT_BASE + "/proxyValidate"; public static final String ENDPOINT_PROXY_VALIDATE = ENDPOINT_BASE + "/proxyValidate";
/** /**
* Constant representing v3 proxy validate. * Constant representing v3 proxy validate.
*/ */
public static final String ENDPOINT_PROXY_VALIDATE_V3 = ENDPOINT_BASE + "/p3/proxyValidate"; public static final String ENDPOINT_PROXY_VALIDATE_V3 = ENDPOINT_BASE + "/p3/proxyValidate";
/** /**
* Constant representing legacy validate. * Constant representing legacy validate.
*/ */
public static final String ENDPOINT_VALIDATE = ENDPOINT_BASE + "/validate"; public static final String ENDPOINT_VALIDATE = ENDPOINT_BASE + "/validate";
/** /**
* Constant representing service validate. * Constant representing service validate.
*/ */
public static final String ENDPOINT_SERVICE_VALIDATE = ENDPOINT_BASE + "/serviceValidate"; public static final String ENDPOINT_SERVICE_VALIDATE = ENDPOINT_BASE + "/serviceValidate";
/** /**
* Constant representing v3 service validate. * Constant representing v3 service validate.
...@@ -141,18 +141,18 @@ public class CasConstants { ...@@ -141,18 +141,18 @@ public class CasConstants {
/** /**
* Constant representing proxy endpoint. * Constant representing proxy endpoint.
*/ */
public static final String ENDPOINT_PROXY = ENDPOINT_BASE + "/proxy"; public static final String ENDPOINT_PROXY = ENDPOINT_BASE + "/proxy";
/** /**
* Constant representing v3 proxy endpoint. * Constant representing v3 proxy endpoint.
*/ */
public static final String ENDPOINT_PROXY_V3 = ENDPOINT_BASE + "/p3/proxy"; public static final String ENDPOINT_PROXY_V3 = ENDPOINT_BASE + "/p3/proxy";
public static final String ENDPOINT_SERVICE_TICKET_GRANTING = ENDPOINT_BASE + "/granting"; public static final String ENDPOINT_SERVICE_TICKET_GRANTING = ENDPOINT_BASE + "/granting";
public static final String ENDPOINT_REST_TICKET_V1 = ENDPOINT_BASE + "/v1/tickets"; public static final String ENDPOINT_REST_TICKET_V1 = ENDPOINT_BASE + "/v1/tickets";
public static final String ENDPOINT_REST_USERS_V1 = ENDPOINT_BASE + "/v1/users"; public static final String ENDPOINT_REST_USERS_V1 = ENDPOINT_BASE + "/v1/users";
} }
......
...@@ -139,7 +139,7 @@ public class AdaptersController { ...@@ -139,7 +139,7 @@ public class AdaptersController {
public Message delete(@ModelAttribute("appsAdapter") AppsAdapters appsAdapter) { public Message delete(@ModelAttribute("appsAdapter") AppsAdapters appsAdapter) {
_logger.debug("-delete appsAdapter :" + appsAdapter); _logger.debug("-delete appsAdapter :" + appsAdapter);
if (appsAdaptersService.batchDelete(appsAdapter.getId())) { if (appsAdaptersService.deleteBatch(appsAdapter.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
......
...@@ -166,7 +166,7 @@ public class ApplicationsController extends BaseAppContorller { ...@@ -166,7 +166,7 @@ public class ApplicationsController extends BaseAppContorller {
@RequestMapping(value={"/delete"}) @RequestMapping(value={"/delete"})
public Message delete(@ModelAttribute("application") Apps application) { public Message delete(@ModelAttribute("application") Apps application) {
_logger.debug("-delete application :" + application); _logger.debug("-delete application :" + application);
if (appsService.batchDelete(application.getId())) { if (appsService.deleteBatch(application.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
......
...@@ -144,7 +144,7 @@ public class AccountsController { ...@@ -144,7 +144,7 @@ public class AccountsController {
_logger.debug("-delete AppAccounts :" + appAccounts); _logger.debug("-delete AppAccounts :" + appAccounts);
accountsService.batchDelete(appAccounts.getId()); accountsService.deleteBatch(appAccounts.getId());
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
......
...@@ -157,7 +157,7 @@ public class GroupMemberController { ...@@ -157,7 +157,7 @@ public class GroupMemberController {
return new Message("传入参数为空",MessageType.error); return new Message("传入参数为空",MessageType.error);
} }
if(groupMemberService.batchDelete(groupMember.getId())) { if(groupMemberService.deleteBatch(groupMember.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
} }
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
......
...@@ -129,7 +129,7 @@ public class GroupPrivilegesController { ...@@ -129,7 +129,7 @@ public class GroupPrivilegesController {
return new Message("传入参数为空",MessageType.error); return new Message("传入参数为空",MessageType.error);
} }
if(groupPrivilegesService.batchDelete(groupApp.getId())) { if(groupPrivilegesService.deleteBatch(groupApp.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
} }
......
...@@ -131,7 +131,7 @@ public class NoticesController { ...@@ -131,7 +131,7 @@ public class NoticesController {
public Message delete(@ModelAttribute("notice")Notices notice) { public Message delete(@ModelAttribute("notice")Notices notice) {
_logger.debug("-delete notice :" + notice); _logger.debug("-delete notice :" + notice);
if (noticesService.batchDelete(notice.getId())) { if (noticesService.deleteBatch(notice.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
......
...@@ -175,7 +175,7 @@ public class OrganizationsController { ...@@ -175,7 +175,7 @@ public class OrganizationsController {
@RequestMapping({"/delete"}) @RequestMapping({"/delete"})
public Message delete(@ModelAttribute("org") Organizations org) { public Message delete(@ModelAttribute("org") Organizations org) {
_logger.debug("-delete organization :" + org); _logger.debug("-delete organization :" + org);
if (this.organizationsService.batchDelete(org.getId())) { if (this.organizationsService.deleteBatch(org.getId())) {
return new Message(WebContext.getI18nValue("message.action.delete.success"), MessageType.success); return new Message(WebContext.getI18nValue("message.action.delete.success"), MessageType.success);
} }
...@@ -208,7 +208,7 @@ public class OrganizationsController { ...@@ -208,7 +208,7 @@ public class OrganizationsController {
// 数据去重 // 数据去重
if(!CollectionUtils.isEmpty(orgsList)){ if(!CollectionUtils.isEmpty(orgsList)){
orgsList = orgsList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getId()))), ArrayList::new)); orgsList = orgsList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getId()))), ArrayList::new));
if(organizationsService.batchInsert(orgsList)) { if(organizationsService.insertBatch(orgsList)) {
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB); new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB);
}else { }else {
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error); new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error);
......
...@@ -144,7 +144,7 @@ public class ResourcesController { ...@@ -144,7 +144,7 @@ public class ResourcesController {
public Message delete(@ModelAttribute("resource") Resources resource) { public Message delete(@ModelAttribute("resource") Resources resource) {
_logger.debug("-delete resource :" + resource); _logger.debug("-delete resource :" + resource);
if (resourcesService.batchDelete(resource.getId())) { if (resourcesService.deleteBatch(resource.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
......
...@@ -144,7 +144,7 @@ public class RoleMemberController { ...@@ -144,7 +144,7 @@ public class RoleMemberController {
return new Message("传入参数为空",MessageType.error); return new Message("传入参数为空",MessageType.error);
} }
if(roleMemberService.batchDelete(roleMember.getId())) { if(roleMemberService.deleteBatch(roleMember.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
} }
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
......
...@@ -133,7 +133,7 @@ public class SocialsProviderController { ...@@ -133,7 +133,7 @@ public class SocialsProviderController {
public Message delete(@ModelAttribute("socialsProvider") SocialsProvider socialsProvider) { public Message delete(@ModelAttribute("socialsProvider") SocialsProvider socialsProvider) {
_logger.debug("-delete socialsProvider :" + socialsProvider); _logger.debug("-delete socialsProvider :" + socialsProvider);
if (socialsProviderService.batchDelete(socialsProvider.getId())) { if (socialsProviderService.deleteBatch(socialsProvider.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
......
...@@ -136,7 +136,7 @@ public class UserAdjointController { ...@@ -136,7 +136,7 @@ public class UserAdjointController {
public Message delete(@ModelAttribute("userInfoAdjoint") UserInfoAdjoint userInfoAdjoint) { public Message delete(@ModelAttribute("userInfoAdjoint") UserInfoAdjoint userInfoAdjoint) {
_logger.debug("-delete group :" + userInfoAdjoint); _logger.debug("-delete group :" + userInfoAdjoint);
if (userInfoAdjointService.batchDelete(userInfoAdjoint.getId())) { if (userInfoAdjointService.deleteBatch(userInfoAdjoint.getId())) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
......
...@@ -217,7 +217,7 @@ public class UserInfoController { ...@@ -217,7 +217,7 @@ public class UserInfoController {
@RequestMapping(value="/batchDelete") @RequestMapping(value="/batchDelete")
public Message batchDeleteUsers(@RequestParam("id")String id) { public Message batchDeleteUsers(@RequestParam("id")String id) {
_logger.debug(id); _logger.debug(id);
if(userInfoService.batchDelete(StringUtils.string2List(id, ","))) { if(userInfoService.deleteBatch(StringUtils.string2List(id, ","))) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
...@@ -235,7 +235,7 @@ public class UserInfoController { ...@@ -235,7 +235,7 @@ public class UserInfoController {
@RequestMapping(value="/delete") @RequestMapping(value="/delete")
public Message deleteUsersById(@RequestParam("id") String id) { public Message deleteUsersById(@RequestParam("id") String id) {
_logger.debug(id); _logger.debug(id);
if(userInfoService.batchDelete(id)) { if(userInfoService.deleteBatch(id)) {
//provisioningPrepare.prepare(userInfo, OPERATEACTION.DELETE_ACTION); //provisioningPrepare.prepare(userInfo, OPERATEACTION.DELETE_ACTION);
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success); return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
} else { } else {
...@@ -313,7 +313,7 @@ public class UserInfoController { ...@@ -313,7 +313,7 @@ public class UserInfoController {
// 数据去重 // 数据去重
if(!CollectionUtils.isEmpty(userInfoList)){ if(!CollectionUtils.isEmpty(userInfoList)){
userInfoList = userInfoList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getUsername()))), ArrayList::new)); userInfoList = userInfoList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getUsername()))), ArrayList::new));
if( userInfoService.batchInsert(userInfoList)) { if( userInfoService.insertBatch(userInfoList)) {
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB); new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB);
}else { }else {
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error); new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册