-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
d532fdb
commit 8c4b051
Showing
24 changed files
with
561 additions
and
12 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
59 changes: 59 additions & 0 deletions
59
spzx/spzx-manager/src/main/java/com/manager/controller/SysRoleController.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,59 @@ | ||
package com.manager.controller; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.manager.service.SysRoleService; | ||
import com.model.dto.system.SysRoleDto; | ||
import com.model.entity.system.SysRole; | ||
import com.model.vo.common.Result; | ||
import com.model.vo.common.ResultCodeEnum; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/8 | ||
**/ | ||
@RestController | ||
@Tag(name="系统角色") | ||
@RequestMapping("/admin/system/sysRole") | ||
public class SysRoleController { | ||
@Autowired | ||
private SysRoleService sysRoleService; | ||
|
||
@DeleteMapping("/deleteSysRole/{id}") | ||
public Result deleteSysRole(@PathVariable("id") Long id){ | ||
sysRoleService.deleteSysRole(id); | ||
return Result.build(null,200,"删除成功"); | ||
} | ||
|
||
@PutMapping("/updateSysRole") | ||
public Result updateSysRole(@RequestBody SysRole sysRole){ | ||
sysRoleService.updateSysRole(sysRole); | ||
return Result.build(null,200,"更新成功"); | ||
} | ||
/** | ||
* 保存角色 | ||
* @param sysRole | ||
* @return | ||
*/ | ||
@PostMapping("saveSysRole") | ||
public Result saveSysRole(@RequestBody SysRole sysRole,@RequestHeader(name="token") String token) { | ||
sysRoleService.saveSysRole(sysRole); | ||
return Result.build(null, ResultCodeEnum.SUCCESS); | ||
} | ||
/** | ||
* 条件分页查询角色列表 | ||
* @param sysRoleDto | ||
* @param pageNum | ||
* @param pageSize | ||
* @return | ||
*/ | ||
@GetMapping("findByPage/{pageNum}/{pageSize}") | ||
public Result<PageInfo<SysRole>> findByPage(SysRoleDto sysRoleDto, | ||
@PathVariable("pageNum") Integer pageNum, | ||
@PathVariable("pageSize") Integer pageSize) { | ||
PageInfo<SysRole> rolePageInfo = sysRoleService.findByPage(sysRoleDto, pageNum, pageSize); | ||
return Result.build(rolePageInfo, ResultCodeEnum.SUCCESS); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
spzx/spzx-manager/src/main/java/com/manager/controller/SysUserController.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,62 @@ | ||
package com.manager.controller; | ||
|
||
import com.github.pagehelper.PageInfo; | ||
import com.manager.service.SysUserService; | ||
import com.model.dto.system.SysUserDto; | ||
import com.model.entity.system.SysUser; | ||
import com.model.vo.common.Result; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/10 | ||
**/ | ||
@RestController | ||
@RequestMapping(value = "/admin/system/sysUser") | ||
public class SysUserController { | ||
@Autowired | ||
private SysUserService sysUserService; | ||
/** | ||
* 删除用户 | ||
* @param id | ||
* @return | ||
*/ | ||
@DeleteMapping(value = "/deleteSysUser/{id}") | ||
public Result deleteSysUser(@PathVariable("id") Long id) { | ||
sysUserService.deleteSysUser(id); | ||
return Result.build(null,200,"删除成功"); | ||
} | ||
|
||
|
||
@PutMapping(value = "/updateSysUser") | ||
public Result updateSysUser(@RequestBody SysUser sysUser) { | ||
sysUserService.updateSysUser(sysUser); | ||
return Result.build(null,200,"修改成功"); | ||
} | ||
/** | ||
* 保存用户 | ||
* @param sysUser | ||
* @return | ||
*/ | ||
@PostMapping(value = "/saveSysUser") | ||
public Result saveSysUser(@RequestBody SysUser sysUser) { | ||
sysUserService.saveSysUser(sysUser); | ||
return Result.build(null,200,"保存成功"); | ||
} | ||
|
||
/** | ||
* 分页查询用户 | ||
* @param pageNum | ||
* @param pageSize | ||
* @param sysUserDto | ||
* @return | ||
*/ | ||
@GetMapping(value = "/findByPage/{pageNum}/{pageSize}") | ||
public Result<PageInfo<SysUser>> findByPage(SysUserDto sysUserDto, | ||
@PathVariable("pageNum") Integer pageNum, | ||
@PathVariable("pageSize") Integer pageSize) { | ||
PageInfo<SysUser> pageInfo = sysUserService.findByPage(sysUserDto, pageNum, pageSize); | ||
return Result.build(pageInfo,200,"查询成功"); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
spzx/spzx-manager/src/main/java/com/manager/demo/FileUploader.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,47 @@ | ||
package com.manager.demo; | ||
|
||
import io.minio.BucketExistsArgs; | ||
import io.minio.MakeBucketArgs; | ||
import io.minio.MinioClient; | ||
import io.minio.PutObjectArgs; | ||
|
||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.security.InvalidKeyException; | ||
import java.security.NoSuchAlgorithmException; | ||
|
||
public class FileUploader { | ||
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException { | ||
try { | ||
// 创建minioClient客户端 | ||
MinioClient minioClient = | ||
MinioClient.builder() | ||
.endpoint("http://127.0.0.1:9001") | ||
.credentials("admin", "admin123456") | ||
.build(); | ||
|
||
// 判断是否存在指定的桶 | ||
boolean found = | ||
minioClient.bucketExists(BucketExistsArgs.builder().bucket("demo").build()); | ||
if (!found) { | ||
// 不存在则创建 | ||
minioClient.makeBucket(MakeBucketArgs.builder().bucket("demo").build()); | ||
} else { | ||
System.out.println("Bucket 'asiatrip' already exists."); | ||
} | ||
//上传 | ||
FileInputStream fis = new FileInputStream("D://001.jpg") ; | ||
|
||
minioClient.putObject( | ||
PutObjectArgs.builder().bucket("demo") | ||
.object("001.jpg") | ||
.stream(fis, fis.available(),-1) | ||
//.contentType("video.mp4") | ||
.build() | ||
); | ||
fis.close(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
spzx/spzx-manager/src/main/java/com/manager/mapper/SysRoleMapper.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,19 @@ | ||
package com.manager.mapper; | ||
|
||
import com.model.dto.system.SysRoleDto; | ||
import com.model.entity.system.SysRole; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/8 | ||
**/ | ||
@Mapper | ||
public interface SysRoleMapper { | ||
public List<SysRole> findByPage(SysRoleDto sysRoleDto); | ||
void saveSysRole(SysRole sysRole); | ||
void updateSysRole(SysRole sysRole); | ||
void deleteSysRole(Long id); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
spzx/spzx-manager/src/main/java/com/manager/properties/UserAuthProperties.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,16 @@ | ||
package com.manager.properties; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author 帕斯卡的芦苇 | ||
* @date 2025/1/6 | ||
**/ | ||
@Data | ||
@ConfigurationProperties(prefix = "spzx.auth") | ||
public class UserAuthProperties { | ||
private List<String> noAuthUrls ; | ||
} |
Oops, something went wrong.