志愿信息管理系统的开发与分享

        完成度90%的志愿信息管理系统,可作为大学、疫情等志愿信息管理系统使用。 下方有代码地址,可以去码云上下载 https://gitee.com/huyande/nuvms.git

技术点

  • 后端 JAVA  框架 SPRINGBOOT
  • 数据库 MYSQL
  • 前端 VUE

功能点

  • 登录 修改用户信息
  • 招募管理
  • 活动管理
  • 活动审核
  • 志愿者时数查询
  • 志愿者时数管理
  • 志愿者信用名单管理
  • 系统管理
    • 用户管理

登录页面 

 

 https://gitee.com/huyande/nuvms.git

放些代码吧,csdn的发文助手跟个智障一样。。。。服了

package com.hznuvms.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hznuvms.common.lang.Result;
import com.hznuvms.entity.Admin;
import com.hznuvms.mapper.AdminMapper;
import com.hznuvms.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @since 2022-03-10
 */
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    AdminService adminService;

    @Autowired
    private AdminMapper adminMapper;

    //@RequiresAuthentication
    @PostMapping("/add")
    public Result addUser(@Validated @RequestBody Admin admin) {
        if (adminService.getOne(new QueryWrapper<Admin>().eq("a_StudentId", admin.getAStudentid())) != null) {
            return Result.fail(admin.getAStudentid() + "用户已存在");
        }
        return Result.succ("添加用户成功!", adminService.save(admin));
        // Admin admin = adminService.getById("2018212212300");
        // return Result.succ(admin);
    }

    @GetMapping("/query")
    public PageInfo<Admin> query(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "20") Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Admin> admins = adminMapper.getAdmin();

        Page page = (Page) admins;
        PageInfo<Admin> result = new PageInfo<>(admins);
        return result;
    }

    @GetMapping("getUserById")
    public Result getUserById(@RequestParam String astudentid) {
        Admin admin = adminService.getById(astudentid);
        if(admin == null){
            return Result.fail("用户不存在");
        }
        return Result.succ(admin);
    }

    @PostMapping("updateUser")
    public Result updateUser(@RequestBody Admin admin) {
        return Result.succ("修改成功 ",adminService.updateById(admin));
    }

    @GetMapping("deleteUser")
    public Result deleteUser(@RequestParam String astudentid) {
        return Result.succ("删除成功",adminMapper.deleteById(astudentid));
    }

    @GetMapping("updatePassword")
    public Result updatePassword(@RequestParam String astudentid,@RequestParam String apassword){
        Admin admin = adminService.getById(astudentid);
        if(admin == null){
            return Result.fail("用户不存在");
        }
        else{
            //只更新一个属性,把id为satudentid的用密码更新为apassword,其他属性不变
            UpdateWrapper<Admin> updateWrapper = new UpdateWrapper<>();
            updateWrapper.eq("a_studentId",astudentid).set("a_password", apassword);
            return  Result.succ("密码修改成功",adminMapper.update(null, updateWrapper));
        }
    }
}

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

古月_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值