Skip to content

Commit

Permalink
[doyto-service-i18n]更新auth
Browse files Browse the repository at this point in the history
  • Loading branch information
f0rb committed Jun 14, 2019
1 parent 787f26a commit 19d9a13
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 112 deletions.
39 changes: 4 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>win.doyto.service</groupId>
<groupId>win.doyto</groupId>
<artifactId>doyto-service-parent</artifactId>
<version>2.1.0</version>
<relativePath>../doyto-service-parent/pom.xml</relativePath>
<version>2.1.0-SNAPSHOT</version>
</parent>

<version>2.1.1</version>
Expand All @@ -35,7 +34,6 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -52,14 +50,6 @@
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

<!-- 数据库连接池 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>jexcelapi</groupId>
<artifactId>jxl</artifactId>
Expand All @@ -78,40 +68,19 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-core</artifactId>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-javanica</artifactId>
<version>1.5.12</version>
</dependency>
<dependency>
<groupId>win.doyto.service</groupId>
<artifactId>doyto-service-base-config</artifactId>
<version>2.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>win.doyto</groupId>
<artifactId>doyto-starter-auth-client</artifactId>
<version>2.1.0-SNAPSHOT</version>
<artifactId>doyto-common-auth</artifactId>
</dependency>
<dependency>
<groupId>win.doyto</groupId>
<artifactId>doyto-query</artifactId>
<version>0.1.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>win.doyto</groupId>
<artifactId>doyto-common-web</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>0.1.4-SNAPSHOT</version>
</dependency>

</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/win/doyto/i18n/I18nApp.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package win.doyto.i18n;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
* I18nApp
*
* @author f0rb on 2017-03-29.
*/
@SpringCloudApplication
@SpringBootApplication
@ComponentScan(basePackages = {"win.doyto.i18n", "win.doyto.common.web"})
public class I18nApp {
public static void main(String[] args) {
Expand Down

This file was deleted.

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

import lombok.Getter;
import lombok.Setter;
import win.doyto.auth.core.UsernameAware;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
Expand All @@ -13,7 +14,10 @@
*/
@Getter
@Setter
public class GroupLocaleRequest {
public class GroupLocaleRequest implements UsernameAware {

private String username;

@NotNull
@Size(max = 15)
private String group;
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/win/doyto/i18n/module/i18n/I18nController.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,15 @@ public Object autoTranslate(

@RequestMapping(value = "create", method = RequestMethod.POST)
public void createGroup(
@CurrentUser String username,
@RequestBody @Valid GroupLocaleRequest request
) {
i18nService.createGroup(username, request.getGroup(), request.getLabel(), request.getLocale());
i18nService.createGroup(request.getUsername(), request.getGroup(), request.getLabel(), request.getLocale());
}

@PostMapping("addLocale")
public void add(
@CurrentUser String username,
@RequestBody @Valid LocaleRequest request
) {
request.setUsername(username);
i18nService.addLocale(request);
}

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

import lombok.Getter;
import lombok.Setter;
import win.doyto.auth.core.UsernameAware;

/**
* LocaleRequest
Expand All @@ -10,7 +11,7 @@
*/
@Getter
@Setter
public class LocaleRequest {
public class LocaleRequest implements UsernameAware {
private String username;
private Integer groupId;
private String group;
Expand Down
5 changes: 0 additions & 5 deletions src/main/resources/config/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ spring:
password: ${MYSQL_DEFAULT_PASS:local_pass}
hikari:
jdbc-url: ${spring.datasource.url}

logging:
level:
org.springframework.security.web: info

File renamed without changes.
7 changes: 3 additions & 4 deletions src/test/java/win/doyto/i18n/I18nControllerTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package win.doyto.i18n;

import java.util.Arrays;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Ignore;
Expand All @@ -20,6 +16,9 @@
import org.springframework.web.context.WebApplicationContext;
import win.doyto.i18n.module.group.GroupControllerTest;

import java.util.Arrays;
import javax.annotation.Resource;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;

@Slf4j
Expand Down

0 comments on commit 19d9a13

Please sign in to comment.