4-27 代码提交 todo待测试
This commit is contained in:
@@ -56,17 +56,6 @@
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.10.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.security.oauth.boot</groupId>
|
||||
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
||||
<version>2.0.0.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yxt.demo.system.api.sys_info_ship;
|
||||
|
||||
import com.yxt.demo.system.api.sys_user.SysUserDto;
|
||||
import com.yxt.demo.system.biz.sys_info_ship.SysInfoShipService;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @author shkstart
|
||||
* @create 2023-04-27-15:20
|
||||
*/
|
||||
@Api(tags = "教师学生表")
|
||||
public interface SysInfoShipFeign {
|
||||
|
||||
@ApiOperation(value = "添加教师学生")
|
||||
@RequestMapping("/saveSysInfoShip")
|
||||
ResultBean saveSysInfoShip(@RequestBody SysInfoShip sysInfoShip);
|
||||
|
||||
@ApiOperation(value = "删除教师学生关联")
|
||||
@RequestMapping("/deleteSysInfoShip/{sid}")
|
||||
ResultBean deleteSysInfoShip(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
|
||||
@ApiOperation(value = "修改教师学生关联")
|
||||
@RequestMapping("alterSysInfoShip")
|
||||
ResultBean alterSysInfoShip(@RequestBody SysInfoShip sysInfoShip);
|
||||
|
||||
@ApiOperation(value = "查询教师学生关联")
|
||||
@RequestMapping("/selectSysInfoShip")
|
||||
ResultBean selectSysInfoShip();
|
||||
}
|
||||
@@ -12,6 +12,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class SysMenu extends BaseEntity {
|
||||
private static final long serialVersionUID = 1451455109001765427L;
|
||||
@ApiModelProperty("唯一id")
|
||||
private Integer id;
|
||||
@ApiModelProperty("菜单名称")
|
||||
private String name;
|
||||
@ApiModelProperty("菜单路由路径")
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.yxt.demo.system.api.sys_menu;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
@@ -20,5 +20,13 @@ public interface SysMenuFeign {
|
||||
|
||||
@PostMapping(value = "/list")
|
||||
@ApiOperation(value = "列表")
|
||||
ResultBean<SysMenuVo> list(@RequestBody SysMenuQuery sysMenuQuery);
|
||||
ResultBean list();
|
||||
|
||||
@RequestMapping(value = "/deleteSysMenu/{sid}")
|
||||
@ApiOperation(value = "删除菜单")
|
||||
ResultBean deleteSysMenu(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
|
||||
@RequestMapping(value = "/alterSysMenu")
|
||||
@ApiOperation(value = "修改菜单")
|
||||
ResultBean alterSysMenu(@RequestBody SysMenu sysMenu);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.yxt.demo.system.api.sys_menu_role;
|
||||
|
||||
import com.yxt.demo.system.api.sys_user.SysUserDto;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @author shkstart
|
||||
* @create 2023-04-27-13:32
|
||||
*/
|
||||
@Api(tags = "菜单角色表")
|
||||
public interface SysMenuRoleFeign {
|
||||
|
||||
@ApiOperation(value = "给菜单设置角色")
|
||||
@RequestMapping("/addSysMenuRole")
|
||||
ResultBean addSysMenuRole(@RequestBody SysMenuRole sysMenuRole);
|
||||
|
||||
@ApiOperation(value = "删除给菜单设置的权限")
|
||||
@RequestMapping("/deleteSysMenuRole")
|
||||
ResultBean deleteSysMenuRole(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
|
||||
@ApiOperation(value = "修改菜单角色")
|
||||
@RequestMapping("/alterSysMenuRole")
|
||||
ResultBean alterSysMenuRole(@RequestBody SysMenuRole sysMenuRole);
|
||||
|
||||
@ApiOperation(value = "查询菜单角色")
|
||||
@RequestMapping("/selectSysMenuRole")
|
||||
ResultBean selectSysMenuRole();
|
||||
}
|
||||
@@ -1,9 +1,34 @@
|
||||
package com.yxt.demo.system.api.sys_plan;
|
||||
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:24
|
||||
* @Description
|
||||
*/
|
||||
@Api(tags = "自主学习表")
|
||||
public interface SysPlanFeign {
|
||||
|
||||
@ApiOperation(value = "添加自主学习计划")
|
||||
@RequestMapping("/saveSysPlan")
|
||||
ResultBean saveSysPlan(@RequestBody SysPlan sysPlan);
|
||||
|
||||
@ApiOperation(value = "删除自主学习计划")
|
||||
@RequestMapping("/deleteSysPlan/{sid}")
|
||||
ResultBean deleteSysPlan(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
|
||||
@ApiOperation(value = "修改自主学习计划")
|
||||
@RequestMapping("/alterSysPlan")
|
||||
ResultBean alterSysPlan(@RequestBody SysPlan sysPlan);
|
||||
|
||||
@ApiOperation(value = "查询自主学习计划")
|
||||
@RequestMapping("/selectSysPlan")
|
||||
ResultBean selectSysPlan();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
package com.yxt.demo.system.api.sys_plan_schedule;
|
||||
|
||||
import com.yxt.demo.system.api.sys_user.SysUserDto;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:25
|
||||
* @Description
|
||||
*/
|
||||
@Api(tags = "自主学习计划进度表")
|
||||
public interface SysPlanScheduleFeign {
|
||||
|
||||
@ApiOperation(value = "修改自主学习计划进度")
|
||||
@PostMapping("/alterSysPlanSchedule")
|
||||
ResultBean alterSysPlanSchedule(@RequestBody SysPlanSchedule sysPlanSchedule);
|
||||
|
||||
// @ApiOperation(value = "添加自主学习计划进度")
|
||||
// @PostMapping("/alterSysPlanSchedule")
|
||||
// ResultBean
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ package com.yxt.demo.system.api.sys_score;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
@@ -14,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
@Api(tags = "成绩表")
|
||||
public interface SysScoreFeign {
|
||||
|
||||
@ApiOperation(value = "查询成绩")
|
||||
@ApiOperation(value = "添加成绩")
|
||||
@PostMapping("/save")
|
||||
ResultBean save(@RequestBody SysScoreDto sysScoreDto);
|
||||
|
||||
@@ -22,4 +25,11 @@ public interface SysScoreFeign {
|
||||
@PostMapping("/update")
|
||||
ResultBean alterById(@RequestBody SysScore sysScore);
|
||||
|
||||
@ApiOperation(value = "查询成绩")
|
||||
@RequestMapping("/selectScore")
|
||||
ResultBean selectScore();
|
||||
|
||||
@ApiOperation(value = "删除成绩")
|
||||
@RequestMapping("/deleteScore")
|
||||
ResultBean deleteScore(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,35 @@
|
||||
package com.yxt.demo.system.api.sys_student_score;
|
||||
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:29
|
||||
* @Description
|
||||
*/
|
||||
@Api(tags = "学生成绩表")
|
||||
public interface SysStudentScoreFeign {
|
||||
|
||||
@ApiOperation(value = "添加学生成绩")
|
||||
@RequestMapping("/addStudentScore")
|
||||
ResultBean addStudentScore(@RequestBody SysStudentScore sysStudentScore);
|
||||
|
||||
@ApiOperation(value = "删除学生成绩")
|
||||
@RequestMapping("/deleteStudentScore")
|
||||
ResultBean deleteStudentScore(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
|
||||
@ApiOperation(value = "修改学生成绩")
|
||||
@RequestMapping("/alterStudentScore")
|
||||
ResultBean alterStudentScore(@RequestBody SysStudentScore sysStudentScore);
|
||||
|
||||
@ApiOperation(value = "查询学生信息")
|
||||
@RequestMapping("/selectStudentScore")
|
||||
ResultBean selectStudentScore();
|
||||
}
|
||||
|
||||
@@ -27,4 +27,6 @@ public class SysUser extends BaseEntity {
|
||||
private int type;
|
||||
@ApiModelProperty("是否已激活:0未激活,1已激活")
|
||||
private int hasActivated;
|
||||
@ApiModelProperty("token")
|
||||
private String token;
|
||||
}
|
||||
|
||||
@@ -26,4 +26,8 @@ public interface SysUserRoleFeign {
|
||||
@ApiOperation(value = "删除该用户角色")
|
||||
@RequestMapping("/deleteUserRoleById")
|
||||
ResultBean deleteUserRoleById(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||
|
||||
@ApiOperation(value = "查询用户权限")
|
||||
@RequestMapping("/selectUserRole")
|
||||
ResultBean selectUserRole();
|
||||
}
|
||||
|
||||
@@ -3,10 +3,8 @@ package com.yxt.demo.system.biz.sys_info;
|
||||
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.biz.sys_user.SysUserMapper;
|
||||
import com.yxt.demo.system.biz.sys_user.SysUserService;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||
import com.yxt.demo.system.utils.Const;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -30,46 +28,30 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
||||
}
|
||||
|
||||
public ResultBean alterInfo(SysInfo sysInfo){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysInfo.setUpdateBySid(user.getSid());
|
||||
sysInfo.setModifyTime(new Date());
|
||||
int i = baseMapper.updateById(sysInfo);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
return rb.setMsg("修改成功");
|
||||
return rb.success().setMsg("修改成功");
|
||||
}
|
||||
|
||||
public ResultBean selectInfoOne(SysInfoPageCount sysInfoPageCount){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int type = user.getType();
|
||||
if (type == 0 || type == 1){
|
||||
SysInfo sysInfo = baseMapper.selectStudentBySid(sysInfoPageCount);
|
||||
return rb.setData(sysInfo);
|
||||
}else if (type == 2){
|
||||
List<SysInfo> sysInfos = baseMapper.selectInfoList(sysInfoPageCount);
|
||||
return rb.setData(sysInfos);
|
||||
}
|
||||
return rb;
|
||||
return rb.success().setData(sysInfo);
|
||||
}
|
||||
|
||||
public ResultBean deleteInfoBySid(String sid){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
if (user.getType() == 2){
|
||||
SysInfo sysInfo = baseMapper.selectBySid(sid);
|
||||
baseMapper.deleteInfoBySid(sid);
|
||||
sysUserMapper.deleteUserBySid(sysInfo.getUserSid());
|
||||
return rb.setMsg("删除成功");
|
||||
}else {
|
||||
return rb.setMsg("无权操作");
|
||||
}
|
||||
return rb.success().setMsg("删除成功");
|
||||
}
|
||||
|
||||
public ResultBean saveInfo(SysInfo sysInfo){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
SysUser sysUser = sysUserMapper.selectByNameAndUserName(sysInfo.getInfoId(), sysInfo.getName());
|
||||
if (sysUser != null){
|
||||
@@ -77,7 +59,6 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
||||
baseMapper.insert(sysInfo);
|
||||
sysUser.setInfoSid(sysInfo.getSid());
|
||||
sysUser.setModifyTime(new Date());
|
||||
sysUser.setUpdateBySid(user.getSid());
|
||||
sysUserMapper.updateById(sysUser);
|
||||
return rb.success();
|
||||
}else {
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.yxt.demo.system.biz.sys_info_ship;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:15
|
||||
* @Description
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysInfoShipMapper {
|
||||
public interface SysInfoShipMapper extends BaseMapper<SysInfoShip> {
|
||||
List<SysInfoShip> selectSysInfoShipList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_info_ship.SysInfoShipMapper">
|
||||
<select id="selectSysInfoShipList" resultType="com.yxt.demo.system.api.sys_info_ship.SysInfoShip">
|
||||
select * from sys_info_ship
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.yxt.demo.system.biz.sys_info_ship;
|
||||
|
||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShipFeign;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author shkstart
|
||||
* @create 2023-04-27-15:28
|
||||
*/
|
||||
@Api(tags = "教师学生表")
|
||||
@RestController
|
||||
@RequestMapping("v1/sysinfoship")
|
||||
public class SysInfoShipRest implements SysInfoShipFeign {
|
||||
|
||||
@Autowired
|
||||
private SysInfoShipService sysInfoShipService;
|
||||
|
||||
@Override
|
||||
public ResultBean saveSysInfoShip(SysInfoShip sysInfoShip) {
|
||||
return sysInfoShipService.saveSysInfoShip(sysInfoShip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteSysInfoShip(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysInfoShipService.deleteBySid(sid);
|
||||
if (i == 0){
|
||||
return rb.setMsg("删除失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean alterSysInfoShip(SysInfoShip sysInfoShip) {
|
||||
return sysInfoShipService.alterSysInfoShip(sysInfoShip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean selectSysInfoShip() {
|
||||
return sysInfoShipService.selectSysInfoShip();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,47 @@
|
||||
package com.yxt.demo.system.biz.sys_info_ship;
|
||||
|
||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:15
|
||||
* @Description
|
||||
*/
|
||||
@Service
|
||||
public class SysInfoShipService {
|
||||
public class SysInfoShipService extends MybatisBaseService<SysInfoShipMapper, SysInfoShip> {
|
||||
|
||||
@Autowired
|
||||
private SysInfoShipMapper sysInfoShipMapper;
|
||||
|
||||
public ResultBean saveSysInfoShip(SysInfoShip sysInfoShip) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int insert = baseMapper.insert(sysInfoShip);
|
||||
if (insert == 0){
|
||||
return rb.setMsg("添加失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean alterSysInfoShip(SysInfoShip sysInfoShip){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysInfoShip.setModifyTime(new Date());
|
||||
int i = baseMapper.updateById(sysInfoShip);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean selectSysInfoShip() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysInfoShip> sysInfoShips = sysInfoShipMapper.selectSysInfoShipList();
|
||||
return rb.success().setData(sysInfoShips);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:09
|
||||
@@ -12,4 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysMenuMapper extends BaseMapper<SysMenu> {
|
||||
|
||||
List<SysMenu> selectMenuList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_menu.SysMenuMapper">
|
||||
<select id="selectMenuList" resultType="com.yxt.demo.system.api.sys_menu.SysMenu">
|
||||
select * from sys_menu
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.yxt.demo.system.biz.sys_menu;
|
||||
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenuDto;
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenuFeign;
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenuQuery;
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenuVo;
|
||||
import com.yxt.demo.system.api.sys_menu.*;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @Date 2023/4/24 14:09
|
||||
* @Description
|
||||
*/
|
||||
@Api(tags = "菜单")
|
||||
@Api(tags = "菜单表")
|
||||
@RestController
|
||||
@RequestMapping("v1/SysMenu")
|
||||
public class SysMenuRest implements SysMenuFeign {
|
||||
@@ -28,7 +25,27 @@ public class SysMenuRest implements SysMenuFeign {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<SysMenuVo> list(SysMenuQuery sysMenuQuery) {
|
||||
return sysMenuService.lists(sysMenuQuery);
|
||||
public ResultBean list() {
|
||||
return sysMenuService.lists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteSysMenu(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysMenuService.deleteBySid(sid);
|
||||
if (i == 0){
|
||||
return rb.setMsg("删除失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean alterSysMenu(SysMenu sysMenu) {
|
||||
try {
|
||||
return sysMenuService.alterSysMenu(sysMenu);
|
||||
}catch (Exception e){
|
||||
e.getLocalizedMessage();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,12 @@ import com.yxt.demo.system.api.sys_menu.SysMenuDto;
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenuQuery;
|
||||
import com.yxt.demo.system.api.sys_menu.SysMenuVo;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:09
|
||||
@@ -18,6 +22,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SysMenuService extends MybatisBaseService<SysMenuMapper, SysMenu> {
|
||||
|
||||
@Autowired
|
||||
private SysMenuMapper sysMenuMapper;
|
||||
|
||||
public ResultBean saveOrUpdates(SysMenuDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
@@ -37,7 +43,23 @@ public class SysMenuService extends MybatisBaseService<SysMenuMapper, SysMenu> {
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean<SysMenuVo> lists(SysMenuQuery sysMenuQuery) {
|
||||
return null;
|
||||
public ResultBean lists() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysMenu> sysMenus = sysMenuMapper.selectMenuList();
|
||||
return rb.success().setData(sysMenus);
|
||||
}
|
||||
|
||||
public ResultBean alterSysMenu(SysMenu sysMenu) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysMenu.setModifyTime(new Date());
|
||||
try {
|
||||
int i = baseMapper.updateById(sysMenu);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.getLocalizedMessage();
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
package com.yxt.demo.system.biz.sys_menu_role;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.demo.system.api.sys_menu_role.SysMenuRole;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:12
|
||||
* @Description
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysMenuRoleMapper {
|
||||
public interface SysMenuRoleMapper extends BaseMapper<SysMenuRole> {
|
||||
|
||||
List<SysMenuRole> selectMenuRoleList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_menu_role.SysMenuRoleMapper">
|
||||
<select id="selectMenuRoleList" resultType="com.yxt.demo.system.api.sys_menu_role.SysMenuRole">
|
||||
select * from sys_menu_role
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.yxt.demo.system.biz.sys_menu_role;
|
||||
|
||||
import com.yxt.demo.system.api.sys_menu_role.SysMenuRole;
|
||||
import com.yxt.demo.system.api.sys_menu_role.SysMenuRoleFeign;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author shkstart
|
||||
* @create 2023-04-27-13:39
|
||||
*/
|
||||
@Api(tags = "菜单角色表")
|
||||
@RestController
|
||||
@RequestMapping("v1/sysmenurole")
|
||||
public class SysMenuRoleRest implements SysMenuRoleFeign {
|
||||
|
||||
@Autowired
|
||||
private SysMenuRoleService sysMenuRoleService;
|
||||
|
||||
@Override
|
||||
public ResultBean addSysMenuRole(SysMenuRole sysMenuRole) {
|
||||
return sysMenuRoleService.addSysMenuRole(sysMenuRole);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteSysMenuRole(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysMenuRoleService.deleteBySid(sid);
|
||||
if (i == 0){
|
||||
return rb.setMsg("删除失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean alterSysMenuRole(SysMenuRole sysMenuRole) {
|
||||
return sysMenuRoleService.alterSysMenuRole(sysMenuRole);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean selectSysMenuRole() {
|
||||
return sysMenuRoleService.selectSysMenuRole();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,47 @@
|
||||
package com.yxt.demo.system.biz.sys_menu_role;
|
||||
|
||||
import com.yxt.demo.system.api.sys_menu_role.SysMenuRole;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:12
|
||||
* @Description
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuRoleService {
|
||||
public class SysMenuRoleService extends MybatisBaseService<SysMenuRoleMapper, SysMenuRole> {
|
||||
|
||||
@Autowired
|
||||
private SysMenuRoleMapper sysMenuRoleMapper;
|
||||
|
||||
public ResultBean addSysMenuRole(SysMenuRole sysMenuRole){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int insert = baseMapper.insert(sysMenuRole);
|
||||
if (insert == 0){
|
||||
return rb.setMsg("添加失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean alterSysMenuRole(SysMenuRole sysMenuRole){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysMenuRole.setModifyTime(new Date());
|
||||
int i = baseMapper.updateById(sysMenuRole);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean selectSysMenuRole(){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysMenuRole> sysMenuRoles = sysMenuRoleMapper.selectMenuRoleList();
|
||||
return rb.success().setData(sysMenuRoles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package com.yxt.demo.system.biz.sys_plan;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:24
|
||||
* @Description
|
||||
*/
|
||||
public interface SysPlanMapper {
|
||||
@Mapper
|
||||
public interface SysPlanMapper extends BaseMapper<SysPlan> {
|
||||
List<SysPlan> selectSysPlanList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_plan.SysPlanMapper">
|
||||
<select id="selectSysPlanList" resultType="com.yxt.demo.system.api.sys_plan.SysPlan">
|
||||
select * from sys_plan
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,9 +1,48 @@
|
||||
package com.yxt.demo.system.biz.sys_plan;
|
||||
|
||||
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
||||
import com.yxt.demo.system.api.sys_plan.SysPlanFeign;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:24
|
||||
* @Description
|
||||
*/
|
||||
public class SysPlanRest {
|
||||
@Api(tags = "自主学习表")
|
||||
@RestController
|
||||
@RequestMapping("v1/sysPlan")
|
||||
public class SysPlanRest implements SysPlanFeign {
|
||||
|
||||
@Autowired
|
||||
private SysPlanService sysPlanService;
|
||||
|
||||
@Override
|
||||
public ResultBean saveSysPlan(SysPlan sysPlan) {
|
||||
return sysPlanService.saveSysPlan(sysPlan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteSysPlan(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysPlanService.deleteBySid(sid);
|
||||
if (i == 0){
|
||||
return rb.setMsg("删除失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean alterSysPlan(SysPlan sysPlan) {
|
||||
return sysPlanService.alterSysPlan(sysPlan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean selectSysPlan() {
|
||||
return sysPlanService.selectSysPlan();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,45 @@
|
||||
package com.yxt.demo.system.biz.sys_plan;
|
||||
|
||||
import com.yxt.demo.system.api.sys_plan.SysPlan;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:24
|
||||
* @Description
|
||||
*/
|
||||
public class SysPlanService {
|
||||
@Service
|
||||
public class SysPlanService extends MybatisBaseService<SysPlanMapper, SysPlan> {
|
||||
|
||||
@Autowired
|
||||
private SysPlanMapper sysPlanMapper;
|
||||
|
||||
public ResultBean saveSysPlan(SysPlan sysPlan){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int insert = baseMapper.insert(sysPlan);
|
||||
if (insert == 0){
|
||||
return rb.setMsg("添加失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean alterSysPlan(SysPlan sysPlan) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = baseMapper.updateById(sysPlan);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean selectSysPlan() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysPlan> sysPlans = sysPlanMapper.selectSysPlanList();
|
||||
return rb.success().setData(sysPlans);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.yxt.demo.system.biz.sys_plan_schedule;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:25
|
||||
* @Description
|
||||
*/
|
||||
public interface SysPlanScheduleMapper {
|
||||
@Mapper
|
||||
public interface SysPlanScheduleMapper extends BaseMapper<SysPlanSchedule> {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,28 @@
|
||||
package com.yxt.demo.system.biz.sys_plan_schedule;
|
||||
|
||||
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule;
|
||||
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanScheduleFeign;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:25
|
||||
* @Description
|
||||
*/
|
||||
public class SysPlanScheduleRest {
|
||||
@Api(tags = "自主学习计划进度表")
|
||||
@RestController
|
||||
@RequestMapping("v1/sysPlanSchedule")
|
||||
public class SysPlanScheduleRest implements SysPlanScheduleFeign{
|
||||
|
||||
@Autowired
|
||||
private SysPlanScheduleService sysPlanScheduleService;
|
||||
|
||||
@Override
|
||||
public ResultBean alterSysPlanSchedule(SysPlanSchedule sysPlanSchedule) {
|
||||
return sysPlanScheduleService.alterSysPlanSchedule(sysPlanSchedule);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,31 @@
|
||||
package com.yxt.demo.system.biz.sys_plan_schedule;
|
||||
|
||||
import com.yxt.demo.system.api.sys_plan_schedule.SysPlanSchedule;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:25
|
||||
* @Description
|
||||
*/
|
||||
public class SysPlanScheduleService {
|
||||
@Service
|
||||
public class SysPlanScheduleService extends MybatisBaseService<SysPlanScheduleMapper, SysPlanSchedule> {
|
||||
|
||||
|
||||
public ResultBean alterSysPlanSchedule(SysPlanSchedule sysPlanSchedule){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysPlanSchedule.setModifyTime(new Date());
|
||||
int i = baseMapper.updateById(sysPlanSchedule);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public void saveSysPlanSchedule(){
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_role.SysRoleMapper">
|
||||
<select id="selectRole" resultType="com.yxt.demo.system.api.sys_role.SysRoleDto">
|
||||
select * from sys_role where name == #{name}
|
||||
select * from sys_role where name = #{name}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleList" resultType="com.yxt.demo.system.api.sys_role.SysRoleDto">
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.yxt.demo.system.api.sys_role.SysRoleFeign;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.api.sys_user_role.SysUserRole;
|
||||
import com.yxt.demo.system.biz.sys_user_role.SysUserRoleSerrvice;
|
||||
import com.yxt.demo.system.utils.Const;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -28,7 +27,7 @@ public class SysRoleRest implements SysRoleFeign {
|
||||
|
||||
@Autowired
|
||||
private SysUserRoleSerrvice sysUserRoleSerrvice;
|
||||
//
|
||||
|
||||
@Override
|
||||
public ResultBean addRole(SysRole sysRole) {
|
||||
return sysRoleService.addRole(sysRole);
|
||||
@@ -36,9 +35,7 @@ public class SysRoleRest implements SysRoleFeign {
|
||||
|
||||
@Override
|
||||
public ResultBean deleteRole(String sid){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
if (user.getType() == 2){
|
||||
SysRole sysRole = sysRoleService.fetchBySid(sid);
|
||||
if (sysRole == null){
|
||||
return rb.setMsg("该角色不存在");
|
||||
@@ -51,9 +48,6 @@ public class SysRoleRest implements SysRoleFeign {
|
||||
return rb.setMsg("删除失败");
|
||||
}
|
||||
return rb.success().setMsg("删除成功");
|
||||
}else {
|
||||
return rb.setMsg("无权操作");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.yxt.demo.system.biz.sys_role;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.api.sys_role.SysRole;
|
||||
import com.yxt.demo.system.utils.Const;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -23,11 +22,9 @@ public class SysRoleService extends MybatisBaseService<SysRoleMapper, SysRole> {
|
||||
private SysRoleMapper sysRoleMapper;
|
||||
|
||||
public ResultBean addRole(SysRole sysRole){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
SysRole sysRole1 = sysRoleMapper.selectRole(sysRole.getName());
|
||||
if (sysRole1 == null){
|
||||
sysRole.setCreateBySid(user.getSid());
|
||||
sysRole.setCreateTime(new Date());
|
||||
int insert = baseMapper.insert(sysRole);
|
||||
if (insert == 1){
|
||||
@@ -43,24 +40,19 @@ public class SysRoleService extends MybatisBaseService<SysRoleMapper, SysRole> {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysRole> sysRoles = sysRoleMapper.selectRoleList();
|
||||
if (sysRoles.size() != 0){
|
||||
return rb.setData(sysRoles);
|
||||
return rb.success().setData(sysRoles);
|
||||
}else {
|
||||
return rb.setMsg("查询多角色失败");
|
||||
}
|
||||
}
|
||||
|
||||
public ResultBean alterRole(SysRole sysRole){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
if (user.getType() == 2){
|
||||
int i = sysRoleMapper.updateById(sysRole);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败,请重试!!!");
|
||||
}else {
|
||||
return rb.setMsg("修改成功!");
|
||||
}
|
||||
}else {
|
||||
return rb.setMsg("无权操作");
|
||||
return rb.success().setMsg("修改成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.yxt.demo.system.api.sys_score.SysScore;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:28
|
||||
@@ -12,4 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysScoreMapper extends BaseMapper<SysScore> {
|
||||
|
||||
List<SysScore> selectScoreList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_score.SysScoreMapper">
|
||||
<select id="selectScoreList" resultType="com.yxt.demo.system.api.sys_score.SysScore">
|
||||
select * from sys_score
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -31,8 +31,24 @@ public class SysScoreRest implements SysScoreFeign {
|
||||
return sysScoreService.save(sysScoreDto);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean alterById(SysScore sysScore){
|
||||
return sysScoreService.alterById(sysScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean selectScore() {
|
||||
return sysScoreService.selectScore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteScore(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysScoreService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return rb.setMsg("删除失败");
|
||||
}
|
||||
return rb.success();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.yxt.demo.system.biz.sys_score;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.api.sys_score.SysScore;
|
||||
import com.yxt.demo.system.api.sys_score.SysScoreDto;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:28
|
||||
@@ -32,4 +35,10 @@ public class SysScoreService extends MybatisBaseService<SysScoreMapper, SysScore
|
||||
return rb;
|
||||
}
|
||||
}
|
||||
|
||||
public ResultBean selectScore(){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysScore> scoreList = baseMapper.selectScoreList();
|
||||
return rb.success().setData(scoreList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package com.yxt.demo.system.biz.sys_student_score;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:31
|
||||
* @Description
|
||||
*/
|
||||
public interface SysStudentScoreMapper {
|
||||
@Mapper
|
||||
public interface SysStudentScoreMapper extends BaseMapper<SysStudentScore> {
|
||||
List<SysStudentScore> selectStudentScoreList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.yxt.demo.system.biz.sys_student_score.SysStudentScoreMapper">
|
||||
<select id="selectStudentScoreList" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScore">
|
||||
select * from sys_student_score
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,9 +1,50 @@
|
||||
package com.yxt.demo.system.biz.sys_student_score;
|
||||
|
||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreFeign;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:29
|
||||
* @Description
|
||||
*/
|
||||
public class SysStudentScoreRest {
|
||||
@Api(tags = "学生成绩表")
|
||||
@RestController
|
||||
@RequestMapping("v1/sysstudentscore")
|
||||
public class SysStudentScoreRest implements SysStudentScoreFeign {
|
||||
|
||||
@Autowired
|
||||
private SysStudentScoreService sysStudentScoreService;
|
||||
|
||||
@Override
|
||||
public ResultBean addStudentScore(SysStudentScore sysStudentScore) {
|
||||
return sysStudentScoreService.addStudentScore(sysStudentScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteStudentScore(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysStudentScoreService.deleteBySid(sid);
|
||||
if (i == 0){
|
||||
return rb.setMsg("删除失败");
|
||||
}else {
|
||||
return rb.setMsg("删除成功");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean alterStudentScore(SysStudentScore sysStudentScore) {
|
||||
return sysStudentScoreService.alterStudentScore(sysStudentScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean selectStudentScore() {
|
||||
return sysStudentScoreService.selectStudentScore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,45 @@
|
||||
package com.yxt.demo.system.biz.sys_student_score;
|
||||
|
||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author dimengzhe
|
||||
* @Date 2023/4/24 14:31
|
||||
* @Description
|
||||
*/
|
||||
public class SysStudentScoreService {
|
||||
@Service
|
||||
public class SysStudentScoreService extends MybatisBaseService<SysStudentScoreMapper, SysStudentScore>{
|
||||
|
||||
@Autowired
|
||||
private SysStudentScoreMapper sysStudentScoreMapper;
|
||||
|
||||
public ResultBean addStudentScore(SysStudentScore sysStudentScore) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
baseMapper.insert(sysStudentScore);
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean alterStudentScore(SysStudentScore sysStudentScore){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysStudentScore.setModifyTime(new Date());
|
||||
int i = baseMapper.updateById(sysStudentScore);
|
||||
if (i == 0){
|
||||
return rb.setMsg("修改失败");
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean selectStudentScore(){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysStudentScore> sysStudentScores = sysStudentScoreMapper.selectStudentScoreList();
|
||||
return rb.success().setData(sysStudentScores);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
||||
return rb.setMsg("该账号已失效");
|
||||
}
|
||||
}
|
||||
String uniqueToken = JWTUtil.create(sysUser.getSid() + "");
|
||||
sysUser.setToken(uniqueToken);
|
||||
return rb.success().setData(sysUser);
|
||||
}
|
||||
|
||||
@@ -91,7 +93,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
int i = sysUserMapper.updateById(sysUser);
|
||||
if (i != 0){
|
||||
return rb.setMsg("修改账号或密码成功");
|
||||
return rb.setMsg("修改密码成功");
|
||||
}
|
||||
return rb.setMsg("修改失败,请重试!!!");
|
||||
}
|
||||
|
||||
@@ -15,4 +15,6 @@ import java.util.List;
|
||||
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
|
||||
|
||||
List<SysUserRole> selectSysUserRole(String sid);
|
||||
|
||||
List<SysUserRole> selectUserRoleList();
|
||||
}
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
<select id="selectSysUserRole" resultType="com.yxt.demo.system.api.sys_user_role.SysUserRole">
|
||||
select * from sys_user_role
|
||||
</select>
|
||||
|
||||
<select id="selectUserRoleList" resultType="com.yxt.demo.system.api.sys_user_role.SysUserRole">
|
||||
select * from sys_user_role
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -3,7 +3,6 @@ package com.yxt.demo.system.biz.sys_user_role;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.api.sys_user_role.SysUserRole;
|
||||
import com.yxt.demo.system.api.sys_user_role.SysUserRoleFeign;
|
||||
import com.yxt.demo.system.utils.Const;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -35,16 +34,16 @@ public class SysUserRoleRest implements SysUserRoleFeign {
|
||||
@Override
|
||||
public ResultBean deleteUserRoleById(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
SysUser user = Const.getUser();
|
||||
if (user.getType() == 2){
|
||||
int i = sysUserRoleSerrvice.deleteBySid(sid);
|
||||
if (i == 0){
|
||||
return rb.setMsg("删除失败");
|
||||
}else {
|
||||
return rb.success().setMsg("删除成功");
|
||||
}
|
||||
}else {
|
||||
return rb.setMsg("无权操作");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean selectUserRole() {
|
||||
return sysUserRoleSerrvice.selectUserRole();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,10 @@ package com.yxt.demo.system.biz.sys_user_role;
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||
import com.yxt.demo.system.api.sys_user_role.SysUserRole;
|
||||
import com.yxt.demo.system.utils.Const;
|
||||
import com.yxt.demo.system.utils.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,9 +25,7 @@ public class SysUserRoleSerrvice extends MybatisBaseService<SysUserRoleMapper, S
|
||||
}
|
||||
|
||||
public ResultBean addUserRole(SysUserRole sysUserRole){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysUserRole.setCreateBySid(user.getSid());
|
||||
int insert = sysUserRoleMapper.insert(sysUserRole);
|
||||
if (insert == 0){
|
||||
return rb.setMsg("新增失败");
|
||||
@@ -38,9 +34,7 @@ public class SysUserRoleSerrvice extends MybatisBaseService<SysUserRoleMapper, S
|
||||
}
|
||||
|
||||
public ResultBean alterUserRole(SysUserRole sysUserRole){
|
||||
SysUser user = Const.getUser();
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
sysUserRole.setUpdateBySid(user.getSid());
|
||||
sysUserRole.setModifyTime(new Date());
|
||||
int i = sysUserRoleMapper.updateById(sysUserRole);
|
||||
if (i == 0){
|
||||
@@ -50,4 +44,9 @@ public class SysUserRoleSerrvice extends MybatisBaseService<SysUserRoleMapper, S
|
||||
}
|
||||
}
|
||||
|
||||
public ResultBean selectUserRole(){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<SysUserRole> userRolesList = sysUserRoleMapper.selectUserRoleList();
|
||||
return rb.setData(userRolesList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.yxt.demo.system.utils;
|
||||
|
||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
||||
/**
|
||||
* @author shkstart
|
||||
* @create 2023-04-26-14:42
|
||||
*/
|
||||
public class Const{
|
||||
public static final long EXPIRATION_TIME = 3600 * 24 * 7; // 以秒计
|
||||
public static final String SECRET = "sinsinsinsinsinsinnetnetnetnetnetnet"; // JWT密码
|
||||
public static final String TOKEN_PREFIX = "Bearer"; // Token前缀
|
||||
public static final String HEADER_STRING = "Authorization"; // 存放Token的Header Key
|
||||
public static final String AUTHORITY = "admin"; //管理员
|
||||
|
||||
|
||||
public static SysUser getUser(){
|
||||
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
if(principal instanceof SysUser){
|
||||
return (SysUser)principal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user