-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
35 changed files
with
585 additions
and
208 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.wansensoft.api; | ||
|
||
import com.wansensoft.entities.log.Log; | ||
import com.wansensoft.entities.user.User; | ||
import com.wansensoft.service.log.LogService; | ||
import com.wansensoft.utils.BaseResponseInfo; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@RestController | ||
@RequestMapping(value = "/log") | ||
public class LogController { | ||
|
||
private final LogService logService; | ||
|
||
public LogController(LogService logService) { | ||
this.logService = logService; | ||
} | ||
|
||
@GetMapping("/getAllList") | ||
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception { | ||
BaseResponseInfo res = new BaseResponseInfo(); | ||
try { | ||
Map<String, Object> data = new HashMap<>(); | ||
List<Log> dataList = logService.getLog(); | ||
if(dataList!=null) { | ||
data.put("logList", dataList); | ||
} | ||
res.code = 200; | ||
res.data = data; | ||
} catch(Exception e){ | ||
res.code = 500; | ||
res.data = "获取失败"; | ||
} | ||
return res; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
api/src/main/java/com/wansensoft/api/MybatisPlusConfig.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.wansensoft.api; | ||
|
||
import com.baomidou.mybatisplus.annotation.DbType; | ||
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; | ||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; | ||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; | ||
import org.mybatis.spring.annotation.MapperScan; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@MapperScan("com.wansensoft.mappers") | ||
public class MybatisPlusConfig { | ||
|
||
/** | ||
* 添加分页插件 | ||
*/ | ||
@Bean | ||
public MybatisPlusInterceptor mybatisPlusInterceptor() { | ||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); | ||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); | ||
return interceptor; | ||
} | ||
} |
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
Oops, something went wrong.