团队第二阶段冲刺04
一、前言
1、昨天完成了:
加强系统安全性:我们将引入身份认证和权限管理机制,确保系统的安全性和稳定性。
2、今天完成了:
增加用户反馈系统:我们将为用户提供反馈系统,方便用户提交建议和问题,以便及时改进和优化系统。
3、遇到的困难:
用户反馈系统的功能还不够完善,还需要继续改进
二、冲刺进度
-
1.任务量:10天
目前已经花费的时间:4天
还剩余的时间:6天
三、逻辑代码
package com.medicalretrieval.pojo.user; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; @Entity @Data @NoArgsConstructor @AllArgsConstructor public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(columnDefinition = "varchar(128) not null default '' ") private String account=""; @Column(columnDefinition = "varchar(128) not null default '' ") private String password=""; @Column(columnDefinition = "varchar(128) not null default '' ") private String email=""; @Column(columnDefinition = "int not null default '0'") private int sex = 0; @Column(columnDefinition = "varchar(128) not null default '' ") private String telephone=""; @Column(columnDefinition = "int not null default '0' ") private int permissionGroupId=0; @Column(columnDefinition = "varchar(128) not null default '' ") private String avatar="http://192.168.43.144:8080/avatar/default_avatar_man.png"; @Column(columnDefinition = "int not null default '0' ") private int disabled=0; }
package com.medicalretrieval.controller; import com.medicalretrieval.pojo.user.User; import com.medicalretrieval.service.UserService; import com.medicalretrieval.utils.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/user") public class UserController { @Autowired private UserService userService; @PostMapping("/") User addUser(@RequestBody User user){ if (user.getSex()==1){ user.setAvatar("http://192.168.43.144:8080/avatar/default_avatar_female.png"); } System.out.println(user); userService.save(user); System.out.println("添加成功:"+user); return user; } @DeleteMapping("/{id}") Object deleteUser(@PathVariable String id){ userService.deleteById(Long.parseLong(id)); return Result.success(); } @PutMapping("/") Object updateUser(@RequestBody User user){ userService.updatePasswordAndEmailAndTelephoneAndPermissionGroupIdAndAvatarAndDisabledById(user.getPassword(),user.getEmail(),user.getTelephone(), user.getPermissionGroupId(), user.getAvatar(), user.getDisabled(), user.getId()); System.out.println("修改成功:"+user); return Result.success(); } @GetMapping("/") Object queryUser(String account,String password){ User user = userService.findByAccountAndPassword(account,password); if (user==null){ return Result.fail("登录失败,用户名或密码错误"); } System.out.println("查询成功:"+user); return Result.success(user); } }