Browse Source

Add validator package, more comment

config
shengzhaoli.shengz 2 months ago
parent
commit
5a3944532c
  1. 1
      src/main/java/com/monkeyk/sos/web/controller/ClientDetailsController.java
  2. 8
      src/main/java/com/monkeyk/sos/web/controller/SOSController.java
  3. 1
      src/main/java/com/monkeyk/sos/web/controller/UserController.java
  4. 4
      src/main/java/com/monkeyk/sos/web/controller/validator/OauthClientDetailsDtoValidator.java
  5. 2
      src/main/java/com/monkeyk/sos/web/controller/validator/UserFormDtoValidator.java
  6. 2
      src/test/java/com/monkeyk/sos/web/controller/OAuthRestControllerTest.java
  7. 4
      src/test/java/com/monkeyk/sos/web/controller/resource/UnityControllerTest.java

1
src/main/java/com/monkeyk/sos/web/controller/ClientDetailsController.java

@ -3,6 +3,7 @@ package com.monkeyk.sos.web.controller;
import com.monkeyk.sos.infrastructure.PKCEUtils;
import com.monkeyk.sos.service.dto.OauthClientDetailsDto;
import com.monkeyk.sos.service.OauthService;
import com.monkeyk.sos.web.controller.validator.OauthClientDetailsDtoValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.oidc.OidcScopes;

8
src/main/java/com/monkeyk/sos/web/controller/SOSController.java

@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
/**
* 2018/4/19
* <p>
* starup
* startup
*
* @author Shengzhao Li
*/
@ -32,10 +32,14 @@ public class SOSController {
}
//Go login
/**
* Go login
*/
@GetMapping(value = {"/login"})
public String login(Model model) {
if (LOG.isInfoEnabled()) {
LOG.info("Go to login, IP: {}", WebUtils.getIp());
}
return "login";
}

1
src/main/java/com/monkeyk/sos/web/controller/UserController.java

@ -3,6 +3,7 @@ package com.monkeyk.sos.web.controller;
import com.monkeyk.sos.service.dto.UserFormDto;
import com.monkeyk.sos.service.dto.UserOverviewDto;
import com.monkeyk.sos.service.UserService;
import com.monkeyk.sos.web.controller.validator.UserFormDtoValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

4
src/main/java/com/monkeyk/sos/web/controller/OauthClientDetailsDtoValidator.java → src/main/java/com/monkeyk/sos/web/controller/validator/OauthClientDetailsDtoValidator.java

@ -1,4 +1,4 @@
package com.monkeyk.sos.web.controller;
package com.monkeyk.sos.web.controller.validator;
import com.monkeyk.sos.service.dto.OauthClientDetailsDto;
import com.monkeyk.sos.service.OauthService;
@ -11,6 +11,8 @@ import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
/**
* 2015/5/26 15:28
*
* @author Shengzhao Li
*/
@Component

2
src/main/java/com/monkeyk/sos/web/controller/UserFormDtoValidator.java → src/main/java/com/monkeyk/sos/web/controller/validator/UserFormDtoValidator.java

@ -1,4 +1,4 @@
package com.monkeyk.sos.web.controller;
package com.monkeyk.sos.web.controller.validator;
import com.monkeyk.sos.service.dto.UserFormDto;
import com.monkeyk.sos.domain.user.Privilege;

2
src/test/java/com/monkeyk/sos/web/controller/OAuthRestControllerTest.java

@ -3,6 +3,8 @@ package com.monkeyk.sos.web.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.monkeyk.sos.service.OauthService;
import com.monkeyk.sos.service.UserService;
import com.monkeyk.sos.web.controller.validator.OauthClientDetailsDtoValidator;
import com.monkeyk.sos.web.controller.validator.UserFormDtoValidator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

4
src/test/java/com/monkeyk/sos/web/controller/resource/UnityControllerTest.java

@ -3,8 +3,8 @@ package com.monkeyk.sos.web.controller.resource;
import com.monkeyk.sos.service.OauthService;
import com.monkeyk.sos.service.UserService;
import com.monkeyk.sos.service.dto.UserJsonDto;
import com.monkeyk.sos.web.controller.OauthClientDetailsDtoValidator;
import com.monkeyk.sos.web.controller.UserFormDtoValidator;
import com.monkeyk.sos.web.controller.validator.OauthClientDetailsDtoValidator;
import com.monkeyk.sos.web.controller.validator.UserFormDtoValidator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Loading…
Cancel
Save