-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
1,071 additions
and
1,636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import com.jmsoftware.maf.springcloudstarter.helper.SpringBootStartupHelper; | ||
import lombok.extern.slf4j.Slf4j; | ||
import lombok.val; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
|
@@ -13,24 +14,18 @@ | |
* <p> | ||
* Change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: [email protected] | ||
* @date 3/12/20 9:57 AM | ||
* @author Johnny Miller (锺俊), email: [email protected], date: 3/12/20 9:57 AM | ||
**/ | ||
@Slf4j | ||
@EnableFeignClients | ||
@EnableDiscoveryClient | ||
@SpringBootApplication | ||
public class AuthCenterApplication { | ||
private static final StopWatch STOP_WATCH = new StopWatch(); | ||
private static SpringBootStartupHelper springBootStartupHelper; | ||
|
||
public AuthCenterApplication(SpringBootStartupHelper springBootStartupHelper) { | ||
AuthCenterApplication.springBootStartupHelper = springBootStartupHelper; | ||
} | ||
|
||
public static void main(String[] args) { | ||
STOP_WATCH.start(); | ||
SpringApplication.run(AuthCenterApplication.class, args); | ||
springBootStartupHelper.stop(STOP_WATCH); | ||
val stopWatch = new StopWatch(); | ||
stopWatch.start(); | ||
val configurableApplicationContext = SpringApplication.run(AuthCenterApplication.class, args); | ||
val springBootStartupHelper = configurableApplicationContext.getBean(SpringBootStartupHelper.class); | ||
springBootStartupHelper.stop(stopWatch); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 42 additions & 1 deletion
43
auth-center/src/main/java/com/jmsoftware/maf/authcenter/role/controller/RoleController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,57 @@ | ||
package com.jmsoftware.maf.authcenter.role.controller; | ||
|
||
import com.jmsoftware.maf.authcenter.role.entity.RoleExcelBean; | ||
import com.jmsoftware.maf.authcenter.role.service.RoleService; | ||
import com.jmsoftware.maf.springcloudstarter.controller.AbstractExcelDataController; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.time.Instant; | ||
import java.util.List; | ||
|
||
/** | ||
* Description: RoleController, change description here. | ||
* | ||
* @author 钟俊(zhongjun), email: [email protected], date: 12/17/2020 4:44 PM | ||
**/ | ||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
public class RoleController { | ||
@RequestMapping("/roles") | ||
public class RoleController extends AbstractExcelDataController<RoleExcelBean> { | ||
private final RoleService roleService; | ||
|
||
@Override | ||
public void onExceptionOccurred() { | ||
log.error("Exception occurred when uploading excel for role."); | ||
this.fileName.set("role-stat" + Instant.now() + ".xlsx"); | ||
} | ||
|
||
@Override | ||
protected void beforeDatabaseOperation(List<RoleExcelBean> beanList) { | ||
log.info("BeforeDatabaseOperation: {}", beanList); | ||
} | ||
|
||
@Override | ||
protected void executeDatabaseOperation(List<RoleExcelBean> beanList) throws Exception { | ||
log.info("ExecuteDatabaseOperation: {}", beanList); | ||
this.roleService.save(beanList); | ||
} | ||
|
||
@Override | ||
protected String getTemplateFileName() { | ||
return RoleService.ROLE_TEMPLATE_EXCEL; | ||
} | ||
|
||
@Override | ||
protected List<RoleExcelBean> getListForExporting() { | ||
return this.roleService.getListForExporting(); | ||
} | ||
|
||
@Override | ||
protected void validateBeforeAddToBeanList(List<RoleExcelBean> beanList, RoleExcelBean bean, int index) throws IllegalArgumentException { | ||
this.roleService.validateBeforeAddToBeanList(beanList, bean, index); | ||
} | ||
} |
Oops, something went wrong.