Skip to content

Commit

Permalink
✨1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
oddfar committed Jun 8, 2023
1 parent 1b96244 commit 5a88845
Show file tree
Hide file tree
Showing 55 changed files with 2,215 additions and 245 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
## 项目文档

- 项目在线预览地址:暂无

- 项目文档:<https://oddfar.github.io/campus-doc/>

## 关注&交流

欢迎各位老哥进群进行技术交流,为了防止广告进入,请添加我微信(备注:**Campus**),我会直接将你拉进**Campus交流群**

<img src="https://note.oddfar.com/img/my-wechat.jpg" alt="wechat" style="height:280px;" />

## 贡献代码

若您有好的想法,发现一些 **BUG** 并修复了,欢迎提交 **Pull Request** 参与开源贡献
Expand Down
2 changes: 1 addition & 1 deletion campus-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>campus</artifactId>
<groupId>com.oddfar.campus</groupId>
<version>1.1.1</version>
<version>1.1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.oddfar.campus.admin.controller.monitor;

import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.annotation.Log;
import com.oddfar.campus.common.domain.PageResult;
import com.oddfar.campus.common.domain.R;
import com.oddfar.campus.common.domain.entity.SysLoginLogEntity;
import com.oddfar.campus.common.enums.ResBizTypeEnum;
import com.oddfar.campus.framework.service.SysLoginLogService;
import com.oddfar.campus.framework.web.service.SysPasswordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


/**
* 系统访问记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/logininfor")
@Log(openLog = false)
@ApiResource(name = "登录日志管理", resBizType = ResBizTypeEnum.SYSTEM)
public class SysLogininforController {
@Autowired
private SysLoginLogService logininforService;

@Autowired
private SysPasswordService passwordService;

@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping(value = "/list",name = "登录日志-分类列表")
public R list(SysLoginLogEntity logininfor) {
PageResult<SysLoginLogEntity> page = logininforService.selectLogininforPage(logininfor);
return R.ok().put(page);
}

@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@DeleteMapping(value = "/{infoIds}",name = "登录日志-删除")
public R remove(@PathVariable Long[] infoIds) {
return R.ok(logininforService.deleteLogininforByIds(infoIds));
}

@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@DeleteMapping(value = "/clean",name = "登录日志-清空")
public R clean() {
logininforService.cleanLogininfor();
return R.ok();
}

@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
@GetMapping(value = "/unlock/{userName}",name = "登录日志-解锁")
public R unlock(@PathVariable("userName") String userName) {
passwordService.clearLoginRecordCache(userName);
return R.ok();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.oddfar.campus.admin.controller.monitor;

import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.annotation.Log;
import com.oddfar.campus.common.domain.PageResult;
import com.oddfar.campus.common.domain.R;
import com.oddfar.campus.common.domain.entity.SysOperLogEntity;
import com.oddfar.campus.common.enums.ResBizTypeEnum;
import com.oddfar.campus.framework.service.SysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
* 操作日志记录
*/
@RestController
@RequestMapping("/monitor/operlog")
@Log(openLog = false)
@ApiResource(name = "操作日志管理", resBizType = ResBizTypeEnum.SYSTEM)
public class SysOperlogController {

@Autowired
private SysOperLogService operLogService;

@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
@GetMapping(value = "/list", name = "操作日志-分页")
public R list(SysOperLogEntity operLog) {
PageResult<SysOperLogEntity> page = operLogService.selectOperLogPage(operLog);
return R.ok().put(page);
}


@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping(value = "/{operIds}", name = "操作日志-删除")
public R remove(@PathVariable Long[] operIds) {
return R.ok(operLogService.deleteOperLogByIds(operIds));
}

@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping(value = "/clean", name = "操作日志-清空")
public R clean() {
operLogService.cleanOperLog();
return R.ok();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cn.hutool.core.codec.Base64;
import com.google.code.kaptcha.Producer;
import com.oddfar.campus.common.annotation.Log;
import com.oddfar.campus.common.constant.CacheConstants;
import com.oddfar.campus.common.constant.Constants;
import com.oddfar.campus.common.core.RedisCache;
Expand All @@ -27,6 +28,7 @@
* @author ruoyi
*/
@RestController
@Log(openLog = false)
public class CaptchaController {
@Resource(name = "captchaProducer")
private Producer captchaProducer;
Expand All @@ -42,7 +44,7 @@ public class CaptchaController {
/**
* 生成验证码
*/
@GetMapping("/captchaImage")
@GetMapping(value = "/captchaImage", name = "生产验证码")
public R getCode(HttpServletResponse response) throws IOException {
R ajax = R.ok();
boolean captchaEnabled = configService.selectCaptchaEnabled();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.oddfar.campus.admin.controller.system;

import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.domain.R;
import com.oddfar.campus.common.domain.entity.SysResourceEntity;
import com.oddfar.campus.common.enums.ResBizTypeEnum;
import com.oddfar.campus.framework.service.SysResourceService;
import com.oddfar.campus.framework.web.service.SysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -13,6 +15,7 @@

@RestController
@RequestMapping("/system/resource")
@ApiResource(name = "资源管理", resBizType = ResBizTypeEnum.SYSTEM)
public class SysApiResourceController {
@Autowired
private SysResourceService resourceService;
Expand All @@ -22,7 +25,7 @@ public class SysApiResourceController {
/**
* 加载对应角色资源列表树
*/
@GetMapping(value = "/roleApiTreeselect/{roleId}")
@GetMapping(value = "/roleApiTreeselect/{roleId}", name = "资源管理-加载对应角色资源列表树")
public R roleMenuTreeSelect(@PathVariable("roleId") Long roleId) {
List<SysResourceEntity> resources = resourceService.selectApiResourceList(getUserId());
R ajax = R.ok();
Expand All @@ -34,13 +37,12 @@ public R roleMenuTreeSelect(@PathVariable("roleId") Long roleId) {
/**
* 修改对应角色api资源
*/
@PutMapping(value = "/roleApi")
@PutMapping(value = "/roleApi", name = "修改对应角色api资源")
public R editRoleResource(Long roleId, Long[] resourceIds) {
resourceService.editRoleResource(roleId, resourceIds);
//更新redis缓存权限数据
permissionService.resetLoginUserRoleCache(roleId);
return R.ok();

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.oddfar.campus.common.domain.entity.SysConfigEntity;
import com.oddfar.campus.common.enums.ResBizTypeEnum;
import com.oddfar.campus.framework.service.SysConfigService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
Expand All @@ -17,21 +16,20 @@
*/
@RestController
@RequestMapping("/system/config")
@ApiResource(name = "参数配置管理" , resBizType = ResBizTypeEnum.SYSTEM)
@ApiResource(name = "参数配置管理", resBizType = ResBizTypeEnum.SYSTEM)
public class SysConfigController {
@Autowired
private SysConfigService configService;

@GetMapping(value = "page" , name = "分页")
@GetMapping(value = "page", name = "参数配置管理-分页")
@PreAuthorize("@ss.hasPermi('system:config:list')")
public R page(SysConfigEntity sysConfigEntity) {
PageResult<SysConfigEntity> page = configService.page(sysConfigEntity);

return R.ok().put(page);
}

@GetMapping("{id}")
@Operation(summary = "信息")
@GetMapping(value = "{id}", name = "参数配置管理-查询id信息")
@PreAuthorize("@ss.hasPermi('system:config:query')")
public R getInfo(@PathVariable("id") Long id) {
SysConfigEntity entity = configService.selectConfigById(id);
Expand All @@ -47,8 +45,7 @@ public R getConfigKey(@PathVariable String configKey) {
return R.ok(configService.selectConfigByKey(configKey));
}

@PostMapping
@Operation(summary = "保存")
@PostMapping(name = "参数配置管理-新增")
@PreAuthorize("@ss.hasPermi('system:config:add')")
public R add(@Validated @RequestBody SysConfigEntity config) {
if (!configService.checkConfigKeyUnique(config)) {
Expand All @@ -58,8 +55,7 @@ public R add(@Validated @RequestBody SysConfigEntity config) {

}

@PutMapping
@Operation(summary = "修改")
@PutMapping(name = "参数配置管理-修改")
@PreAuthorize("@ss.hasPermi('system:config:edit')")
public R edit(@Validated @RequestBody SysConfigEntity config) {
if (!configService.checkConfigKeyUnique(config)) {
Expand All @@ -69,8 +65,7 @@ public R edit(@Validated @RequestBody SysConfigEntity config) {

}

@DeleteMapping("/{configIds}")
@Operation(summary = "删除")
@DeleteMapping(value = "/{configIds}", name = "参数配置管理-删除")
@PreAuthorize("@ss.hasPermi('system:config:remove')")
public R remove(@PathVariable Long[] configIds) {
configService.deleteConfigByIds(configIds);
Expand All @@ -82,7 +77,7 @@ public R remove(@PathVariable Long[] configIds) {
* 刷新参数缓存
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@DeleteMapping("/refreshCache")
@DeleteMapping(value = "/refreshCache", name = "参数配置管理-刷新缓存")
public R refreshCache() {
configService.resetConfigCache();
return R.ok();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.oddfar.campus.admin.controller.system;

import com.oddfar.campus.common.annotation.Anonymous;
import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.domain.PageResult;
import com.oddfar.campus.common.domain.R;
Expand Down Expand Up @@ -27,16 +28,17 @@ public class SysDictDataController {


@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public R page( SysDictDataEntity dictData) {
@GetMapping(value = "/list", name = "字典数据管理-分页")
public R page(SysDictDataEntity dictData) {
PageResult<SysDictDataEntity> page = dictDataService.page(dictData);
return R.ok().put(page);
}

/**
* 根据字典类型查询字典数据信息
*/
@GetMapping(value = "/type/{dictType}")
@GetMapping(value = "/type/{dictType}", name = "字典数据管理-根据字典类型查询字典数据信息")
@Anonymous
public R dictType(@PathVariable String dictType) {

List<SysDictDataEntity> data = dictTypeService.selectDictDataByType(dictType);
Expand All @@ -51,7 +53,7 @@ public R dictType(@PathVariable String dictType) {
* 查询字典数据详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}")
@GetMapping(value = "/{dictCode}", name = "字典数据管理-查询")
public R getInfo(@PathVariable Long dictCode) {
return R.ok(dictDataService.selectDictDataById(dictCode));
}
Expand All @@ -61,7 +63,7 @@ public R getInfo(@PathVariable Long dictCode) {
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@PostMapping
@PostMapping(name = "字典数据管理-新增")
public R add(@Validated @RequestBody SysDictDataEntity dict) {
return R.ok(dictDataService.insertDictData(dict));
}
Expand All @@ -70,7 +72,7 @@ public R add(@Validated @RequestBody SysDictDataEntity dict) {
* 修改保存字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@PutMapping
@PutMapping(name = "字典数据管理-修改")
public R edit(@Validated @RequestBody SysDictDataEntity dict) {
return R.ok(dictDataService.updateDictData(dict));
}
Expand All @@ -79,7 +81,7 @@ public R edit(@Validated @RequestBody SysDictDataEntity dict) {
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@DeleteMapping("/{dictCodes}")
@DeleteMapping(value = "/{dictCodes}", name = "字典数据管理-删除")
public R remove(@PathVariable Long[] dictCodes) {
dictDataService.deleteDictDataByIds(dictCodes);
return R.ok();
Expand Down
Loading

0 comments on commit 5a88845

Please sign in to comment.